diff options
author | Thomas <tschneider.ac@gmail.com> | 2024-01-19 17:44:45 +0100 |
---|---|---|
committer | Thomas <tschneider.ac@gmail.com> | 2024-01-19 17:44:45 +0100 |
commit | d2535fd2f848a3181511ea5231799d9b269fb363 (patch) | |
tree | 8d610566ccfb18919961970ea00170b875999822 | |
parent | 4204f658d7e99fca410d2ecddb044e7aabd60ceb (diff) |
Allow to display banner as a media
-rw-r--r-- | app/src/main/java/app/fedilab/android/mastodon/activities/ProfileActivity.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/app/src/main/java/app/fedilab/android/mastodon/activities/ProfileActivity.java b/app/src/main/java/app/fedilab/android/mastodon/activities/ProfileActivity.java index a1a83bd19..caf0c46f5 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/activities/ProfileActivity.java +++ b/app/src/main/java/app/fedilab/android/mastodon/activities/ProfileActivity.java @@ -498,6 +498,30 @@ public class ProfileActivity extends BaseActivity { binding.accountNote.setMovementMethod(LinkMovementMethod.getInstance()); + binding.bannerPp.setOnClickListener(v -> { + Intent intent = new Intent(ProfileActivity.this, MediaActivity.class); + Bundle args = new Bundle(); + Attachment attachment = new Attachment(); + attachment.description = account.acct; + attachment.preview_url = account.header; + attachment.url = account.header; + attachment.remote_url = account.header; + attachment.type = "image"; + ArrayList<Attachment> attachments = new ArrayList<>(); + attachments.add(attachment); + args.putSerializable(Helper.ARG_MEDIA_ARRAY, attachments); + args.putInt(Helper.ARG_MEDIA_POSITION, 1); + new CachedBundle(ProfileActivity.this).insertBundle(args, currentAccount, bundleId -> { + Bundle bundle = new Bundle(); + bundle.putLong(Helper.ARG_INTENT_ID, bundleId); + intent.putExtras(bundle); + ActivityOptionsCompat options = ActivityOptionsCompat + .makeSceneTransitionAnimation(ProfileActivity.this, binding.accountPp, attachment.url); + // start the new activity + startActivity(intent, options.toBundle()); + }); + }); + binding.accountPp.setOnClickListener(v -> { Intent intent = new Intent(ProfileActivity.this, MediaActivity.class); Bundle args = new Bundle(); |