Add audio support for timelines (#1466)

* Add minimal audio support for timelines

* fix attachment description formatting
This commit is contained in:
Konrad Pozniak 2019-09-05 21:07:01 +02:00 committed by GitHub
commit 344863b5d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 46 additions and 11 deletions

View file

@ -310,7 +310,8 @@ public abstract class SFragment extends BaseFragment implements Injectable {
switch (type) {
case GIFV:
case VIDEO:
case IMAGE: {
case IMAGE:
case AUDIO: {
final List<AttachmentViewData> attachments = AttachmentViewData.list(actionable);
final Intent intent = ViewMediaActivity.newIntent(getContext(), attachments,
urlIndex);

View file

@ -51,7 +51,8 @@ abstract class ViewMediaFragment : BaseFragment(), SharedElementTransitionListen
val fragment = when (attachment.type) {
Attachment.Type.IMAGE -> ViewImageFragment()
Attachment.Type.VIDEO,
Attachment.Type.GIFV -> ViewVideoFragment()
Attachment.Type.GIFV,
Attachment.Type.AUDIO -> ViewVideoFragment()
else -> ViewImageFragment() // it probably won't show anything, but its better than crashing
}
fragment.arguments = arguments