mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-22 22:36:00 +00:00
fix(session): picking a bottom-screen mode clears the menu restore left by a teardown (#3007)
This commit is contained in:
1 parent
210c127446
commit
00525cde15
2 files changed
+10
No files matched your search
@@ -4447,6 +4447,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
private fun pickSecondScreenMode(mode: SecondScreenMode) {
|
||||
typingReturnMode = null
|
||||
automaticPanel = false
|
||||
SessionState.bottomMenu = false
|
||||
if (mode != SecondScreenMode.NONE) SessionPrefs.setSecondScreenPanel(this, desktopSession, mode.id)
|
||||
selectSecondScreenMode(mode)
|
||||
}
|
||||
|
||||
@@ -108,6 +108,15 @@ class SecondScreenProfileMigrationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun pickingAnotherModeClearsTheMenuRestoreLeftByATeardown() {
|
||||
customLibrary(desktop = false)
|
||||
SessionState.bottomMenu = true
|
||||
ReflectionHelpers.callInstanceMethod<Unit>(activity, "pickSecondScreenMode",
|
||||
ReflectionHelpers.ClassParameter.from(SecondScreenMode::class.java, SecondScreenMode.KEYBOARD_TRACKPAD))
|
||||
assertFalse(SessionState.bottomMenu)
|
||||
assertEquals(SecondScreenMode.KEYBOARD_TRACKPAD.id, SessionPrefs.secondScreenPanel(activity, false))
|
||||
}
|
||||
|
||||
private fun customLibrary(desktop: Boolean): InputLibrary {
|
||||
session(desktop)
|
||||
return InputLibraries.update(activity) { library ->
|
||||
|
||||
Reference in new issue
Block a user