From c4fde665d0b5bd1319571f4d3fdbde364027b2d3 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Thu, 22 Sep 2022 18:55:16 +0200 Subject: [PATCH 1/2] fix linter --- .../main/java/com/github/libretube/ui/activities/MainActivity.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt index 19da429fb..694316171 100644 --- a/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt @@ -7,7 +7,6 @@ import android.os.Build import android.os.Bundle import android.os.Handler import android.os.Looper -import android.util.Log import android.view.Menu import android.view.MenuItem import android.view.View From e888b8a0610a43e892833cde543a9015bd1061fb Mon Sep 17 00:00:00 2001 From: Bnyro Date: Thu, 22 Sep 2022 19:08:00 +0200 Subject: [PATCH 2/2] dont close app accidentially --- .../java/com/github/libretube/ui/fragments/PlayerFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt index b014ed6fb..d25c8a525 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt @@ -1026,9 +1026,9 @@ class PlayerFragment : BaseFragment() { } // listen for the stop button in the notification - if (playbackState == PlaybackState.STATE_STOPPED) { + if (playbackState == PlaybackState.STATE_STOPPED && SDK_INT >= Build.VERSION_CODES.O) { // finish PiP by finishing the activity - activity?.finish() + if (activity?.isInPictureInPictureMode!!) activity?.finish() } super.onPlaybackStateChanged(playbackState) }