From 58f97b74a845866d9000f27482b2e3038b5392b0 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sun, 17 Jan 2016 15:03:39 +0800 Subject: [PATCH] Correctly view user profile image and banner in MediaViewer --- .../mariotaku/twidere/fragment/support/UserFragment.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/twidere/src/main/java/org/mariotaku/twidere/fragment/support/UserFragment.java b/twidere/src/main/java/org/mariotaku/twidere/fragment/support/UserFragment.java index e87fd94ca..cb6abef4b 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/fragment/support/UserFragment.java +++ b/twidere/src/main/java/org/mariotaku/twidere/fragment/support/UserFragment.java @@ -44,6 +44,7 @@ import android.nfc.NfcAdapter.CreateNdefMessageCallback; import android.nfc.NfcEvent; import android.os.Build; import android.os.Bundle; +import android.os.Parcelable; import android.support.annotation.NonNull; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; @@ -1222,7 +1223,9 @@ public class UserFragment extends BaseSupportFragment implements OnClickListener } case R.id.profile_image: { final String url = Utils.getOriginalTwitterProfileImage(user.profile_image_url); - final ParcelableMedia[] media = {ParcelableMedia.image(url)}; + ParcelableMedia profileImage = ParcelableMedia.image(url); + profileImage.type = ParcelableMedia.Type.TYPE_IMAGE; + final ParcelableMedia[] media = {profileImage}; Bundle options = Utils.createMediaViewerActivityOption(view); Utils.openMedia(activity, user.account_id, false, null, media, options); break; @@ -1230,7 +1233,9 @@ public class UserFragment extends BaseSupportFragment implements OnClickListener case R.id.profile_banner: { if (user.profile_banner_url == null) return; final String url = user.profile_banner_url + "/ipad_retina"; - final ParcelableMedia[] media = {ParcelableMedia.image(url)}; + ParcelableMedia profileBanner = ParcelableMedia.image(url); + profileBanner.type = ParcelableMedia.Type.TYPE_IMAGE; + final ParcelableMedia[] media = {profileBanner}; Bundle options = Utils.createMediaViewerActivityOption(view); Utils.openMedia(activity, user.account_id, false, null, media, options); break;