This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline fun <reified T> Collection<*>.ofType(): Collection<T> = filter { it is T }.map { it as T } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void finishAfterTransition() { | |
setResult(); | |
super.finishAfterTransition(); | |
} | |
private void setResult() { | |
int position = mViewPager.getCurrentItem(); | |
Intent data = new Intent(); | |
data.putExtra(EXTRA_POSITION, position); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void onActivityReenter(int resultCode, Intent data) { | |
final int position = PreviewActivity.getPosition(resultCode, data); | |
if (position != RecyclerView.NO_POSITION) { | |
mRecyclerView.scrollToPosition(position); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(activity, sharedElements); | |
ActivityCompat.startActivityForResult(activity, intent, requestCode, options.toBundle()); |
NewerOlder