@Test public void onViewClickTest() { onPostViewClickListener.onViewClick(viewMock, post); final ShadowActivity shadowActivity = Shadows.shadowOf(postsActivity); final Intent intent = shadowActivity.peekNextStartedActivityForResult().intent; assertThat(intent.getComponent()).isEqualTo(new ComponentName(postsActivity, PostActivity.class)); assertThat(intent.getExtras().getInt(Post.USER_ID)).isEqualTo(getExtras(post).getInt(Post.USER_ID)); assertThat(intent.getExtras().getInt(Post.ID)).isEqualTo(getExtras(post).getInt(Post.ID)); assertThat(intent.getExtras().getInt(Post.TITLE)).isEqualTo(getExtras(post).getInt(Post.TITLE)); assertThat(intent.getExtras().getInt(Post.BODY)).isEqualTo(getExtras(post).getInt(Post.BODY)); }
@Override public void onViewClick(final View sharedElementView, final Post post) { final Intent intent = new Intent(activity.getApplicationContext(), PostActivity.class); intent.putExtras(getExtras(post)); final ActivityOptionsCompat activityOptionsCompat = ActivityOptionsCompat .makeSceneTransitionAnimation(activity, sharedElementView, avatarSharedElement); VersionUtilities.startActivity(activity, intent, activityOptionsCompat.toBundle()); }
OnPostViewClickListener implements OnViewClickListener { @Override public void onViewClick(final View sharedElementView, final Post post) { final Intent intent = new Intent(activity.getApplicationContext(), PostActivity.class); intent.putExtras(getExtras(post)); final ActivityOptionsCompat activityOptionsCompat = ActivityOptionsCompat .makeSceneTransitionAnimation(activity, sharedElementView, avatarSharedElement); VersionUtilities.startActivity(activity, intent, activityOptionsCompat.toBundle()); } }
OnPostViewClickListener implements OnViewClickListener { @Override public void onViewClick(final View sharedElementView, final Post post) { final Intent intent = new Intent(activity.getApplicationContext(), PostActivity.class); intent.putExtras(getExtras(post)); final ActivityOptionsCompat activityOptionsCompat = ActivityOptionsCompat .makeSceneTransitionAnimation(activity, sharedElementView, avatarSharedElement); VersionUtilities.startActivity(activity, intent, activityOptionsCompat.toBundle()); } OnPostViewClickListener(final Activity activity); }
OnPostViewClickListener implements OnViewClickListener { @Override public void onViewClick(final View sharedElementView, final Post post) { final Intent intent = new Intent(activity.getApplicationContext(), PostActivity.class); intent.putExtras(getExtras(post)); final ActivityOptionsCompat activityOptionsCompat = ActivityOptionsCompat .makeSceneTransitionAnimation(activity, sharedElementView, avatarSharedElement); VersionUtilities.startActivity(activity, intent, activityOptionsCompat.toBundle()); } OnPostViewClickListener(final Activity activity); @Override void onViewClick(final View sharedElementView, final Post post); }
OnPostViewClickListener implements OnViewClickListener { @Override public void onViewClick(final View sharedElementView, final Post post) { final Intent intent = new Intent(activity.getApplicationContext(), PostActivity.class); intent.putExtras(getExtras(post)); final ActivityOptionsCompat activityOptionsCompat = ActivityOptionsCompat .makeSceneTransitionAnimation(activity, sharedElementView, avatarSharedElement); VersionUtilities.startActivity(activity, intent, activityOptionsCompat.toBundle()); } OnPostViewClickListener(final Activity activity); @Override void onViewClick(final View sharedElementView, final Post post);  }