Skip to content

Instantly share code, notes, and snippets.

@vsay01
Last active August 27, 2017 21:18
Show Gist options
  • Save vsay01/5305f18f721f95544b876d1ba7a04a07 to your computer and use it in GitHub Desktop.
Save vsay01/5305f18f721f95544b876d1ba7a04a07 to your computer and use it in GitHub Desktop.
public class EventHandler {
public Context mContext;
public EventHandler(Context context) {
this.mContext = context;
}
public void onEventClicked(View circleImageView, Event event) {
if (mContext != null) {
Intent intent = new Intent(mContext, DetailActivity.class);
intent.putExtra(Constants.EVENT_EXTRA, new Gson().toJson(event));
ActivityOptionsCompat options = ActivityOptionsCompat.
makeSceneTransitionAnimation((Activity) mContext, circleImageView, mContext.getString(R.string.sharedElement));
mContext.startActivity(intent, options.toBundle());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment