From fef9d541ede88701b5519160fa4a176d6467248f Mon Sep 17 00:00:00 2001 From: kapodamy Date: Thu, 15 Nov 2018 22:30:00 -0300 Subject: [PATCH] misc fixes * use getPreferredLocalization() instead of getLocalization() * use lastest commit in build.gradle * fix missing cast in MissionAdapter.java --- app/build.gradle | 2 +- .../main/java/org/schabi/newpipe/download/DownloadDialog.java | 2 +- .../main/java/us/shandian/giga/ui/adapter/MissionAdapter.java | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b507fd860..aab3ae17c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -54,7 +54,7 @@ dependencies { exclude module: 'support-annotations' }) - implementation 'com.github.TeamNewPipe:NewPipeExtractor:32d316330c26' + implementation 'com.github.TeamNewPipe:NewPipeExtractor:91b1efc97e' testImplementation 'junit:junit:4.12' testImplementation 'org.mockito:mockito-core:2.23.0' diff --git a/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java b/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java index d68db11e5..493ed44ea 100644 --- a/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java +++ b/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java @@ -376,7 +376,7 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck } private int getSubtitleIndexBy(List streams) { - Localization loc = NewPipe.getLocalization(); + Localization loc = NewPipe.getPreferredLocalization(); for (int j = 0; j < 2; j++) { for (int i = 0; i < streams.size(); i++) { Locale streamLocale = streams.get(i).getLocale(); diff --git a/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java b/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java index 7827c822e..bb5af1b0d 100644 --- a/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java +++ b/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java @@ -577,7 +577,8 @@ public class MissionAdapter extends RecyclerView.Adapter { checksum = menu.findItem(R.id.checksum); itemView.setOnClickListener((v) -> { - if(h.mission.finished) viewWithFileProvider(h); + if(((DownloadMission)item.mission).isFinished()) + viewWithFileProvider(item.mission.getDownloadedFile()); }); //h.itemView.setOnClickListener(v -> showDetail(h));