mirror of
https://github.com/narrrl/proton-stream.git
synced 2026-11-04 16:57:00 +01:00
feat(android): settings as a page per area, and a language picker
The first Settings page lists Playback, Downloads and storage, Appearance, Metadata and About, each with a line saying where it stands, and each opens its own page with a way back. On one long page, every setting added pushed the rest further from reach. Audio and subtitle language are chosen from a list of languages by name instead of typed as "jpn or eng". The list stores the three-letter tag a Matroska file carries, reads a stored tag in either ISO form, and still takes any other tag typed in.
This commit is contained in:
1 parent
fb32d6c850
commit
677ab2d928
7 files changed
+331
-59
No files matched your search
@@ -0,0 +1,31 @@
|
||||
package io.narl.protonstream.ui
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
class LanguagePickerTest {
|
||||
@Test
|
||||
fun `a stored tag reads as its language in either ISO form`() {
|
||||
assertEquals("Japanese", languageLabel("jpn"))
|
||||
assertEquals("Japanese", languageLabel("ja"))
|
||||
assertEquals("German", languageLabel("deu"))
|
||||
assertEquals("German", languageLabel("ger"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `a region suffix and capitals do not hide the language`() {
|
||||
assertEquals("Portuguese", languageLabel("PT-br"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `a tag not on the list is shown as typed, and blank is no preference`() {
|
||||
assertEquals("tgl", languageLabel("tgl"))
|
||||
assertEquals("No preference", languageLabel(null))
|
||||
assertEquals("No preference", languageLabel(" "))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `every listed language has a two-letter form`() {
|
||||
LANGUAGES.forEach { (code, name) -> assertEquals(code, name, languageLabel(code)) }
|
||||
}
|
||||
}
|
||||
@@ -108,6 +108,16 @@ class ScreenshotTest {
|
||||
SettingsScreen(LIBRARY, { _, _, _, _ -> }, {}, {}, {}, PaddingValues())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `the playback settings`() = capture("settings-playback") {
|
||||
SettingsScreen(LIBRARY, { _, _, _, _ -> }, {}, {}, {}, PaddingValues(), SettingsPage.Playback)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `the storage settings`() = capture("settings-storage") {
|
||||
SettingsScreen(LIBRARY, { _, _, _, _ -> }, {}, {}, {}, PaddingValues(), SettingsPage.Storage)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `the history page`() = capture("history-phone") {
|
||||
// Fixed day and zone: "Today" and "Yesterday" are relative, and an
|
||||
|
||||
Reference in new issue
Block a user