mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 05:16:01 +00:00
feat(dual-screen): bottom-screen Dashboard with downloads, notifications, screenshots, Steam chat and In-game stats (#1920)
A Dashboard mode for the second screen of dual-screen handhelds (developed on a Retroid Pocket Duo), the default on dual-screen devices. It opens on Chat at each Steam start and switches to In-game stats when a game starts. - Downloads: Steam downloads and updates (SD-card libraries too), shader caches and DroidDeck store downloads. - Notifications: other apps' notifications once access is allowed, kept in memory only. - Screenshots: a game screenshot without the overlay, and a gallery of DroidDeck's and Steam's screenshots. - Chat & voice: mic and game volume buttons, and Steam's web chat signed in with the Steam client's own session. - In-game stats: FPS, CPU, GPU, RAM and battery plus the running game or Steam client type, and a racing dash from Codemasters, Forza and OutGauge games' data output, with War Thunder and Elite Dangerous layouts; speed in km/h or mph. - Send dashboard data: turns a Codemasters game's data output on for the dash (per game or Automatic) and keeps the original setting to put back. - DiRT 3 / DiRT Showdown: with their data output on they stop with error 10038 at race end; a ws2_32.dll stand-in (tools/dirt-ws2) is swapped into the prefix while the game runs, skipped on DroidDeck-Proton 11-11.10 which has the fix built in. Same behaviour as DiRTTelemetryErrorFix by RoccoC, based on Carsten Gottschling's fix. About "telemetry": here it means a racing game's own live driving data (speed, gear, rpm, pedals), not app analytics. For In-game stats no information leaves the device and nothing is shared: the game sends its data to 127.0.0.1 on the same device, DroidDeck only listens there while the page is open and keeps the numbers in memory just long enough to draw them. DroidDeck sends no data about the user or their use of the app; logs leave the device only when the user taps Share logs.
This commit is contained in:
1 parent
bfa61b5139
commit
8a7022fc14
52 files changed
+4576
-63
No files matched your search
@@ -0,0 +1,42 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class BottomChatPageTest {
|
||||
@Test fun steamSitesOpenOthersDoNot() {
|
||||
assertTrue(steamChatAllows("steamcommunity.com"))
|
||||
assertTrue(steamChatAllows("login.steampowered.com"))
|
||||
assertTrue(steamChatAllows("steam-chat.com"))
|
||||
assertTrue(steamChatAllows("community.cloudflare.steamstatic.com"))
|
||||
assertFalse(steamChatAllows("steamcommunity.com.example.net"))
|
||||
assertFalse(steamChatAllows("evilsteamcommunity.com"))
|
||||
assertFalse(steamChatAllows(null))
|
||||
}
|
||||
|
||||
@Test fun chatFitScriptUsesADotDecimalInEveryLocale() {
|
||||
val before = java.util.Locale.getDefault()
|
||||
try {
|
||||
java.util.Locale.setDefault(java.util.Locale.GERMANY)
|
||||
val js = steamChatFitScript(821, 0.75f)
|
||||
assertTrue(js.contains("m.content='width=821, initial-scale=0.75'"))
|
||||
assertTrue(js.contains("s.textContent='$STEAM_CHAT_FIT_CSS'"))
|
||||
assertFalse(STEAM_CHAT_FIT_CSS.contains('\''))
|
||||
} finally {
|
||||
java.util.Locale.setDefault(before)
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun theGroupChatListLeavesRoomForTheOnlineFriends() {
|
||||
assertTrue(STEAM_CHAT_FIT_CSS.contains(".ChatRoomList_Empty{display:none!important}"))
|
||||
assertTrue(STEAM_CHAT_FIT_CSS.contains(".chatRoomListContainer{height:auto!important;max-height:25vh!important}"))
|
||||
assertTrue(STEAM_CHAT_FIT_CSS.contains(".chat_main>:has(~.chat_main_flex){display:none!important}"))
|
||||
}
|
||||
|
||||
@Test fun desktopAgentKeepsTheWebViewChromeVersion() {
|
||||
val ua = desktopUserAgent("Mozilla/5.0 (Linux; Android 15; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/141.0.7390.122 Mobile Safari/537.36")
|
||||
assertEquals("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.122 Safari/537.36", ua)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
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 withNothingPickedTheChatOpens() {
|
||||
val ids = listOf("telemetry", "downloads", "notifications", "screenshots", "chat")
|
||||
assertEquals("chat", pickBottomPage(null, ids))
|
||||
assertEquals("chat", pickBottomPage("gone", ids))
|
||||
assertEquals("telemetry", pickBottomPage("telemetry", ids))
|
||||
assertEquals("screenshots", pickBottomPage("screenshots", ids))
|
||||
}
|
||||
|
||||
@Test fun aGameStartShowsTheInGameStats() {
|
||||
assertEquals("telemetry", pageForGameStart(listOf("telemetry", "downloads", "chat")))
|
||||
assertNull(pageForGameStart(listOf("downloads", "chat")))
|
||||
}
|
||||
|
||||
@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))
|
||||
}
|
||||
}
|
||||
|
||||
class BottomDownloadsRateTest {
|
||||
@Test fun rateIsBytesPerSecondBetweenReads() {
|
||||
assertEquals(1_000_000L, downloadRate(0L, 0L, 2_000_000L, 2_000L))
|
||||
}
|
||||
|
||||
@Test fun noMovementOrARestartIsZero() {
|
||||
assertEquals(0L, downloadRate(500L, 0L, 500L, 2_000L))
|
||||
assertEquals(0L, downloadRate(500L, 0L, 100L, 2_000L))
|
||||
assertEquals(0L, downloadRate(-1L, 0L, 100L, 2_000L))
|
||||
}
|
||||
}
|
||||
|
||||
class BottomTelemetryLapTimeTest {
|
||||
@Test fun lapTimesReadAsMinutesSecondsMillis() {
|
||||
assertEquals("1:23.456", lapTime(83.456f))
|
||||
assertEquals("0:05.000", lapTime(5f))
|
||||
}
|
||||
|
||||
@Test fun eachSessionStartsWithoutAPickedTab() {
|
||||
SessionBottomTab.pick("2026-11-01-01-steam", "screenshots")
|
||||
assertEquals("screenshots", SessionBottomTab.picked("2026-11-01-01-steam"))
|
||||
assertNull(SessionBottomTab.picked("2026-11-01-02-steam"))
|
||||
assertNull(SessionBottomTab.picked(null))
|
||||
assertEquals("chat", pickBottomPage(SessionBottomTab.picked("2026-11-01-02-steam"), listOf("telemetry", "chat", "screenshots")))
|
||||
}
|
||||
|
||||
@Test fun theStripNamesTheSteamClient() {
|
||||
assertEquals(com.droiddeck.launcher.R.string.stats_steam_client_x86, steamClientLabel("x86_64"))
|
||||
assertEquals(com.droiddeck.launcher.R.string.stats_steam_client_arm, steamClientLabel("arm64"))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user