From 871e720ae5c905b46239224d701fd21e9e683a8c Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Sun, 8 Sep 2019 19:35:43 +0200 Subject: [PATCH] fix audio attachments not opening in some cases (#1473) --- .../components/report/fragments/ReportStatusesFragment.kt | 2 +- .../components/search/fragments/SearchStatusesFragment.kt | 2 +- .../com/keylesspalace/tusky/fragment/AccountMediaFragment.kt | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/components/report/fragments/ReportStatusesFragment.kt b/app/src/main/java/com/keylesspalace/tusky/components/report/fragments/ReportStatusesFragment.kt index 50d4861f..2fc35d11 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/report/fragments/ReportStatusesFragment.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/report/fragments/ReportStatusesFragment.kt @@ -74,7 +74,7 @@ class ReportStatusesFragment : Fragment(), Injectable, AdapterHandler { override fun showMedia(v: View?, status: Status?, idx: Int) { status?.actionableStatus?.let { actionable -> when (actionable.attachments[idx].type) { - Attachment.Type.GIFV, Attachment.Type.VIDEO, Attachment.Type.IMAGE -> { + Attachment.Type.GIFV, Attachment.Type.VIDEO, Attachment.Type.IMAGE, Attachment.Type.AUDIO -> { val attachments = AttachmentViewData.list(actionable) val intent = ViewMediaActivity.newIntent(context, attachments, idx) diff --git a/app/src/main/java/com/keylesspalace/tusky/components/search/fragments/SearchStatusesFragment.kt b/app/src/main/java/com/keylesspalace/tusky/components/search/fragments/SearchStatusesFragment.kt index 707288ca..fe9f0641 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/search/fragments/SearchStatusesFragment.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/search/fragments/SearchStatusesFragment.kt @@ -103,7 +103,7 @@ class SearchStatusesFragment : SearchFragment when (actionable.attachments[attachmentIndex].type) { - Attachment.Type.GIFV, Attachment.Type.VIDEO, Attachment.Type.IMAGE -> { + Attachment.Type.GIFV, Attachment.Type.VIDEO, Attachment.Type.IMAGE, Attachment.Type.AUDIO -> { val attachments = AttachmentViewData.list(actionable) val intent = ViewMediaActivity.newIntent(context, attachments, attachmentIndex) diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/AccountMediaFragment.kt b/app/src/main/java/com/keylesspalace/tusky/fragment/AccountMediaFragment.kt index db6afa2f..988dbc12 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/AccountMediaFragment.kt +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/AccountMediaFragment.kt @@ -262,7 +262,8 @@ class AccountMediaFragment : BaseFragment(), RefreshableFragment, Injectable { when (items[currentIndex].attachment.type) { Attachment.Type.IMAGE, Attachment.Type.GIFV, - Attachment.Type.VIDEO -> { + Attachment.Type.VIDEO, + Attachment.Type.AUDIO -> { val intent = ViewMediaActivity.newIntent(context, items, currentIndex) if (view != null && activity != null) { val url = items[currentIndex].attachment.url