Skip to content

Instantly share code, notes, and snippets.

View taworn's full-sized avatar

Taworn T. taworn

View GitHub Profile
@taworn
taworn / overridePendingTransition.snippets
Last active September 22, 2018 11:09
Where to put overridePendingTransition?
The method overridePendingTransition() should put after called startActivity[ForResult]() for enter. And then put after finish() to exit. If we put this in onCreate(), they may be a chance to mistake.
When start:
startActivityForResult(intent, ...);
overridePendingTransition(R.animator.anim_slide_left_to_right_enter, R.animator.anim_slide_left_to_right_leave);
When exit:
finish();
overridePendingTransition(R.animator.anim_slide_right_to_left_enter, R.animator.anim_slide_right_to_left_leave);
@taworn
taworn / 0_reuse_code.js
Last active August 29, 2015 14:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console