mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-24 23:36:04 +00:00
feat(session): add an Avoid notch toggle to the Steam display options
Keeps the Steam session picture, controls and overlays inside the display cutout's safe area so the notch no longer covers part of the image, in landscape or portrait. Off by default.
This commit is contained in:
40 files changed
+142
-1
No files matched your search
@@ -0,0 +1,36 @@
|
||||
package com.droiddeck.launcher.session
|
||||
|
||||
import android.content.Context
|
||||
import org.junit.Assert.*
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.RuntimeEnvironment
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [33])
|
||||
class AvoidNotchPrefsTest {
|
||||
private val app get() = RuntimeEnvironment.getApplication()
|
||||
private val saved get() = app.getSharedPreferences("session", Context.MODE_PRIVATE)
|
||||
|
||||
@Before fun clear() { saved.edit().clear().commit() }
|
||||
|
||||
@Test fun theNotchIsLeftAloneUntilAskedToAvoidIt() {
|
||||
assertFalse(SessionPrefs.avoidNotch(app))
|
||||
}
|
||||
|
||||
@Test fun theChoiceIsKept() {
|
||||
SessionPrefs.setAvoidNotch(app, true)
|
||||
assertTrue(SessionPrefs.avoidNotch(app))
|
||||
SessionPrefs.setAvoidNotch(app, false)
|
||||
assertFalse(SessionPrefs.avoidNotch(app))
|
||||
}
|
||||
|
||||
@Test fun resettingSettingsTurnsItOff() {
|
||||
SessionPrefs.setAvoidNotch(app, true)
|
||||
assertTrue(SettingsReset.resetAll(app, gameProfiles = false))
|
||||
assertFalse(SessionPrefs.avoidNotch(app))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user