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) {
|
override fun showMedia(v: View?, status: Status?, idx: Int) {
|
||||||
status?.actionableStatus?.let { actionable ->
|
status?.actionableStatus?.let { actionable ->
|
||||||
when (actionable.attachments[idx].type) {
|
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 attachments = AttachmentViewData.list(actionable)
|
||||||
val intent = ViewMediaActivity.newIntent(context, attachments,
|
val intent = ViewMediaActivity.newIntent(context, attachments,
|
||||||
idx)
|
idx)
|
||||||
|
|
|
@ -103,7 +103,7 @@ class SearchStatusesFragment : SearchFragment<Pair<Status, StatusViewData.Concre
|
||||||
override fun onViewMedia(position: Int, attachmentIndex: Int, view: View?) {
|
override fun onViewMedia(position: Int, attachmentIndex: Int, view: View?) {
|
||||||
(adapter as? SearchStatusesAdapter)?.getItem(position)?.first?.actionableStatus?.let { actionable ->
|
(adapter as? SearchStatusesAdapter)?.getItem(position)?.first?.actionableStatus?.let { actionable ->
|
||||||
when (actionable.attachments[attachmentIndex].type) {
|
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 attachments = AttachmentViewData.list(actionable)
|
||||||
val intent = ViewMediaActivity.newIntent(context, attachments,
|
val intent = ViewMediaActivity.newIntent(context, attachments,
|
||||||
attachmentIndex)
|
attachmentIndex)
|
||||||
|
|
|
@ -262,7 +262,8 @@ class AccountMediaFragment : BaseFragment(), RefreshableFragment, Injectable {
|
||||||
when (items[currentIndex].attachment.type) {
|
when (items[currentIndex].attachment.type) {
|
||||||
Attachment.Type.IMAGE,
|
Attachment.Type.IMAGE,
|
||||||
Attachment.Type.GIFV,
|
Attachment.Type.GIFV,
|
||||||
Attachment.Type.VIDEO -> {
|
Attachment.Type.VIDEO,
|
||||||
|
Attachment.Type.AUDIO -> {
|
||||||
val intent = ViewMediaActivity.newIntent(context, items, currentIndex)
|
val intent = ViewMediaActivity.newIntent(context, items, currentIndex)
|
||||||
if (view != null && activity != null) {
|
if (view != null && activity != null) {
|
||||||
val url = items[currentIndex].attachment.url
|
val url = items[currentIndex].attachment.url
|
||||||
|
|
Loading…
Reference in a new issue