mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-26 00:06:02 +00:00
Rebase follow-up: main's copy of the credits and file manager with the Winlator lines removed; progress log entry for the branch
This commit is contained in:
1 parent
2f80d97e17
commit
eb1b9e0d78
3 files changed
+53
-100
No files matched your search
@@ -137,21 +137,21 @@ import java.util.Locale
|
|||||||
/**
|
/**
|
||||||
* What to do when a pasted item already exists at the destination.
|
* What to do when a pasted item already exists at the destination.
|
||||||
*
|
*
|
||||||
* OVERWRITE and MERGE resolve to the same call — `copyWithProgress` recurses into an existing
|
* OVERWRITE and MERGE resolve to the same call - `copyWithProgress` recurses into an existing
|
||||||
* directory and truncates existing files — but they mean different things to the user, so both are
|
* directory and truncates existing files - but they mean different things to the user, so both are
|
||||||
* offered and the wording is chosen per item type (files overwrite, folders merge).
|
* offered and the wording is chosen per item type (files overwrite, folders merge).
|
||||||
*/
|
*/
|
||||||
enum class ConflictChoice { OVERWRITE, MERGE, KEEP_BOTH, SKIP }
|
enum class ConflictChoice { OVERWRITE, MERGE, KEEP_BOTH, SKIP }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ordering for the file list. Folders always lead regardless of direction — a descending sort that
|
* Ordering for the file list. Folders always lead regardless of direction - a descending sort that
|
||||||
* buries every folder under the files is never what someone means by "Z to A".
|
* buries every folder under the files is never what someone means by "Z to A".
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Shortens a path from the LEFT, keeping whole segments.
|
* Shortens a path from the LEFT, keeping whole segments.
|
||||||
*
|
*
|
||||||
* Compose's TextOverflow can only ellipsise the tail, which for a path throws away the part that
|
* Compose's TextOverflow can only ellipsise the tail, which for a path throws away the part that
|
||||||
* matters — `/storage/emulated/0/Games/…` tells you nothing about where you are.
|
* matters - `/storage/emulated/0/Games/Racing/Dir…` tells you nothing about where you are.
|
||||||
*/
|
*/
|
||||||
private fun elidePathStart(path: String, max: Int): String {
|
private fun elidePathStart(path: String, max: Int): String {
|
||||||
if (path.length <= max) return path
|
if (path.length <= max) return path
|
||||||
@@ -196,7 +196,7 @@ private fun isWithin(child: File, ancestor: File): Boolean {
|
|||||||
|
|
||||||
// ── DOS file attributes (Read-only / Hidden) ──
|
// ── DOS file attributes (Read-only / Hidden) ──
|
||||||
// The in-container file manager (wfm.exe) exposes these in its Properties dialog; this mirrors the
|
// The in-container file manager (wfm.exe) exposes these in its Properties dialog; this mirrors the
|
||||||
// same two toggles for files browsed from the app side. No root — we only touch permission bits the
|
// same two toggles for files browsed from the app side. No root - we only touch permission bits the
|
||||||
// app owns (container files) and the Wine DOS-attribute xattr.
|
// app owns (container files) and the Wine DOS-attribute xattr.
|
||||||
|
|
||||||
// FILE_ATTRIBUTE_HIDDEN, as Wine encodes it in the user.DOSATTRIB extended attribute.
|
// FILE_ATTRIBUTE_HIDDEN, as Wine encodes it in the user.DOSATTRIB extended attribute.
|
||||||
@@ -204,7 +204,7 @@ private const val FILE_ATTRIBUTE_HIDDEN = 0x2
|
|||||||
private const val DOSATTRIB_XATTR = "user.DOSATTRIB"
|
private const val DOSATTRIB_XATTR = "user.DOSATTRIB"
|
||||||
|
|
||||||
// Snapshot of a file's two toggleable attributes. hiddenSupported is false when the underlying
|
// Snapshot of a file's two toggleable attributes. hiddenSupported is false when the underlying
|
||||||
// filesystem can't store the DOSATTRIB xattr (the FUSE /storage volumes) — the Hidden toggle is then
|
// filesystem can't store the DOSATTRIB xattr (the FUSE /storage volumes) - the Hidden toggle is then
|
||||||
// disabled while Read-only keeps working.
|
// disabled while Read-only keeps working.
|
||||||
private data class FileAttrState(
|
private data class FileAttrState(
|
||||||
val readOnly: Boolean,
|
val readOnly: Boolean,
|
||||||
@@ -226,7 +226,7 @@ private fun parseDosAttrib(raw: ByteArray): Int {
|
|||||||
// comes back hiddenSupported=false (Hidden toggle disabled), Read-only always resolves.
|
// comes back hiddenSupported=false (Hidden toggle disabled), Read-only always resolves.
|
||||||
private fun readFileAttrs(file: File): FileAttrState {
|
private fun readFileAttrs(file: File): FileAttrState {
|
||||||
val path = file.absolutePath
|
val path = file.absolutePath
|
||||||
// Read-only reflects the OWNER write bit — that's what Wine maps to FILE_ATTRIBUTE_READONLY.
|
// Read-only reflects the OWNER write bit - that's what Wine maps to FILE_ATTRIBUTE_READONLY.
|
||||||
val readOnly = runCatching {
|
val readOnly = runCatching {
|
||||||
(android.system.Os.stat(path).st_mode and android.system.OsConstants.S_IWUSR) == 0
|
(android.system.Os.stat(path).st_mode and android.system.OsConstants.S_IWUSR) == 0
|
||||||
}.getOrDefault(!file.canWrite())
|
}.getOrDefault(!file.canWrite())
|
||||||
@@ -309,7 +309,7 @@ fun describeLocation(file: File): FavLocation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Semantic identity colours for the favourite-card drive badge. Intentionally NOT theme
|
// Semantic identity colours for the favourite-card drive badge. Intentionally NOT theme
|
||||||
// accent colours — they identify the storage source at a glance. Returns (background, foreground).
|
// accent colours - they identify the storage source at a glance. Returns (background, foreground).
|
||||||
private fun badgeColors(loc: FavLocation): Pair<Color, Color> {
|
private fun badgeColors(loc: FavLocation): Pair<Color, Color> {
|
||||||
val white = Color(0xFFFFFFFF)
|
val white = Color(0xFFFFFFFF)
|
||||||
return when {
|
return when {
|
||||||
@@ -350,13 +350,13 @@ fun FileManagerScreen(
|
|||||||
val rootDir = remember {
|
val rootDir = remember {
|
||||||
// Both modes: honour an explicit caller-supplied start dir (e.g. Log Manager's game-log
|
// Both modes: honour an explicit caller-supplied start dir (e.g. Log Manager's game-log
|
||||||
// folder), else open at the INTERNAL STORAGE ROOT. Selection screens (drive-folder pick,
|
// folder), else open at the INTERNAL STORAGE ROOT. Selection screens (drive-folder pick,
|
||||||
// local component pick, imports) previously defaulted to Download which — combined with the
|
// local component pick, imports) previously defaulted to Download which - combined with the
|
||||||
// currentRoot floor below — trapped users in Download with no way up (reported bug).
|
// currentRoot floor below - trapped users in Download with no way up (reported bug).
|
||||||
initialDir?.takeIf { it.isDirectory } ?: File("/storage/emulated/0")
|
initialDir?.takeIf { it.isDirectory } ?: File("/storage/emulated/0")
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentDir by remember { mutableStateOf(rootDir) }
|
var currentDir by remember { mutableStateOf(rootDir) }
|
||||||
// The up/back FLOOR — back + the up-arrow are disabled while currentDir == currentRoot. It MUST be
|
// The up/back FLOOR - back + the up-arrow are disabled while currentDir == currentRoot. It MUST be
|
||||||
// the VOLUME ROOT of the start dir (internal /storage/emulated/0, or an SD card /storage/XXXX-XXXX),
|
// the VOLUME ROOT of the start dir (internal /storage/emulated/0, or an SD card /storage/XXXX-XXXX),
|
||||||
// NOT the start dir itself: otherwise opening at any subfolder disables up/back and traps the user
|
// NOT the start dir itself: otherwise opening at any subfolder disables up/back and traps the user
|
||||||
// there. (Mirrors the volume-root logic in favLocationOf above.)
|
// there. (Mirrors the volume-root logic in favLocationOf above.)
|
||||||
@@ -377,7 +377,7 @@ fun FileManagerScreen(
|
|||||||
var selectedEntry by remember { mutableStateOf<File?>(null) }
|
var selectedEntry by remember { mutableStateOf<File?>(null) }
|
||||||
var showMenuFor by remember { mutableStateOf<File?>(null) }
|
var showMenuFor by remember { mutableStateOf<File?>(null) }
|
||||||
// Clipboard holds a LIST so one paste can carry a whole selection. Cut/copy semantics are a
|
// Clipboard holds a LIST so one paste can carry a whole selection. Cut/copy semantics are a
|
||||||
// flag on the batch rather than per item — mixing the two in one clipboard has no sane meaning.
|
// flag on the batch rather than per item - mixing the two in one clipboard has no sane meaning.
|
||||||
var clipboardFiles by remember { mutableStateOf<List<File>>(emptyList()) }
|
var clipboardFiles by remember { mutableStateOf<List<File>>(emptyList()) }
|
||||||
var isCutOperation by remember { mutableStateOf(false) }
|
var isCutOperation by remember { mutableStateOf(false) }
|
||||||
// Multi-select. Keyed by absolute path rather than File so a directory reload (which builds
|
// Multi-select. Keyed by absolute path rather than File so a directory reload (which builds
|
||||||
@@ -398,10 +398,10 @@ fun FileManagerScreen(
|
|||||||
var sortDesc by remember { mutableStateOf(browsePrefs.getBoolean("fmSortDesc", false)) }
|
var sortDesc by remember { mutableStateOf(browsePrefs.getBoolean("fmSortDesc", false)) }
|
||||||
var showHidden by remember { mutableStateOf(browsePrefs.getBoolean("fmShowHidden", true)) }
|
var showHidden by remember { mutableStateOf(browsePrefs.getBoolean("fmShowHidden", true)) }
|
||||||
var showSortMenu by remember { mutableStateOf(false) }
|
var showSortMenu by remember { mutableStateOf(false) }
|
||||||
// View mode: list of cards (default) or a thumbnail grid. Density applies to the list only —
|
// View mode: list of cards (default) or a thumbnail grid. Density applies to the list only -
|
||||||
// a grid tile has no second line to compact.
|
// a grid tile has no second line to compact.
|
||||||
// The grid/list toggle is the SOURCE OF TRUTH in BOTH orientations (it drives the view and its
|
// The grid/list toggle is the SOURCE OF TRUTH in BOTH orientations (it drives the view and its
|
||||||
// choice persists across rotation). Grid is the default — most useful in landscape, and in
|
// choice persists across rotation). Grid is the default - most useful in landscape, and in
|
||||||
// portrait GridCells.Adaptive naturally renders fewer columns (~2). Do NOT force portrait to list:
|
// portrait GridCells.Adaptive naturally renders fewer columns (~2). Do NOT force portrait to list:
|
||||||
// that broke the toggle on-device (tapping it did nothing in portrait).
|
// that broke the toggle on-device (tapping it did nothing in portrait).
|
||||||
var gridView by remember { mutableStateOf(browsePrefs.getBoolean("fmGridView", true)) }
|
var gridView by remember { mutableStateOf(browsePrefs.getBoolean("fmGridView", true)) }
|
||||||
@@ -502,7 +502,7 @@ fun FileManagerScreen(
|
|||||||
suspend fun askConflict(file: File): ConflictChoice? {
|
suspend fun askConflict(file: File): ConflictChoice? {
|
||||||
pendingConflict = file
|
pendingConflict = file
|
||||||
conflictChoice = null
|
conflictChoice = null
|
||||||
// Poll rather than plumb a CompletableDeferred through Compose state — the dialog answers
|
// Poll rather than plumb a CompletableDeferred through Compose state - the dialog answers
|
||||||
// by setting conflictChoice, and this coroutine is already off the critical path.
|
// by setting conflictChoice, and this coroutine is already off the critical path.
|
||||||
while (pendingConflict != null && conflictChoice == null) kotlinx.coroutines.delay(50)
|
while (pendingConflict != null && conflictChoice == null) kotlinx.coroutines.delay(50)
|
||||||
return conflictChoice
|
return conflictChoice
|
||||||
@@ -556,7 +556,7 @@ fun FileManagerScreen(
|
|||||||
operationLabel = buildString {
|
operationLabel = buildString {
|
||||||
append(if (cut) "Moving" else "Copying")
|
append(if (cut) "Moving" else "Copying")
|
||||||
if (sources.size > 1) append(" ${done + 1}/${sources.size}")
|
if (sources.size > 1) append(" ${done + 1}/${sources.size}")
|
||||||
append(" — ").append(src.name)
|
append(" - ").append(src.name)
|
||||||
}
|
}
|
||||||
var lastPct = -1
|
var lastPct = -1
|
||||||
val onProgress = FileOps.ProgressCallback { copied, total ->
|
val onProgress = FileOps.ProgressCallback { copied, total ->
|
||||||
@@ -745,7 +745,7 @@ fun FileManagerScreen(
|
|||||||
isOperationRunning = true
|
isOperationRunning = true
|
||||||
var failed = 0
|
var failed = 0
|
||||||
victims.forEachIndexed { i, f ->
|
victims.forEachIndexed { i, f ->
|
||||||
operationLabel = "Deleting ${i + 1}/${victims.size} — ${f.name}"
|
operationLabel = "Deleting ${i + 1}/${victims.size} - ${f.name}"
|
||||||
if (!withContext(Dispatchers.IO) { FileOps.delete(f) }) failed++
|
if (!withContext(Dispatchers.IO) { FileOps.delete(f) }) failed++
|
||||||
}
|
}
|
||||||
isOperationRunning = false
|
isOperationRunning = false
|
||||||
@@ -761,7 +761,7 @@ fun FileManagerScreen(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Paste conflict — one per colliding item, with "apply to all" for a long batch.
|
// Paste conflict - one per colliding item, with "apply to all" for a long batch.
|
||||||
pendingConflict?.let { conflict ->
|
pendingConflict?.let { conflict ->
|
||||||
val isDir = conflict.isDirectory
|
val isDir = conflict.isDirectory
|
||||||
OutlinedAlertDialog(
|
OutlinedAlertDialog(
|
||||||
@@ -856,7 +856,7 @@ fun FileManagerScreen(
|
|||||||
val driveChipAlpha = if (showFavorites) 0.45f else 1f
|
val driveChipAlpha = if (showFavorites) 0.45f else 1f
|
||||||
Box {
|
Box {
|
||||||
// The drive/location selector opens the drive dropdown, so give it the same outlined
|
// The drive/location selector opens the drive dropdown, so give it the same outlined
|
||||||
// look as the "New Folder" button + the rail location items — it reads as a button, not
|
// look as the "New Folder" button + the rail location items - it reads as a button, not
|
||||||
// plain text. Border uses the theme accent token; behaviour unchanged.
|
// plain text. Border uses the theme accent token; behaviour unchanged.
|
||||||
val driveChipShape = RoundedCornerShape(8.dp)
|
val driveChipShape = RoundedCornerShape(8.dp)
|
||||||
Text(
|
Text(
|
||||||
@@ -909,7 +909,7 @@ fun FileManagerScreen(
|
|||||||
|
|
||||||
if (showFavorites) {
|
if (showFavorites) {
|
||||||
Text(
|
Text(
|
||||||
text = "★ Favorites",
|
text = "Favorites",
|
||||||
color = MaterialTheme.colorScheme.primary,
|
color = MaterialTheme.colorScheme.primary,
|
||||||
fontSize = 13.sp,
|
fontSize = 13.sp,
|
||||||
fontWeight = FontWeight.SemiBold,
|
fontWeight = FontWeight.SemiBold,
|
||||||
@@ -918,12 +918,12 @@ fun FileManagerScreen(
|
|||||||
modifier = Modifier.weight(1f),
|
modifier = Modifier.weight(1f),
|
||||||
)
|
)
|
||||||
} else if (LocalConfiguration.current.orientation == Configuration.ORIENTATION_PORTRAIT) {
|
} else if (LocalConfiguration.current.orientation == Configuration.ORIENTATION_PORTRAIT) {
|
||||||
// PORTRAIT: hide the current-folder name — it's redundant with the path bar directly
|
// PORTRAIT: hide the current-folder name - it's redundant with the path bar directly
|
||||||
// below (which shows the full path). The spacer keeps the action icons right-aligned.
|
// below (which shows the full path). The spacer keeps the action icons right-aligned.
|
||||||
Spacer(Modifier.weight(1f))
|
Spacer(Modifier.weight(1f))
|
||||||
} else {
|
} else {
|
||||||
// LANDSCAPE: the CURRENT FOLDER, not the full path. A path ellipsised on the right
|
// LANDSCAPE: the CURRENT FOLDER, not the full path. A path ellipsised on the right
|
||||||
// hides its tail — the only part that says where you are ("…/Games/…"). The
|
// hides its tail - the only part that says where you are ("…/Games/Racing/Dir…"). The
|
||||||
// full path moves to the line below, where it has room.
|
// full path moves to the line below, where it has room.
|
||||||
Text(
|
Text(
|
||||||
text = currentDir.name.ifBlank { currentDir.absolutePath },
|
text = currentDir.name.ifBlank { currentDir.absolutePath },
|
||||||
@@ -1029,7 +1029,7 @@ fun FileManagerScreen(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Free space on the volume being browsed — worth knowing before starting a 60 GB copy.
|
// Free space on the volume being browsed - worth knowing before starting a 60 GB copy.
|
||||||
val freeSpace = remember(currentDir.absolutePath, entries) {
|
val freeSpace = remember(currentDir.absolutePath, entries) {
|
||||||
runCatching { currentDir.usableSpace }.getOrDefault(0L)
|
runCatching { currentDir.usableSpace }.getOrDefault(0L)
|
||||||
}
|
}
|
||||||
@@ -1225,7 +1225,7 @@ fun FileManagerScreen(
|
|||||||
val locationSections = buildList {
|
val locationSections = buildList {
|
||||||
add(RailSection("STORAGE", storageItems))
|
add(RailSection("STORAGE", storageItems))
|
||||||
if (quickItems.isNotEmpty()) add(RailSection("QUICK", quickItems))
|
if (quickItems.isNotEmpty()) add(RailSection("QUICK", quickItems))
|
||||||
if (favItems.isNotEmpty()) add(RailSection("★ FAVORITES", favItems))
|
if (favItems.isNotEmpty()) add(RailSection("FAVORITES", favItems))
|
||||||
}
|
}
|
||||||
|
|
||||||
Row(modifier = Modifier.weight(1f).fillMaxWidth()) {
|
Row(modifier = Modifier.weight(1f).fillMaxWidth()) {
|
||||||
@@ -1431,7 +1431,7 @@ fun FileManagerScreen(
|
|||||||
|
|
||||||
// The context-menu item list shared by the list rows (FileItemRow) and the grid tiles
|
// The context-menu item list shared by the list rows (FileItemRow) and the grid tiles
|
||||||
// (FileGridTile), so both open the identical menu. Gating (isDir/canRun/isInno/looksLikeArchive) is
|
// (FileGridTile), so both open the identical menu. Gating (isDir/canRun/isInno/looksLikeArchive) is
|
||||||
// recomputed from [file] here — one source of truth for what each item shows. Every item dismisses
|
// recomputed from [file] here - one source of truth for what each item shows. Every item dismisses
|
||||||
// the menu first, then runs its action.
|
// the menu first, then runs its action.
|
||||||
@Composable
|
@Composable
|
||||||
private fun FileContextMenuItems(
|
private fun FileContextMenuItems(
|
||||||
@@ -1462,7 +1462,7 @@ private fun FileContextMenuItems(
|
|||||||
onClick = { onDismissMenu(); onProperties() },
|
onClick = { onDismissMenu(); onProperties() },
|
||||||
)
|
)
|
||||||
MenuItemDivider()
|
MenuItemDivider()
|
||||||
// Favorites are directories — only folders get the pin toggle.
|
// Favorites are directories - only folders get the pin toggle.
|
||||||
if (isDir) {
|
if (isDir) {
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text(if (isFavorite) "Remove from Favorites" else "Add to Favorites") },
|
text = { Text(if (isFavorite) "Remove from Favorites" else "Add to Favorites") },
|
||||||
@@ -1708,7 +1708,7 @@ private fun FavoritesList(
|
|||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = "No favorites yet — pin a folder with its ⋮ menu to jump back here fast.",
|
text = "No favorites yet - pin a folder with its ⋮ menu to jump back here fast.",
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
fontSize = 13.sp,
|
fontSize = 13.sp,
|
||||||
modifier = Modifier.padding(horizontal = 32.dp),
|
modifier = Modifier.padding(horizontal = 32.dp),
|
||||||
@@ -1729,7 +1729,7 @@ private fun FavoritesList(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// A single favourite — matches the FileItemRow card style (surfaceContainer + outline +
|
// A single favourite - matches the FileItemRow card style (surfaceContainer + outline +
|
||||||
// RoundedCornerShape(10.dp)). Shows the folder name, a coloured drive badge + origin text,
|
// RoundedCornerShape(10.dp)). Shows the folder name, a coloured drive badge + origin text,
|
||||||
// and the full display path; tapping jumps into it, the filled star unpins.
|
// and the full display path; tapping jumps into it, the filled star unpins.
|
||||||
@Composable
|
@Composable
|
||||||
@@ -1818,7 +1818,7 @@ private fun FavoriteCard(
|
|||||||
/**
|
/**
|
||||||
* One entry in the File Manager's grid view: a big thumbnail with the name under it.
|
* One entry in the File Manager's grid view: a big thumbnail with the name under it.
|
||||||
*
|
*
|
||||||
* Deliberately drops size and date — at this width they truncate to noise. The grid is for
|
* Deliberately drops size and date - at this width they truncate to noise. The grid is for
|
||||||
* recognising things by sight (screenshots, covers, game folders); the list stays the view for
|
* recognising things by sight (screenshots, covers, game folders); the list stays the view for
|
||||||
* reading details.
|
* reading details.
|
||||||
*/
|
*/
|
||||||
@@ -1852,7 +1852,7 @@ private fun FileGridTile(
|
|||||||
if (bmp != null) exeIcon = bmp.asImageBitmap()
|
if (bmp != null) exeIcon = bmp.asImageBitmap()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// The tile has no ⋮ button — long-press opens this menu, anchored to the Box around the Card.
|
// The tile has no ⋮ button - long-press opens this menu, anchored to the Box around the Card.
|
||||||
Box {
|
Box {
|
||||||
Card(
|
Card(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@@ -1942,7 +1942,7 @@ private fun FileGridTile(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Properties sheet for a single file or folder: basic info plus the two Windows/Wine file attributes
|
* Properties sheet for a single file or folder: basic info plus the two Windows/Wine file attributes
|
||||||
* the in-container file manager (wfm.exe) also exposes — Read-only and Hidden. Each toggle applies
|
* the in-container file manager (wfm.exe) also exposes - Read-only and Hidden. Each toggle applies
|
||||||
* immediately (off the main thread) and refreshes the listing via [onChanged].
|
* immediately (off the main thread) and refreshes the listing via [onChanged].
|
||||||
*
|
*
|
||||||
* State is keyed on the file so it always reflects the entry it was opened for. On a filesystem that
|
* State is keyed on the file so it always reflects the entry it was opened for. On a filesystem that
|
||||||
@@ -1980,7 +1980,7 @@ private fun FilePropertiesDialog(
|
|||||||
overflow = TextOverflow.Ellipsis,
|
overflow = TextOverflow.Ellipsis,
|
||||||
)
|
)
|
||||||
Spacer(Modifier.height(6.dp))
|
Spacer(Modifier.height(6.dp))
|
||||||
PropertyLine("Location", file.parent ?: "—")
|
PropertyLine("Location", file.parent ?: "-")
|
||||||
PropertyLine(
|
PropertyLine(
|
||||||
"Type",
|
"Type",
|
||||||
if (file.isDirectory) "Folder"
|
if (file.isDirectory) "Folder"
|
||||||
@@ -2033,7 +2033,7 @@ private fun FilePropertiesDialog(
|
|||||||
attrs = attrs?.copy(hidden = want)
|
attrs = attrs?.copy(hidden = want)
|
||||||
onChanged()
|
onChanged()
|
||||||
} else {
|
} else {
|
||||||
// The write failed after all — disable the toggle rather than lie.
|
// The write failed after all - disable the toggle rather than lie.
|
||||||
attrs = attrs?.copy(hiddenSupported = false)
|
attrs = attrs?.copy(hiddenSupported = false)
|
||||||
Toast.makeText(context, "Couldn't change Hidden on this storage", Toast.LENGTH_SHORT).show()
|
Toast.makeText(context, "Couldn't change Hidden on this storage", Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ import androidx.compose.ui.unit.dp
|
|||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import com.steamdeck.launcher.R
|
import com.steamdeck.launcher.R
|
||||||
|
|
||||||
/** Everything the main screen shows; the activity owns the values and the work behind them. */
|
|
||||||
class MainUiState(
|
class MainUiState(
|
||||||
val installed: String?,
|
val installed: String?,
|
||||||
val ready: Boolean,
|
val ready: Boolean,
|
||||||
@@ -53,29 +52,13 @@ class MainUiState(
|
|||||||
val failed: Boolean,
|
val failed: Boolean,
|
||||||
val frameGenLabel: String,
|
val frameGenLabel: String,
|
||||||
val desktopInstalled: Boolean,
|
val desktopInstalled: Boolean,
|
||||||
/** The account the client would sign in as offline, or null if it has never signed in. */
|
|
||||||
val offlineAccount: String?,
|
val offlineAccount: String?,
|
||||||
val offline: Boolean,
|
val offline: Boolean,
|
||||||
/** The folder every session shows at /root/ROMs, or null if none is chosen. */
|
|
||||||
val romsDir: String?,
|
val romsDir: String?,
|
||||||
val logsEnabled: Boolean,
|
val logsEnabled: Boolean,
|
||||||
/** Installed emulators that can run under gamescope: label to path inside the runtime. */
|
|
||||||
val emulators: List<Pair<String, String>> = emptyList(),
|
val emulators: List<Pair<String, String>> = emptyList(),
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
|
||||||
* The whole app outside a session, in one column that is sized to the window it has.
|
|
||||||
*
|
|
||||||
* Panels and densities vary too much for fixed dp: a 7" 1080p handheld in landscape has barely
|
|
||||||
* 400dp of height, a foldable's inner screen has 900. So the column is designed at one size and
|
|
||||||
* scaled by the height available — everything on it, text included, shrinks together until it
|
|
||||||
* fits — with scrolling left as the last resort, and a width cap so the buttons never span a
|
|
||||||
* wide panel. The system bars are kept clear of.
|
|
||||||
*
|
|
||||||
* Play and Desktop span the column; everything else is a tile in two columns, a title with the
|
|
||||||
* setting's current value under it, so the menu is read at a glance and fits without scrolling
|
|
||||||
* on a handheld.
|
|
||||||
*/
|
|
||||||
@OptIn(ExperimentalLayoutApi::class)
|
@OptIn(ExperimentalLayoutApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun MainScreen(
|
fun MainScreen(
|
||||||
@@ -104,7 +87,6 @@ fun MainScreen(
|
|||||||
.systemBarsPadding(),
|
.systemBarsPadding(),
|
||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
) {
|
) {
|
||||||
// The column as designed needs about this much height; below it, scale everything.
|
|
||||||
val designHeight = 480.dp
|
val designHeight = 480.dp
|
||||||
val k = (maxHeight / designHeight).coerceIn(0.55f, 1f)
|
val k = (maxHeight / designHeight).coerceIn(0.55f, 1f)
|
||||||
val colors = MaterialTheme.colorScheme
|
val colors = MaterialTheme.colorScheme
|
||||||
@@ -124,10 +106,6 @@ fun MainScreen(
|
|||||||
)
|
)
|
||||||
Spacer(Modifier.height(6.dp * k))
|
Spacer(Modifier.height(6.dp * k))
|
||||||
Text("SteamDeck", fontSize = 22.sp * k, color = colors.onBackground)
|
Text("SteamDeck", fontSize = 22.sp * k, color = colors.onBackground)
|
||||||
Text(
|
|
||||||
"Valve's native ARM64 Steam client, under gamescope",
|
|
||||||
fontSize = 12.sp * k, color = colors.onSurfaceVariant, textAlign = TextAlign.Center,
|
|
||||||
)
|
|
||||||
Spacer(Modifier.height(14.dp * k))
|
Spacer(Modifier.height(14.dp * k))
|
||||||
|
|
||||||
val status = when {
|
val status = when {
|
||||||
@@ -138,14 +116,14 @@ fun MainScreen(
|
|||||||
Text(status, fontSize = 15.sp * k, color = colors.onBackground)
|
Text(status, fontSize = 15.sp * k, color = colors.onBackground)
|
||||||
val detail = when {
|
val detail = when {
|
||||||
state.busy -> if (state.percent >= 0) "${state.stage} ${state.percent}%" else state.stage
|
state.busy -> if (state.percent >= 0) "${state.stage} ${state.percent}%" else state.stage
|
||||||
state.failed -> "Install failed — nothing was changed"
|
state.failed -> "Install failed. Nothing changed."
|
||||||
!state.ready -> state.available?.let { "$it · ${state.availableSize} download, one time" }
|
!state.ready -> state.available?.let { "$it · ${state.availableSize} download, one time" }
|
||||||
?: "Could not reach the runtime catalog"
|
?: "Could not reach the runtime catalog"
|
||||||
state.available != null && state.available != state.installed ->
|
state.available != null && state.available != state.installed ->
|
||||||
"Runtime ${state.installed ?: "?"} installed · ${state.available} available"
|
"Runtime ${state.installed ?: "?"} installed · ${state.available} available"
|
||||||
else -> "Runtime ${state.installed ?: "?"} installed"
|
else -> null
|
||||||
}
|
}
|
||||||
Text(
|
if (detail != null) Text(
|
||||||
detail, fontSize = 12.sp * k, color = colors.onSurfaceVariant, textAlign = TextAlign.Center,
|
detail, fontSize = 12.sp * k, color = colors.onSurfaceVariant, textAlign = TextAlign.Center,
|
||||||
modifier = Modifier.padding(top = 3.dp * k),
|
modifier = Modifier.padding(top = 3.dp * k),
|
||||||
)
|
)
|
||||||
@@ -160,7 +138,6 @@ fun MainScreen(
|
|||||||
Spacer(Modifier.height(14.dp * k))
|
Spacer(Modifier.height(14.dp * k))
|
||||||
|
|
||||||
val buttonHeight = 40.dp * k
|
val buttonHeight = 40.dp * k
|
||||||
// Each launch button has its own cog: what only matters for that mode lives there.
|
|
||||||
Row(horizontalArrangement = Arrangement.spacedBy(6.dp * k), modifier = Modifier.fillMaxWidth()) {
|
Row(horizontalArrangement = Arrangement.spacedBy(6.dp * k), modifier = Modifier.fillMaxWidth()) {
|
||||||
Button(
|
Button(
|
||||||
onClick = onPlay, enabled = state.ready && !state.busy,
|
onClick = onPlay, enabled = state.ready && !state.busy,
|
||||||
@@ -172,11 +149,9 @@ fun MainScreen(
|
|||||||
OutlinedButton(
|
OutlinedButton(
|
||||||
onClick = onDesktop, enabled = state.ready && !state.busy && state.desktopInstalled,
|
onClick = onDesktop, enabled = state.ready && !state.busy && state.desktopInstalled,
|
||||||
modifier = Modifier.weight(1f).height(buttonHeight),
|
modifier = Modifier.weight(1f).height(buttonHeight),
|
||||||
) { Text(if (state.desktopInstalled) "Desktop" else "Desktop — install it under Desktop & apps", fontSize = 13.sp * k, maxLines = 1, overflow = TextOverflow.Ellipsis) }
|
) { Text("Desktop", fontSize = 13.sp * k, maxLines = 1, overflow = TextOverflow.Ellipsis) }
|
||||||
CogButton(k, onDesktopSettings)
|
CogButton(k, onDesktopSettings)
|
||||||
}
|
}
|
||||||
// The ROMs folder, then every installed emulator as a session of its own under
|
|
||||||
// gamescope (where the GPU is); the ? says why they are here and not on the desktop.
|
|
||||||
FlowRow(
|
FlowRow(
|
||||||
horizontalArrangement = Arrangement.spacedBy(4.dp * k),
|
horizontalArrangement = Arrangement.spacedBy(4.dp * k),
|
||||||
verticalArrangement = Arrangement.spacedBy(4.dp * k),
|
verticalArrangement = Arrangement.spacedBy(4.dp * k),
|
||||||
@@ -197,7 +172,7 @@ fun MainScreen(
|
|||||||
onClick = { onLaunchEmulator(path) }, enabled = state.ready && !state.busy,
|
onClick = { onLaunchEmulator(path) }, enabled = state.ready && !state.busy,
|
||||||
contentPadding = PaddingValues(horizontal = 10.dp * k, vertical = 0.dp),
|
contentPadding = PaddingValues(horizontal = 10.dp * k, vertical = 0.dp),
|
||||||
modifier = Modifier.height(30.dp * k),
|
modifier = Modifier.height(30.dp * k),
|
||||||
) { Text("▶ $label", fontSize = 11.sp * k, maxLines = 1) }
|
) { Text(label, fontSize = 11.sp * k, maxLines = 1) }
|
||||||
}
|
}
|
||||||
OutlinedButton(
|
OutlinedButton(
|
||||||
onClick = onEmulatorHelp,
|
onClick = onEmulatorHelp,
|
||||||
@@ -205,15 +180,13 @@ fun MainScreen(
|
|||||||
modifier = Modifier.width(30.dp * k).height(30.dp * k),
|
modifier = Modifier.width(30.dp * k).height(30.dp * k),
|
||||||
) { Text("?", fontSize = 12.sp * k) }
|
) { Text("?", fontSize = 12.sp * k) }
|
||||||
}
|
}
|
||||||
// Offline is read while the client starts, so it is decided here rather than in the
|
|
||||||
// session's drawer, and it needs credentials from an earlier sign-in to be possible.
|
|
||||||
OutlinedButton(
|
OutlinedButton(
|
||||||
onClick = onOffline, enabled = state.offlineAccount != null,
|
onClick = onOffline, enabled = state.offlineAccount != null,
|
||||||
modifier = Modifier.fillMaxWidth().padding(top = 5.dp * k).height(buttonHeight),
|
modifier = Modifier.fillMaxWidth().padding(top = 5.dp * k).height(buttonHeight),
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
when {
|
when {
|
||||||
state.offlineAccount == null -> "Start offline — sign in once first"
|
state.offlineAccount == null -> "Start offline"
|
||||||
state.offline -> "Start offline: on · ${state.offlineAccount}"
|
state.offline -> "Start offline: on · ${state.offlineAccount}"
|
||||||
else -> "Start offline: off"
|
else -> "Start offline: off"
|
||||||
},
|
},
|
||||||
@@ -260,7 +233,6 @@ fun MainScreen(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The cog beside a launch button. */
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun CogButton(k: Float, onClick: () -> Unit) {
|
private fun CogButton(k: Float, onClick: () -> Unit) {
|
||||||
OutlinedButton(
|
OutlinedButton(
|
||||||
@@ -270,7 +242,6 @@ private fun CogButton(k: Float, onClick: () -> Unit) {
|
|||||||
) { Icon(Icons.Filled.Settings, contentDescription = "Settings", modifier = Modifier.size(18.dp * k)) }
|
) { Icon(Icons.Filled.Settings, contentDescription = "Settings", modifier = Modifier.size(18.dp * k)) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/** One tile of the two-column menu: what it is, and under it what it is set to. */
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun MenuTile(
|
private fun MenuTile(
|
||||||
title: String,
|
title: String,
|
||||||
@@ -297,40 +268,12 @@ private fun MenuTile(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The ? beside the emulator row: what the ▶ buttons are, how to use them, and why. */
|
|
||||||
@Composable
|
@Composable
|
||||||
fun EmulatorHelpDialog(onDismiss: () -> Unit) {
|
fun EmulatorHelpDialog(onDismiss: () -> Unit) {
|
||||||
AlertDialog(
|
AlertDialog(
|
||||||
onDismissRequest = onDismiss,
|
onDismissRequest = onDismiss,
|
||||||
title = { Text("Emulators") },
|
title = { Text("Emulators") },
|
||||||
text = {
|
text = { Text("Place games in the ROMs folder. In RPCS3, install firmware from File > Install Firmware.") },
|
||||||
Column(modifier = Modifier.verticalScroll(rememberScrollState())) {
|
|
||||||
Text("What the ▶ buttons are", style = MaterialTheme.typography.titleSmall)
|
|
||||||
Text(
|
|
||||||
"One per emulator installed under Desktop & apps. Each starts that emulator fullscreen, as a " +
|
|
||||||
"session of its own under gamescope — the same way the Steam client runs — with the Steam " +
|
|
||||||
"cog's display, driver and HDR settings.",
|
|
||||||
style = MaterialTheme.typography.bodySmall,
|
|
||||||
)
|
|
||||||
Spacer(Modifier.height(8.dp))
|
|
||||||
Text("How to use them", style = MaterialTheme.typography.titleSmall)
|
|
||||||
Text(
|
|
||||||
"Put your games in the folder the ROMs chip beside these buttons points at. In the emulator, open root › ROMs " +
|
|
||||||
"(/root/ROMs); the whole phone is at root › Storage. Firmware and BIOS files go in the " +
|
|
||||||
"same way (RPCS3: File › Install Firmware). Back opens the drawer; Stop session ends it.",
|
|
||||||
style = MaterialTheme.typography.bodySmall,
|
|
||||||
)
|
|
||||||
Spacer(Modifier.height(8.dp))
|
|
||||||
Text("Why not from the desktop", style = MaterialTheme.typography.titleSmall)
|
|
||||||
Text(
|
|
||||||
"The desktop draws in software (labwc on pixman) and cannot hand a program the GPU: a Vulkan " +
|
|
||||||
"emulator started there dies at its first frame (\"Surface lost\"). gamescope can, so an " +
|
|
||||||
"emulator that renders with Vulkan or OpenGL belongs here. The desktop stays for files, " +
|
|
||||||
"Firefox and anything that draws in software.",
|
|
||||||
style = MaterialTheme.typography.bodySmall,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
confirmButton = { TextButton(onClick = onDismiss) { Text("OK") } },
|
confirmButton = { TextButton(onClick = onDismiss) { Text("OK") } },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -353,10 +296,9 @@ fun CreditsDialog(onDismiss: () -> Unit) {
|
|||||||
title = { Text("Credits") },
|
title = { Text("Credits") },
|
||||||
text = {
|
text = {
|
||||||
Column(modifier = Modifier.verticalScroll(rememberScrollState())) {
|
Column(modifier = Modifier.verticalScroll(rememberScrollState())) {
|
||||||
Text("The412Banner — the app, the Wayland compositor, the runtime and the Steam session.", style = MaterialTheme.typography.bodyMedium)
|
Text("The412Banner - the app, the Wayland compositor, the runtime and the Steam session.", style = MaterialTheme.typography.bodyMedium)
|
||||||
Spacer(Modifier.height(10.dp))
|
|
||||||
Text("maxjivi05 (Max) — the gamescope runtime this is built on: the proot session, the session shim, the fake-evdev interposer and the controller work, from WinNative.", style = MaterialTheme.typography.bodyMedium)
|
|
||||||
Spacer(Modifier.height(10.dp))
|
Spacer(Modifier.height(10.dp))
|
||||||
|
Text("maxjivi05 (Max) - the gamescope runtime this is built on: the proot session, the session shim, the fake-evdev interposer and the controller work, from WinNative.", style = MaterialTheme.typography.bodyMedium)
|
||||||
Spacer(Modifier.height(10.dp))
|
Spacer(Modifier.height(10.dp))
|
||||||
Text(
|
Text(
|
||||||
"GPL-3.0. Valve, Steam, Steam Deck and Proton are trademarks of Valve Corporation; this project is not affiliated with Valve. gamescope, Mesa, Turnip, Xwayland, PulseAudio, proot and Arch Linux ARM are their authors' own.",
|
"GPL-3.0. Valve, Steam, Steam Deck and Proton are trademarks of Valve Corporation; this project is not affiliated with Valve. gamescope, Mesa, Turnip, Xwayland, PulseAudio, proot and Arch Linux ARM are their authors' own.",
|
||||||
|
|||||||
@@ -6,6 +6,17 @@ the timeline, then lessons and backlog. Companion to the README (what the app *d
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## 2026-09-23 - branch `feat/armada-and-lineage`
|
||||||
|
|
||||||
|
- Steam Deck mode: `-steamdeck` only; SteamOS helper stubs staged from the apk under `/usr/bin` and `/usr/bin/steamos-polkit-helpers` (the missing `steamos-update` there was the "Update Error" dialog; `jupiter-dock-updater --check` answers 7 so no dock firmware row); Deck mode defaults the `steamdeck_publicbeta` channel (on `publicbeta` every start reinstalled the client and lost the launch URL); client branch row in the Steam cog.
|
||||||
|
- QAM battery: `session/BatteryComponent.kt` writes BAT0/BAT1 from BatteryManager, bound over `/sys/class/power_supply`. Cloud saves checked on device: in sync, nothing was broken.
|
||||||
|
- Added games: any number of Games folders, each bound under `/root/Games`; one shortcut per subfolder in the client's `shortcuts.vdf` under the ARM64 Proton; exe choice per game; art from the folder, else Steam's store (capsule, header, hero, logo) copied into the client's grid.
|
||||||
|
- gamescope: the runtime's 3.16.29 rebuilt in CI (`tools/gamescope`, release `gamescope-3.16.29-p1`) with Armada's ARM64 client fixes, a realtime-queue switch and the gamepad cursor fix; staged over `/usr/local/bin`. Game windows forced fullscreen in Steam mode (a game came back in the top-left corner after the Steam menu).
|
||||||
|
- Audio: own PulseAudio sinks in `tools/aaudio-sink`, built into the bundle by CI. With DirectAudio on, the client's sound goes through the relay's shared ring (`module-directaudio-sink`, sink named DirectAudio); off, `module-aaudio-sink`. Inside proot AAudio only gave 20 ms bursts, the relay gets 4 ms.
|
||||||
|
- Winlator code rewritten or removed (SessionPart, HostEnvironment, HostProcess, PadState, cpp/framegen); rumble now served by `session/RumbleComponent.kt`.
|
||||||
|
- Front end shelf laid out whole so the d-pad reaches every tile.
|
||||||
|
- Hosted runtime and desktop packages untouched.
|
||||||
|
|
||||||
## 0.1.5 RELEASED 2026-09-23 03:17 - known-good point
|
## 0.1.5 RELEASED 2026-09-23 03:17 - known-good point
|
||||||
|
|
||||||
- **Tag `0.1.5` = `d2f4a84`** (bump commit, versionCode 6), notes `docs/releases/0.1.5.md` on main after it. Private release [0.1.5](https://github.com/The412Banner/SteamDeck/releases/tag/0.1.5) and public [`SteamDeck-0.1.5`](https://github.com/The412Banner/winlator-contents/releases/tag/SteamDeck-0.1.5) on winlator-contents, both Latest, asset `SteamDeck-0.1.5.apk` 21,093,959 bytes, sha256 `85b42954…`, run 35813465422. Staged as `/sdcard/Download/SteamDeck-0.1.5.apk`.
|
- **Tag `0.1.5` = `d2f4a84`** (bump commit, versionCode 6), notes `docs/releases/0.1.5.md` on main after it. Private release [0.1.5](https://github.com/The412Banner/SteamDeck/releases/tag/0.1.5) and public [`SteamDeck-0.1.5`](https://github.com/The412Banner/winlator-contents/releases/tag/SteamDeck-0.1.5) on winlator-contents, both Latest, asset `SteamDeck-0.1.5.apk` 21,093,959 bytes, sha256 `85b42954…`, run 35813465422. Staged as `/sdcard/Download/SteamDeck-0.1.5.apk`.
|
||||||
|
|||||||
Reference in new issue
Block a user