@Override public void onClick(View v) {
ActivityOptionsCompat optionsCompat =
ActivityOptionsCompat.makeSceneTransitionAnimation(
SharedElementActivity.this, draweeView, SHARED_ELEMENT_NAME);
ActivityCompat.setExitSharedElementCallback(SharedElementActivity.this,
new androidx.core.app.SharedElementCallback() {
@Override
public void onSharedElementEnd(List<String> sharedElementNames,
List<View> sharedElements, List<View> sharedElementSnapshots) {
super.onSharedElementEnd(sharedElementNames, sharedElements,
sharedElementSnapshots);
for (final View view : sharedElements) {
if (view instanceof SimpleDraweeView) {
view.setVisibility(View.VISIBLE);
}
}
}
});
ActivityCompat.startActivity(SharedElementActivity.this,
new Intent(SharedElementActivity.this, SharedElementLaunchedActivity.class),
optionsCompat.toBundle());
}
});