mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 22:05:59 +00:00
feat(dual-screen): Screenshots page on the bottom screen
A Take screenshot button copies the game frame (without the overlay) and saves it to Pictures/DroidDeck. The gallery shows those plus the screenshots Steam keeps under userdata; tap one to see it full size.
This commit is contained in:
1 parent
3be85906e9
commit
ee8911a382
6 files changed
+288
-2
No files matched your search
@@ -0,0 +1,32 @@
|
||||
package com.droiddeck.launcher.session
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.rules.TemporaryFolder
|
||||
import java.io.File
|
||||
|
||||
class BottomScreenshotsTest {
|
||||
@get:Rule val tmp = TemporaryFolder()
|
||||
|
||||
@Test fun fileNamesSortByTime() {
|
||||
val name = BottomScreenshots.fileName(0L)
|
||||
assertTrue(name, name.startsWith("DroidDeck_") && name.endsWith(".jpg"))
|
||||
assertEquals(29, name.length)
|
||||
}
|
||||
|
||||
@Test fun steamScreenshotsAreFoundAndThumbnailsSkipped() {
|
||||
val root = tmp.root
|
||||
val shots = File(root, "root/.local/share/Steam/userdata/2932373/760/remote/220/screenshots")
|
||||
File(shots, "thumbnails").mkdirs()
|
||||
File(shots, "20261031010101_1.jpg").writeText("x")
|
||||
File(shots, "thumbnails/20261031010101_1.jpg").writeText("x")
|
||||
File(shots, "screenshots.vdf").writeText("x")
|
||||
val x64 = File(root, "root/.droiddeck-x64/.local/share/Steam/userdata/2932373/760/remote/440/screenshots")
|
||||
x64.mkdirs()
|
||||
File(x64, "20261031020202_1.jpg").writeText("x")
|
||||
val found = BottomScreenshots.steam(root).map { it.file!!.name }.sorted()
|
||||
assertEquals(listOf("20261031010101_1.jpg", "20261031020202_1.jpg"), found)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user