Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <item name="android:windowContentTransitions">true</item>
- <item name="android:windowActivityTransitions">true</item>
- Item clieckedItem = (Item) allResults.get(position);
- photo = clieckedItem.getImageUrl();
- nameText = clieckedItem.getTitle();
- if (photo != null) {
- Picasso.with(MainActivity.this).load(photo).fit().into(mImageView);
- }
- mTextView.setText(nameText);
- Pair[] pair = new Pair[2];
- pair[0] = new Pair<View, String>(mImageView, "image_shared");
- pair[1] = new Pair<View, String>(mTextView, "texview_shared");
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
- ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this, pair);
- Intent intent = new Intent(MainActivity.this, SharedElementActivity.class);
- startActivity(intent, options.toBundle());
- protected void onCreate(Bundle savedInstanceState) {
- getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_shared_element);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement