From 15f6835a0cf35265e1cdcbbfcdfda684222ae12f Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 18 Nov 2020 19:04:54 +0100 Subject: [PATCH] Some fixes --- .../app/fedilab/fedilabtube/PeertubeActivity.java | 13 ++++++++++--- .../fedilab/fedilabtube/drawer/MenuItemAdapter.java | 6 +++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java index 861c9f8..be0e740 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java +++ b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java @@ -1360,11 +1360,18 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd break; case CAPTION: Uri uri = null; - if (item.getId() != -1) { + Caption captionToUse = null; + for (Caption caption : captions) { + if (caption.getLanguage().getId().compareTo(item.getStrId()) == 0) { + captionToUse = caption; + break; + } + } + if (captionToUse != null) { if (!sepiaSearch) { - uri = Uri.parse("https://" + getLiveInstance(PeertubeActivity.this) + captions.get(item.getId()).getCaptionPath()); + uri = Uri.parse("https://" + getLiveInstance(PeertubeActivity.this) + captionToUse.getCaptionPath()); } else { - uri = Uri.parse("https://" + peertubeInstance + captions.get(item.getId()).getCaptionPath()); + uri = Uri.parse("https://" + peertubeInstance + captionToUse.getCaptionPath()); } } currentCaption = item.getStrId(); diff --git a/app/src/main/java/app/fedilab/fedilabtube/drawer/MenuItemAdapter.java b/app/src/main/java/app/fedilab/fedilabtube/drawer/MenuItemAdapter.java index c32c2ac..f883217 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/drawer/MenuItemAdapter.java +++ b/app/src/main/java/app/fedilab/fedilabtube/drawer/MenuItemAdapter.java @@ -26,6 +26,7 @@ import java.util.List; import app.fedilab.fedilabtube.client.MenuItemVideo; import app.fedilab.fedilabtube.client.entities.MenuItemView; import app.fedilab.fedilabtube.databinding.DrawerMenuItemBinding; +import app.fedilab.fedilabtube.helper.Helper; public class MenuItemAdapter extends RecyclerView.Adapter { @@ -67,7 +68,10 @@ public class MenuItemAdapter extends RecyclerView.Adapter itemAction.which(actionType, item)); + holder.binding.itemMenuContainer.setOnClickListener(v -> { + itemAction.which(actionType, item); + + }); }