fix audio attachments not opening in some cases (#1473)
This commit is contained in:
parent
60383e112a
commit
871e720ae5
3 changed files with 4 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -103,7 +103,7 @@ class SearchStatusesFragment : SearchFragment<Pair<Status, StatusViewData.Concre
|
|||
override fun onViewMedia(position: Int, attachmentIndex: Int, view: View?) {
|
||||
(adapter as? SearchStatusesAdapter)?.getItem(position)?.first?.actionableStatus?.let { actionable ->
|
||||
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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue