Fix a few SonarLint warnings

This commit is contained in:
TobiGr 2021-09-04 22:36:20 +02:00
parent 433c6dc33b
commit 4d51ebc37a
6 changed files with 16 additions and 9 deletions

View file

@ -360,7 +360,7 @@ public final class NavigationHelper {
autoPlay = false;
}
final RunnableWithVideoDetailFragment onVideoDetailFragmentReady = (detailFragment) -> {
final RunnableWithVideoDetailFragment onVideoDetailFragmentReady = detailFragment -> {
expandMainPlayer(detailFragment.requireActivity());
detailFragment.setAutoPlay(autoPlay);
if (switchingPlayers) {

View file

@ -119,7 +119,7 @@ public final class PermissionHelper {
public static boolean isPopupEnabled(final Context context) {
return Build.VERSION.SDK_INT < Build.VERSION_CODES.M
|| PermissionHelper.checkSystemAlertWindowPermission(context);
|| checkSystemAlertWindowPermission(context);
}
public static void showPopupEnablementToast(final Context context) {

View file

@ -101,7 +101,12 @@ public final class InternalUrlsHandler {
return false;
}
final String matchedUrl = matcher.group(1);
final int seconds = Integer.parseInt(matcher.group(2));
final int seconds;
if (matcher.group(2) == null) {
seconds = -1;
} else {
seconds = Integer.parseInt(matcher.group(2));
}
final StreamingService service;
final StreamingService.LinkType linkType;
@ -154,7 +159,7 @@ public final class InternalUrlsHandler {
.observeOn(AndroidSchedulers.mainThread())
.subscribe(info -> {
final PlayQueue playQueue
= new SinglePlayQueue(info, seconds * 1000);
= new SinglePlayQueue(info, seconds * 1000L);
NavigationHelper.playOnPopupPlayer(context, playQueue, false);
}, throwable -> {
if (DEBUG) {