Skip to content

Commit

Permalink
wrong api level
Browse files Browse the repository at this point in the history
  • Loading branch information
Sisah2 committed Jun 6, 2024
1 parent 360bbd6 commit 05881d1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/ui/activity/GameActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class GameActivity : SDLActivity() {
super.onCreate(savedInstanceState)

val displayInCutoutArea = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("pref_display_cutout_area", true)
if (displayInCutoutArea || android.os.Build.VERSION.SDK_INT < 30) {
if (displayInCutoutArea || android.os.Build.VERSION.SDK_INT < 29) {
window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/ui/activity/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ class MainActivity : AppCompatActivity() {
val orientation = this.getResources().getConfiguration().orientation
var displayWidth = 0
var displayHeight = 0
val cutout = if (android.os.Build.VERSION.SDK_INT < 30) windowManager.defaultDisplay.getCutout() else null
val cutout = if (android.os.Build.VERSION.SDK_INT < 29) windowManager.defaultDisplay.getCutout() else null

if (cutout != null) {
if (orientation == Configuration.ORIENTATION_PORTRAIT)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/ui/fragments/FragmentSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class FragmentSettings : PreferenceFragment(), OnSharedPreferenceChangeListener
true
}

if (android.os.Build.VERSION.SDK_INT < 30)
if (android.os.Build.VERSION.SDK_INT < 29)
findPreference("pref_display_cutout_area").isEnabled = false
}

Expand Down

0 comments on commit 05881d1

Please sign in to comment.