添付メディアがunknown一枚だけならサムネイルのタップで内蔵ビューアを使わずインテントを投げる

This commit is contained in:
tateisu 2019-01-18 21:28:02 +09:00
parent 588e099971
commit 62a9eeed49
1 changed files with 19 additions and 13 deletions

View File

@ -2052,20 +2052,26 @@ internal class ItemViewHolder(
)
}
is TootAttachment -> {
if(Pref.bpUseInternalMediaViewer(App1.pref)) {
// 内蔵メディアビューア
val serviceType = when(access_info.isMisskey) {
true -> ServiceType.MISSKEY
else -> ServiceType.MASTODON
}
ActMediaViewer.open(activity, serviceType, media_attachments, i)
} else {
// ブラウザで開く
is TootAttachment -> when {
// unknownが1枚だけなら内蔵ビューアを使わずにインテントを投げる
item.type == TootAttachmentLike.TYPE_UNKNOWN && media_attachments.size == 1 ->
App1.openCustomTab(activity, item)
}
// 内蔵メディアビューアを使う
Pref.bpUseInternalMediaViewer(App1.pref) ->
ActMediaViewer.open(
activity,
when(access_info.isMisskey) {
true -> ServiceType.MISSKEY
else -> ServiceType.MASTODON
},
media_attachments,
i
)
// ブラウザで開く
else -> App1.openCustomTab(activity, item)
}
}
} catch(ex : Throwable) {