mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 05:46:03 +00:00
feat(dual-screen): Dashboard mode for the bottom screen
A new bottom-screen mode that holds pages (downloads, screenshots, telemetry and more come in the next commits). It sizes itself from the bottom display it is shown on, is offered only while it has pages, and follows the existing Dual screen Auto/On/Off setting and display pick. The last page is remembered.
This commit is contained in:
1 parent
0a07926ef3
commit
e76592ba4e
9 files changed
+233
-14
No files matched your search
@@ -23,4 +23,10 @@ class SecondScreenModeTest {
|
||||
assertEquals(SecondScreenMode.DECK_CONTROLS, SecondScreenMode.opening("none", deckPad = true))
|
||||
assertEquals(SecondScreenMode.KEYBOARD_TRACKPAD, SecondScreenMode.opening("gone", deckPad = false))
|
||||
}
|
||||
|
||||
@Test fun theDashboardOpensAgainOnlyWhileItHasPages() {
|
||||
assertEquals(SecondScreenMode.DASHBOARD, SecondScreenMode.opening("dashboard", deckPad = true, dashboard = true))
|
||||
assertEquals(SecondScreenMode.DECK_CONTROLS, SecondScreenMode.opening("dashboard", deckPad = true, dashboard = false))
|
||||
assertEquals(SecondScreenMode.KEYBOARD_TRACKPAD, SecondScreenMode.opening("dashboard", deckPad = false))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class BottomDashboardTest {
|
||||
@Test fun theRememberedPageOpensAgain() {
|
||||
assertEquals("shots", pickBottomPage("shots", listOf("downloads", "shots")))
|
||||
}
|
||||
|
||||
@Test fun aGoneOrMissingPageFallsBackToTheFirst() {
|
||||
assertEquals("downloads", pickBottomPage("gone", listOf("downloads", "shots")))
|
||||
assertEquals("downloads", pickBottomPage(null, listOf("downloads", "shots")))
|
||||
assertNull(pickBottomPage("shots", emptyList()))
|
||||
}
|
||||
|
||||
@Test fun tabNamesShowOnlyWhileEveryTabFits() {
|
||||
// Retroid Pocket Duo bottom panel: 1280x960 at 320 dpi = 640 dp wide.
|
||||
assertTrue(bottomTabsWithLabels(640f, 4))
|
||||
assertFalse(bottomTabsWithLabels(640f, 5))
|
||||
assertFalse(bottomTabsWithLabels(360f, 3))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user