From b97965fcafbb1fa8f7ee20dbbb7e3e017ad57d96 Mon Sep 17 00:00:00 2001 From: zechs Date: Thu, 9 Feb 2023 17:05:22 +0530 Subject: [PATCH 1/5] added missing annotations --- .../main/java/zechs/drive/stream/ui/player/PlayerActivity.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/zechs/drive/stream/ui/player/PlayerActivity.kt b/app/src/main/java/zechs/drive/stream/ui/player/PlayerActivity.kt index fbb02d4..f2822e5 100644 --- a/app/src/main/java/zechs/drive/stream/ui/player/PlayerActivity.kt +++ b/app/src/main/java/zechs/drive/stream/ui/player/PlayerActivity.kt @@ -14,6 +14,7 @@ import android.widget.HorizontalScrollView import android.widget.LinearLayout import android.widget.Toast import androidx.activity.viewModels +import androidx.annotation.RequiresApi import androidx.appcompat.app.AppCompatActivity import androidx.core.content.ContextCompat import androidx.core.view.* @@ -249,6 +250,7 @@ class PlayerActivity : AppCompatActivity() { playMedia() } + @RequiresApi(Build.VERSION_CODES.O) private fun enterPIPMode() { this.enterPictureInPictureMode( PictureInPictureParams @@ -639,6 +641,7 @@ class PlayerActivity : AppCompatActivity() { } } + @RequiresApi(Build.VERSION_CODES.O) override fun onPictureInPictureModeChanged( isInPictureInPictureMode: Boolean, newConfig: Configuration From 17642d3e0301f321f9368d75ffa1570bbb175e8d Mon Sep 17 00:00:00 2001 From: zechs Date: Thu, 9 Feb 2023 17:07:12 +0530 Subject: [PATCH 2/5] fix incorrect import --- app/src/main/java/zechs/drive/stream/ui/player2/MPVActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/zechs/drive/stream/ui/player2/MPVActivity.kt b/app/src/main/java/zechs/drive/stream/ui/player2/MPVActivity.kt index ee6279b..75f44cc 100644 --- a/app/src/main/java/zechs/drive/stream/ui/player2/MPVActivity.kt +++ b/app/src/main/java/zechs/drive/stream/ui/player2/MPVActivity.kt @@ -10,7 +10,6 @@ import android.os.Build import android.os.Bundle import android.util.Log import android.view.View -import android.view.WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE import android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON import android.widget.SeekBar import androidx.activity.viewModels @@ -19,6 +18,7 @@ import androidx.core.content.ContextCompat import androidx.core.view.WindowCompat import androidx.core.view.WindowInsetsCompat import androidx.core.view.WindowInsetsControllerCompat +import androidx.core.view.WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE import androidx.core.view.isVisible import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope From 227cf200e483c6b4fee39c1c0ef39f54361bda6e Mon Sep 17 00:00:00 2001 From: zechs Date: Thu, 9 Feb 2023 17:51:49 +0530 Subject: [PATCH 3/5] fixed icons on lower android versions --- app/src/main/res/{drawable-v24 => drawable}/ic_audio_24.xml | 0 app/src/main/res/{drawable-v24 => drawable}/ic_back_24.xml | 0 app/src/main/res/{drawable-v24 => drawable}/ic_chapter_24.xml | 0 app/src/main/res/{drawable-v24 => drawable}/ic_delete_24.xml | 0 .../main/res/{drawable-v24 => drawable}/ic_forward_skip_24.xml | 0 app/src/main/res/{drawable-v24 => drawable}/ic_landscape_24.xml | 0 app/src/main/res/{drawable-v24 => drawable}/ic_my_drive_24.xml | 0 app/src/main/res/{drawable-v24 => drawable}/ic_pause_24.xml | 0 app/src/main/res/{drawable-v24 => drawable}/ic_pip_24.xml | 0 app/src/main/res/{drawable-v24 => drawable}/ic_play_24.xml | 0 app/src/main/res/{drawable-v24 => drawable}/ic_portrait_24.xml | 0 app/src/main/res/{drawable-v24 => drawable}/ic_resize_24.xml | 0 app/src/main/res/{drawable-v24 => drawable}/ic_rewind_skip_24.xml | 0 .../main/res/{drawable-v24 => drawable}/ic_shared_drive_24.xml | 0 app/src/main/res/{drawable-v24 => drawable}/ic_shared_me_24.xml | 0 app/src/main/res/{drawable-v24 => drawable}/ic_speed_24.xml | 0 app/src/main/res/{drawable-v24 => drawable}/ic_starred_24.xml | 0 app/src/main/res/{drawable-v24 => drawable}/ic_subtitles_24.xml | 0 18 files changed, 0 insertions(+), 0 deletions(-) rename app/src/main/res/{drawable-v24 => drawable}/ic_audio_24.xml (100%) rename app/src/main/res/{drawable-v24 => drawable}/ic_back_24.xml (100%) rename app/src/main/res/{drawable-v24 => drawable}/ic_chapter_24.xml (100%) rename app/src/main/res/{drawable-v24 => drawable}/ic_delete_24.xml (100%) mode change 100755 => 100644 rename app/src/main/res/{drawable-v24 => drawable}/ic_forward_skip_24.xml (100%) rename app/src/main/res/{drawable-v24 => drawable}/ic_landscape_24.xml (100%) rename app/src/main/res/{drawable-v24 => drawable}/ic_my_drive_24.xml (100%) mode change 100755 => 100644 rename app/src/main/res/{drawable-v24 => drawable}/ic_pause_24.xml (100%) rename app/src/main/res/{drawable-v24 => drawable}/ic_pip_24.xml (100%) rename app/src/main/res/{drawable-v24 => drawable}/ic_play_24.xml (100%) rename app/src/main/res/{drawable-v24 => drawable}/ic_portrait_24.xml (100%) rename app/src/main/res/{drawable-v24 => drawable}/ic_resize_24.xml (100%) rename app/src/main/res/{drawable-v24 => drawable}/ic_rewind_skip_24.xml (100%) rename app/src/main/res/{drawable-v24 => drawable}/ic_shared_drive_24.xml (100%) mode change 100755 => 100644 rename app/src/main/res/{drawable-v24 => drawable}/ic_shared_me_24.xml (100%) mode change 100755 => 100644 rename app/src/main/res/{drawable-v24 => drawable}/ic_speed_24.xml (100%) rename app/src/main/res/{drawable-v24 => drawable}/ic_starred_24.xml (100%) mode change 100755 => 100644 rename app/src/main/res/{drawable-v24 => drawable}/ic_subtitles_24.xml (100%) diff --git a/app/src/main/res/drawable-v24/ic_audio_24.xml b/app/src/main/res/drawable/ic_audio_24.xml similarity index 100% rename from app/src/main/res/drawable-v24/ic_audio_24.xml rename to app/src/main/res/drawable/ic_audio_24.xml diff --git a/app/src/main/res/drawable-v24/ic_back_24.xml b/app/src/main/res/drawable/ic_back_24.xml similarity index 100% rename from app/src/main/res/drawable-v24/ic_back_24.xml rename to app/src/main/res/drawable/ic_back_24.xml diff --git a/app/src/main/res/drawable-v24/ic_chapter_24.xml b/app/src/main/res/drawable/ic_chapter_24.xml similarity index 100% rename from app/src/main/res/drawable-v24/ic_chapter_24.xml rename to app/src/main/res/drawable/ic_chapter_24.xml diff --git a/app/src/main/res/drawable-v24/ic_delete_24.xml b/app/src/main/res/drawable/ic_delete_24.xml old mode 100755 new mode 100644 similarity index 100% rename from app/src/main/res/drawable-v24/ic_delete_24.xml rename to app/src/main/res/drawable/ic_delete_24.xml diff --git a/app/src/main/res/drawable-v24/ic_forward_skip_24.xml b/app/src/main/res/drawable/ic_forward_skip_24.xml similarity index 100% rename from app/src/main/res/drawable-v24/ic_forward_skip_24.xml rename to app/src/main/res/drawable/ic_forward_skip_24.xml diff --git a/app/src/main/res/drawable-v24/ic_landscape_24.xml b/app/src/main/res/drawable/ic_landscape_24.xml similarity index 100% rename from app/src/main/res/drawable-v24/ic_landscape_24.xml rename to app/src/main/res/drawable/ic_landscape_24.xml diff --git a/app/src/main/res/drawable-v24/ic_my_drive_24.xml b/app/src/main/res/drawable/ic_my_drive_24.xml old mode 100755 new mode 100644 similarity index 100% rename from app/src/main/res/drawable-v24/ic_my_drive_24.xml rename to app/src/main/res/drawable/ic_my_drive_24.xml diff --git a/app/src/main/res/drawable-v24/ic_pause_24.xml b/app/src/main/res/drawable/ic_pause_24.xml similarity index 100% rename from app/src/main/res/drawable-v24/ic_pause_24.xml rename to app/src/main/res/drawable/ic_pause_24.xml diff --git a/app/src/main/res/drawable-v24/ic_pip_24.xml b/app/src/main/res/drawable/ic_pip_24.xml similarity index 100% rename from app/src/main/res/drawable-v24/ic_pip_24.xml rename to app/src/main/res/drawable/ic_pip_24.xml diff --git a/app/src/main/res/drawable-v24/ic_play_24.xml b/app/src/main/res/drawable/ic_play_24.xml similarity index 100% rename from app/src/main/res/drawable-v24/ic_play_24.xml rename to app/src/main/res/drawable/ic_play_24.xml diff --git a/app/src/main/res/drawable-v24/ic_portrait_24.xml b/app/src/main/res/drawable/ic_portrait_24.xml similarity index 100% rename from app/src/main/res/drawable-v24/ic_portrait_24.xml rename to app/src/main/res/drawable/ic_portrait_24.xml diff --git a/app/src/main/res/drawable-v24/ic_resize_24.xml b/app/src/main/res/drawable/ic_resize_24.xml similarity index 100% rename from app/src/main/res/drawable-v24/ic_resize_24.xml rename to app/src/main/res/drawable/ic_resize_24.xml diff --git a/app/src/main/res/drawable-v24/ic_rewind_skip_24.xml b/app/src/main/res/drawable/ic_rewind_skip_24.xml similarity index 100% rename from app/src/main/res/drawable-v24/ic_rewind_skip_24.xml rename to app/src/main/res/drawable/ic_rewind_skip_24.xml diff --git a/app/src/main/res/drawable-v24/ic_shared_drive_24.xml b/app/src/main/res/drawable/ic_shared_drive_24.xml old mode 100755 new mode 100644 similarity index 100% rename from app/src/main/res/drawable-v24/ic_shared_drive_24.xml rename to app/src/main/res/drawable/ic_shared_drive_24.xml diff --git a/app/src/main/res/drawable-v24/ic_shared_me_24.xml b/app/src/main/res/drawable/ic_shared_me_24.xml old mode 100755 new mode 100644 similarity index 100% rename from app/src/main/res/drawable-v24/ic_shared_me_24.xml rename to app/src/main/res/drawable/ic_shared_me_24.xml diff --git a/app/src/main/res/drawable-v24/ic_speed_24.xml b/app/src/main/res/drawable/ic_speed_24.xml similarity index 100% rename from app/src/main/res/drawable-v24/ic_speed_24.xml rename to app/src/main/res/drawable/ic_speed_24.xml diff --git a/app/src/main/res/drawable-v24/ic_starred_24.xml b/app/src/main/res/drawable/ic_starred_24.xml old mode 100755 new mode 100644 similarity index 100% rename from app/src/main/res/drawable-v24/ic_starred_24.xml rename to app/src/main/res/drawable/ic_starred_24.xml diff --git a/app/src/main/res/drawable-v24/ic_subtitles_24.xml b/app/src/main/res/drawable/ic_subtitles_24.xml similarity index 100% rename from app/src/main/res/drawable-v24/ic_subtitles_24.xml rename to app/src/main/res/drawable/ic_subtitles_24.xml From ca941a7531681eef304adbdbd39152ba3a5d96bc Mon Sep 17 00:00:00 2001 From: zechs Date: Thu, 9 Feb 2023 17:52:05 +0530 Subject: [PATCH 4/5] remove default background from button --- app/src/main/res/layout/item_drive_file.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/layout/item_drive_file.xml b/app/src/main/res/layout/item_drive_file.xml index 7e0e637..9da8aba 100755 --- a/app/src/main/res/layout/item_drive_file.xml +++ b/app/src/main/res/layout/item_drive_file.xml @@ -76,6 +76,7 @@ style="@style/Widget.Material3.Button.IconButton" android:layout_width="0dp" android:layout_height="0dp" + android:background="@null" android:layout_marginEnd="8dp" android:contentDescription="@null" app:layout_constraintBottom_toBottomOf="parent" From 3fcbfd4a51ac49fd3ea58508a59575cddef4ea6b Mon Sep 17 00:00:00 2001 From: zechs Date: Thu, 9 Feb 2023 17:52:29 +0530 Subject: [PATCH 5/5] default refresh rate on lower android versions --- mpv/src/main/java/zechs/mpv/MPVView.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mpv/src/main/java/zechs/mpv/MPVView.kt b/mpv/src/main/java/zechs/mpv/MPVView.kt index 5ad309c..0b19882 100644 --- a/mpv/src/main/java/zechs/mpv/MPVView.kt +++ b/mpv/src/main/java/zechs/mpv/MPVView.kt @@ -42,7 +42,9 @@ class MPVView( @Suppress("DEPRECATION") wm.defaultDisplay } - val refreshRate = display.mode.refreshRate + val refreshRate = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + display.mode.refreshRate + } else 60.0F val deviceLanguage = Locale.getDefault().isO3Language Log.d(TAG, "Device language: $deviceLanguage")