address pull request feedback
This commit is contained in:
parent
83faf119a9
commit
48a5107296
6 changed files with 17 additions and 24 deletions
|
|
@ -4,9 +4,11 @@ package org.schabi.newpipe.util;
|
|||
import android.content.Context;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import org.schabi.newpipe.R;
|
||||
import org.schabi.newpipe.extractor.ServiceList;
|
||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||
|
||||
public final class KoreUtil {
|
||||
private KoreUtil() { }
|
||||
|
|
@ -16,6 +18,12 @@ public final class KoreUtil {
|
|||
|| serviceId == ServiceList.SoundCloud.getServiceId());
|
||||
}
|
||||
|
||||
public static boolean shouldShowPlayWithKodi(final Context context, final StreamInfoItem item) {
|
||||
return isServiceSupportedByKore(item.getServiceId())
|
||||
&& PreferenceManager.getDefaultSharedPreferences(context)
|
||||
.getBoolean(context.getString(R.string.show_play_with_kodi_key), false);
|
||||
}
|
||||
|
||||
public static void showInstallKoreDialog(final Context context) {
|
||||
final AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setMessage(R.string.kore_not_found)
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public enum StreamDialogEntry {
|
|||
}
|
||||
}),
|
||||
|
||||
play_on_kodi(R.string.play_with_kodi_title, (fragment, item) -> {
|
||||
play_with_kodi(R.string.play_with_kodi_title, (fragment, item) -> {
|
||||
final Uri videoUrl = Uri.parse(item.getUrl());
|
||||
try {
|
||||
NavigationHelper.playWithKore(fragment.getContext(), videoUrl);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue