Skip to content

Commit

Permalink
Merge pull request #91 from itszechs/extend_support
Browse files Browse the repository at this point in the history
Fixes for lower android versions
  • Loading branch information
itszechs authored Feb 10, 2023
2 parents e052354 + 3fcbfd4 commit 6abbd76
Show file tree
Hide file tree
Showing 22 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand Down Expand Up @@ -249,6 +250,7 @@ class PlayerActivity : AppCompatActivity() {
playMedia()
}

@RequiresApi(Build.VERSION_CODES.O)
private fun enterPIPMode() {
this.enterPictureInPictureMode(
PictureInPictureParams
Expand Down Expand Up @@ -639,6 +641,7 @@ class PlayerActivity : AppCompatActivity() {
}
}

@RequiresApi(Build.VERSION_CODES.O)
override fun onPictureInPictureModeChanged(
isInPictureInPictureMode: Boolean,
newConfig: Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions app/src/main/res/layout/item_drive_file.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion mpv/src/main/java/zechs/mpv/MPVView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 6abbd76

Please sign in to comment.