diff --git a/app/src/main/java/com/droiddeck/launcher/MainActivity.kt b/app/src/main/java/com/droiddeck/launcher/MainActivity.kt index 71c68ab4a3..eaec48d8f1 100644 --- a/app/src/main/java/com/droiddeck/launcher/MainActivity.kt +++ b/app/src/main/java/com/droiddeck/launcher/MainActivity.kt @@ -24,6 +24,7 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.setValue +import androidx.compose.ui.graphics.toArgb import com.droiddeck.launcher.gpu.FrameGen import com.droiddeck.launcher.gpu.TurnipDriver import com.droiddeck.launcher.gpu.LsfgNative @@ -83,6 +84,10 @@ class MainActivity : ComponentActivity() { // The screen's state. Compose redraws whatever reads these when they change. private var installed by mutableStateOf(null) + /** A session launch waiting on its button to fill the page (LaunchFlood). */ + private var flood by mutableStateOf(null) + private var floodProgress by androidx.compose.runtime.mutableFloatStateOf(0f) + private class PendingFlood(val from: androidx.compose.ui.geometry.Rect, val intent: Intent) private var ready by mutableStateOf(false) private var available by mutableStateOf(null) private var busy by mutableStateOf(false) @@ -225,10 +230,28 @@ class MainActivity : ComponentActivity() { } } } + if (intent?.component?.className == SessionActivity::class.java.name) { + if (flood != null) return + // Started by a blue button: it floods the page first. A running session is re-joined + // as before, rising over the front end. + val from = com.droiddeck.launcher.ui.LaunchOrigin.take() + if (from != null && !SessionState.running && com.droiddeck.launcher.ui.Motion.scale != 0f) { + flood = PendingFlood(from, intent) + return + } + com.droiddeck.launcher.ui.LaunchOrigin.flooding = null + } super.startActivity(intent) if (intent?.component?.className == SessionActivity::class.java.name) overridePendingTransition(R.anim.session_rise, R.anim.session_hold) } + /** The page is all blue: the session opens on the same blue, with no animation of its own. */ + private fun launchFlooded(f: PendingFlood) { + val signal = com.droiddeck.launcher.ui.Themes.byId(theme).signal + super.startActivity(f.intent.putExtra(com.droiddeck.launcher.ui.EXTRA_FLOOD, signal.toArgb())) + overridePendingTransition(0, 0) + } + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) displayManager = getSystemService(DISPLAY_SERVICE) as DisplayManager @@ -248,6 +271,7 @@ class MainActivity : ComponentActivity() { showMapping -> { { MappingHost() } } else -> null } + com.droiddeck.launcher.ui.FloodBehind({ floodProgress }) { FrontEndScreen( FrontEndState( installed = installed, ready = ready, available = available?.version, @@ -421,6 +445,7 @@ class MainActivity : ComponentActivity() { ), page = page, ) + } if (showRoms) RomsDialog( path = romsDir, onChoose = { @@ -447,6 +472,7 @@ class MainActivity : ComponentActivity() { onDismiss = { showRemove = false }, ) if (showCredits) CreditsDialog { showCredits = false } + flood?.let { f -> com.droiddeck.launcher.ui.LaunchFlood(f.from, onProgress = { floodProgress = it }) { launchFlooded(f) } } } } @@ -556,6 +582,10 @@ class MainActivity : ComponentActivity() { override fun onStop() { displayManager.unregisterDisplayListener(secondScreenDisplayListener) + // The session covers the page by now; coming back finds it as it was. + flood = null + floodProgress = 0f + com.droiddeck.launcher.ui.LaunchOrigin.flooding = null super.onStop() } diff --git a/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt b/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt index b108d09814..d10c89eb08 100644 --- a/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt +++ b/app/src/main/java/com/droiddeck/launcher/SessionActivity.kt @@ -97,6 +97,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { private var touchMode by mutableStateOf(SessionPrefs.TOUCH_AUTO) private var cursorPos by mutableStateOf(androidx.compose.ui.geometry.Offset(-100f, -100f)) private var cursorVisible by mutableStateOf(false) + /** The blue the front end flooded to on the way in; the loading screen opens on it (LaunchFlood). */ + private var floodColor by mutableStateOf(null) private val cursorHide = Runnable { cursorVisible = false } /** When the pad or the on-screen controls were last used (uptimeMillis); see [showCursor]. */ private var lastPadInputMs = 0L @@ -232,7 +234,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { root.pointerIcon = noCursor surfaceView.pointerIcon = noCursor - loading = LoadingState(this) + loading = LoadingState(this, steam = loadingMode() == SessionService.MODE_STEAM) if (!SessionState.running) { val needRuntime = com.droiddeck.launcher.runtime.LinuxRuntimeInstaller.installedVersion(this) == null val needDesktop = intent.getStringExtra(SessionService.EXTRA_MODE) == SessionService.MODE_DESKTOP && @@ -252,6 +254,10 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { } readPrefs() + intent.getIntExtra(com.droiddeck.launcher.ui.EXTRA_FLOOD, 0).takeIf { it != 0 && loading.visible }?.let { + floodColor = it + window.setBackgroundDrawable(android.graphics.drawable.ColorDrawable(it)) + } sessionOverlay = createSessionOverlay() root.addView(sessionOverlay) setContentView(root) @@ -304,6 +310,11 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback { onRetry = { retrySession() }, onShareLogs = { shareCurrentSessionLogs() }, onClose = { finish() }, + flood = floodColor?.let { androidx.compose.ui.graphics.Color(it) }, + onFlooded = { + floodColor = null + window.setBackgroundDrawable(android.graphics.drawable.ColorDrawable(android.graphics.Color.BLACK)) + }, ) // Opening the drawer takes the controller away from the game: release its pad. androidx.compose.runtime.LaunchedEffect(drawerOpen) { diff --git a/app/src/main/java/com/droiddeck/launcher/session/LoadingState.kt b/app/src/main/java/com/droiddeck/launcher/session/LoadingState.kt index 50929d87cc..566300c61f 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/LoadingState.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/LoadingState.kt @@ -17,7 +17,7 @@ import java.nio.charset.StandardCharsets * progress, and lifting that out is the difference between "starting the Steam client" for three * minutes and a percentage that moves. */ -class LoadingState(context: Context) { +class LoadingState(context: Context, steam: Boolean = true) { var visible by mutableStateOf(true) var step by mutableStateOf("Starting the session…") var percent by mutableIntStateOf(-1) @@ -27,7 +27,10 @@ class LoadingState(context: Context) { /** The technical side of an ended session (exit status, log path), under the advice in [step]. */ var endedDetail by mutableStateOf(null) - private val hints = context.resources.getStringArray(com.droiddeck.launcher.R.array.loading_hints) + // The desktop and the emulators get their own: the Steam ones talk about Steam. + private val hints = context.resources.getStringArray( + if (steam) com.droiddeck.launcher.R.array.loading_hints else com.droiddeck.launcher.R.array.loading_hints_desktop, + ) private val startedAt = SystemClock.elapsedRealtime() /** Once a second: the clock and the hint. */ diff --git a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndWidgets.kt b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndWidgets.kt index 53339b3ddb..7d034a138e 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndWidgets.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndWidgets.kt @@ -1,5 +1,7 @@ package com.droiddeck.launcher.ui +import androidx.compose.ui.layout.boundsInRoot +import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.focus.focusRequester import androidx.compose.ui.focus.onFocusChanged import android.provider.Settings @@ -163,20 +165,26 @@ internal fun PrimaryButton( val pressed by src.collectIsPressedAsState() val scale by animateFloatAsState(if (pressed) 0.955f else if (hot) 1.02f else 1f, Motion.sp(0.5f, Spring.StiffnessMedium), label = "btnScale") val lift by animateFloatAsState(if (hot) 14f else 6f, Motion.tw(300), label = "btnLift") + // Where it sits, so a session it starts can grow out of it (LaunchFlood). + val placed = remember { arrayOfNulls(1) } Row( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp), modifier = modifier.then(track) + .onGloballyPositioned { placed[0] = it } // 48dp to touch on a handheld; compact rows keep 44. .heightIn(min = if (compact) 44.dp else 48.dp) .then(if (frontFocus != null) Modifier.focusRequester(frontFocus.primary).onFocusChanged { if (it.isFocused) frontFocus.last = FrontFocus.PRIMARY } else Modifier) - .graphicsLayer { scaleX = scale; scaleY = scale; shadowElevation = if (enabled) lift.dp.toPx() else 0f; shape = Shape12; clip = false; ambientShadowColor = pal.signal; spotShadowColor = pal.signal } + .graphicsLayer { alpha = if (LaunchOrigin.flooding === placed) 0f else 1f; scaleX = scale; scaleY = scale; shadowElevation = if (enabled) lift.dp.toPx() else 0f; shape = Shape12; clip = false; ambientShadowColor = pal.signal; spotShadowColor = pal.signal } .clip(Shape12) .background(if (enabled) Brush.linearGradient(listOf(colors.primary, pal.primary2)) else Brush.linearGradient(listOf(colors.surfaceVariant, colors.surfaceVariant))) .shine(hot, 0.45f) // The grow and shine alone barely show on the light fill: outline it when a // controller is on it, as the other controls are. .border(2.dp, if (hot) pal.signal else Color.Transparent, Shape12) - .hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, enabled = enabled, onClick = onClick) + .hoverable(src).clickable(interactionSource = src, indication = LocalIndication.current, enabled = enabled) { + placed[0]?.takeIf { it.isAttached }?.let { LaunchOrigin.mark(it.boundsInRoot(), placed) } + onClick() + } .padding( start = if (large) 20.dp else if (compact) 10.dp else if (icon != null) 14.dp else 18.dp, end = if (large) 26.dp else if (compact) 10.dp else 18.dp, diff --git a/app/src/main/java/com/droiddeck/launcher/ui/LaunchFlood.kt b/app/src/main/java/com/droiddeck/launcher/ui/LaunchFlood.kt new file mode 100644 index 0000000000..ad43b536b3 --- /dev/null +++ b/app/src/main/java/com/droiddeck/launcher/ui/LaunchFlood.kt @@ -0,0 +1,174 @@ +package com.droiddeck.launcher.ui + +import android.os.SystemClock +import androidx.compose.animation.core.Animatable +import androidx.compose.animation.core.CubicBezierEasing +import androidx.compose.animation.core.tween +import androidx.compose.foundation.Canvas +import androidx.compose.foundation.gestures.awaitEachGesture +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.material3.MaterialTheme +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.rememberUpdatedState +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.geometry.CornerRadius +import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.geometry.Rect +import androidx.compose.ui.geometry.Size +import androidx.compose.ui.graphics.Brush +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.graphicsLayer +import androidx.compose.ui.graphics.lerp +import androidx.compose.ui.input.pointer.pointerInput +import androidx.compose.ui.unit.dp +import androidx.compose.ui.util.lerp +import kotlin.math.hypot +import kotlinx.coroutines.launch +import kotlinx.coroutines.flow.first +import kotlinx.coroutines.delay +import kotlinx.coroutines.coroutineScope +import androidx.compose.ui.layout.onSizeChanged +import androidx.compose.runtime.snapshotFlow +import androidx.compose.animation.core.spring + +// Starting a session from a blue button: the button grows until the page is its blue, and the +// loading screen opens on that blue and gathers it into the ball of the throbber. + +/** Carries the flood's colour to the session, which opens on it. */ +const val EXTRA_FLOOD = "com.droiddeck.launcher.FLOOD" + +/** Where the last pressed blue button sat, so a session started by it can grow out of it. */ +internal object LaunchOrigin { + private var bounds: Rect? = null + private var button: Any? = null + private var at = 0L + + /** The button a flood is growing out of: it steps aside so only the flood shows. */ + var flooding by mutableStateOf(null) + + fun mark(r: Rect, key: Any) { + bounds = r + button = key + at = SystemClock.uptimeMillis() + } + + /** The button behind a launch starting now, if one was pressed just before; it hides for the flood. */ + fun take(): Rect? { + val b = bounds?.takeIf { SystemClock.uptimeMillis() - at < 1_500 } + if (b != null) flooding = button + bounds = null + button = null + return b + } +} + +/** The page a flood grows over, sinking back a touch as it is covered; [progress] is the flood's. */ +@Composable +internal fun FloodBehind(progress: () -> Float, content: @Composable () -> Unit) { + Box(Modifier.fillMaxSize().graphicsLayer { val k = sinkScale(progress()); scaleX = k; scaleY = k }) { content() } +} + +private fun sinkScale(progress: Float) = 1f - 0.04f * progress + +private val Gather = CubicBezierEasing(0.6f, 0f, 0.15f, 1f) + +/** + * The pressed button, [from] in root px, stretching out to cover the page. Each edge rides its own + * loose spring: the ones with furthest to go set off first and quickest, the ones near the page's + * edge lag and then snap after them, so it pulls like something elastic rather than zooming. It + * goes blobby in flight, its gradient settles into the flat blue of the ball, and [onProgress] + * (0 to 1) lets the page behind sink a little. Calls [onCovered] once nothing but blue shows. + * Swallows touches while it runs. + */ +@Composable +internal fun LaunchFlood(from: Rect, onProgress: (Float) -> Unit, onCovered: () -> Unit) { + val colors = MaterialTheme.colorScheme + val pal = LocalPalette.current + // Left, top, right, bottom: 0 on the button, 1 on the page's edge. Springs overshoot past the + // edge, off the page, so the wobble is felt in the pull and never seen as a shrink. + val edges = remember { List(4) { Animatable(0f) } } + val covered by rememberUpdatedState(onCovered) + val progress by rememberUpdatedState(onProgress) + var page by remember { mutableStateOf(Size.Zero) } + LaunchedEffect(page != Size.Zero) { + if (page == Size.Zero) return@LaunchedEffect + val travel = listOf(from.left, from.top, page.width - from.right, page.height - from.bottom).map { it.coerceAtLeast(0f) } + val far = travel.max().coerceAtLeast(1f) + coroutineScope { + val runs = edges.mapIndexed { i, edge -> + val lead = travel[i] / far + launch { + delay(Motion.ms((180 * (1f - lead)).toInt()).toLong()) + edge.animateTo(1f, spring(dampingRatio = 0.48f, stiffness = lerp(110f, 190f, lead))) { + progress(edges.sumOf { it.value.coerceIn(0f, 1f).toDouble() }.toFloat() / 4f) + } + } + } + // Covered once every edge has reached the page's, the first time round. + snapshotFlow { edges.all { it.value >= 0.995f } }.first { it } + covered() + runs.forEach { it.join() } + } + } + Canvas(Modifier.fillMaxSize().onSizeChanged { page = Size(it.width.toFloat(), it.height.toFloat()) }.pointerInput(Unit) { awaitEachGesture { while (true) awaitPointerEvent().changes.forEach { it.consume() } } }) { + val (l, t, r, b) = edges.map { it.value } + val mean = edges.sumOf { it.value.coerceIn(0f, 1f).toDouble() }.toFloat() / 4f + // The button sinks with the page behind (FloodBehind), so the flood leaves from where it is now. + val k = sinkScale(mean) + val cx = size.width / 2f + val cy = size.height / 2f + val left = lerp(cx + (from.left - cx) * k, 0f, l) + val top = lerp(cy + (from.top - cy) * k, 0f, t) + val right = lerp(cx + (from.right - cx) * k, size.width, r) + val bottom = lerp(cy + (from.bottom - cy) * k, size.height, b) + val w = (right - left).coerceAtLeast(0f) + val h = (bottom - top).coerceAtLeast(0f) + // A button's corners at rest, a blob in flight, square once it fills the page. + val blob = kotlin.math.sin(Math.PI * mean).toFloat().coerceAtLeast(0f) + val corner = lerp(12.dp.toPx() * (1f - mean), minOf(w, h) * 0.42f, blob) + // The button's gradient gives way to the ball's flat blue in the first half. + val mix = (mean * 2f).coerceAtMost(1f) + drawRoundRect( + Brush.linearGradient( + listOf(lerp(colors.primary, pal.signal, mix), lerp(pal.primary2, pal.signal, mix)), + start = Offset(left, top), end = Offset(right, bottom), + ), + topLeft = Offset(left, top), size = Size(w, h), cornerRadius = CornerRadius(corner), + ) + } +} + +/** + * The session's first frames: the page in [flood], drawing in to a circle over [ball] (centre and + * radius in root px, once the throbber is laid out) that lands the size of it. Calls [onLanded] then. + */ +@Composable +internal fun FloodGather(flood: Color, ball: Pair?, onLanded: () -> Unit) { + val gather = remember { Animatable(0f) } + var started by remember { mutableStateOf(false) } + val landed by rememberUpdatedState(onLanded) + LaunchedEffect(ball != null) { + if (ball == null || started) return@LaunchedEffect + started = true + // A beat of plain blue first, so the change of screen does not read as a cut. + delay(Motion.ms(90).toLong()) + gather.animateTo(1f, tween(Motion.ms(640).coerceAtLeast(1), easing = Gather)) + landed() + } + Canvas(Modifier.fillMaxSize().pointerInput(Unit) { awaitEachGesture { while (true) awaitPointerEvent().changes.forEach { it.consume() } } }) { + val b = ball + if (b == null) { + drawRect(flood) + return@Canvas + } + val (c, r) = b + val far = maxOf(hypot(c.x, c.y), hypot(size.width - c.x, c.y), hypot(c.x, size.height - c.y), hypot(size.width - c.x, size.height - c.y)) + drawCircle(flood, radius = lerp(far, r, gather.value), center = c) + } +} diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SessionLoading.kt b/app/src/main/java/com/droiddeck/launcher/ui/SessionLoading.kt index 0f965d56f8..1dc793922a 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/SessionLoading.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/SessionLoading.kt @@ -4,6 +4,9 @@ import androidx.compose.animation.core.animateFloat import androidx.compose.animation.core.infiniteRepeatable import androidx.compose.animation.core.rememberInfiniteTransition import androidx.compose.runtime.produceState +import androidx.compose.runtime.key +import androidx.compose.ui.layout.boundsInRoot +import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.runtime.remember import androidx.compose.ui.draw.alpha import androidx.compose.ui.draw.drawBehind @@ -131,8 +134,12 @@ fun LoadingOverlay( onRetry: (() -> Unit)? = null, onShareLogs: (() -> Unit)? = null, onClose: (() -> Unit)? = null, + /** The blue the page opens on when a button flooded to it, gathered into the throbber's ball. */ + flood: Color? = null, + onFlooded: () -> Unit = {}, ) { val colors = MaterialTheme.colorScheme + var ball by remember { mutableStateOf?>(null) } val stages = remember(steam) { loadStages(steam) } var reached by remember { mutableStateOf(0) } LaunchedEffect(step, steam) { @@ -170,7 +177,13 @@ fun LoadingOverlay( horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier.align(Alignment.Center).verticalScroll(rememberScrollState()).padding(horizontal = 32.dp, vertical = 24.dp), ) { - LogoThrobber(Modifier.width(if (ended) 88.dp else 110.dp), running = !ended) + // Held on the plain D while the flood gathers, and started fresh when it lands. + key(flood == null) { + LogoThrobber( + Modifier.width(if (ended) 88.dp else 110.dp).onGloballyPositioned { ball = throbberBall(it.boundsInRoot()) }, + running = !ended && flood == null, + ) + } Spacer(Modifier.height(30.dp)) Text( if (ended) "The session ended" else title, fontSize = 20.sp, fontWeight = FontWeight.SemiBold, @@ -195,6 +208,7 @@ fun LoadingOverlay( modifier = Modifier.align(Alignment.BottomCenter).padding(start = 120.dp, end = 120.dp, bottom = 28.dp), ) if (!ended && onCancel != null) CancelHint(onCancel, Modifier.align(Alignment.BottomEnd).padding(end = 16.dp, bottom = 16.dp)) + if (flood != null) FloodGather(flood, ball, onFlooded) } } diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SteamHome.kt b/app/src/main/java/com/droiddeck/launcher/ui/SteamHome.kt index d9daa4b428..7be01984ce 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/SteamHome.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/SteamHome.kt @@ -133,8 +133,12 @@ internal fun CapsuleWall( // Animations off in the system settings: a still wall. val still = Motion.scale == 0f BoxWithConstraints(modifier.fillMaxSize()) { - val wallW = maxWidth * 1.3f - val wallH = maxHeight * 2.4f + // Centred on the page and big enough that, once tilted, it still covers every corner. + val tilt = Math.toRadians(13.0) + val cos = kotlin.math.cos(tilt).toFloat() + val sin = kotlin.math.sin(tilt).toFloat() + val wallW = (maxWidth * cos + maxHeight * sin) * 1.1f + val wallH = maxOf(maxHeight * 2.4f, (maxWidth * sin + maxHeight * cos) * 1.1f) val columns = ((wallW + gap) / (capW + gap)).toInt() + 1 val perRun = ((wallH + gap) / (capH + gap)).toInt() + 1 val run = (capH + gap) * perRun @@ -142,7 +146,7 @@ internal fun CapsuleWall( horizontalArrangement = Arrangement.spacedBy(gap), modifier = Modifier .wrapContentSize(Alignment.TopStart, unbounded = true) - .offset(x = maxWidth * 0.16f, y = -(wallH - maxHeight) / 2) + .offset(x = -(wallW - maxWidth) / 2, y = -(wallH - maxHeight) / 2) .requiredSize(wallW, wallH) .graphicsLayer { rotationZ = -13f }, ) { diff --git a/app/src/main/java/com/droiddeck/launcher/ui/Throbber.kt b/app/src/main/java/com/droiddeck/launcher/ui/Throbber.kt index 6940e07a88..c58be35e29 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/Throbber.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/Throbber.kt @@ -64,6 +64,12 @@ internal fun LogoThrobber(modifier: Modifier = Modifier, running: Boolean = true } } +/** The ball of a throbber laid out in [bounds]: its centre and its radius, at rest. */ +internal fun throbberBall(bounds: androidx.compose.ui.geometry.Rect): Pair { + val s = bounds.width / LogoShape.WIDTH + return Offset(bounds.left + (LogoShape.CX - LogoShape.LEFT) * s, bounds.top + LogoShape.CY * s) to LogoShape.BALL * s +} + private const val LOOP_MS = 1900 private val Settle = CubicBezierEasing(0.5f, 0f, 0.3f, 1f) private val Turn = CubicBezierEasing(0.65f, 0f, 0.35f, 1f) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f83701d7ab..c46d83f865 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -6,6 +6,12 @@ By default, leaving the app pauses Steam; it picks up where it left off when you come back. Your controller appears as an Xbox 360 pad. Otherwise, use the on-screen controls. + + First run sets up the desktop. This may take a few minutes. + By default, leaving the app pauses the session; it picks up where it left off when you come back. + Touch works as a touchpad: drag to move the pointer, tap to click. + Your controller appears as an Xbox 360 pad. Otherwise, use the on-screen controls. + Session Shows while a Steam or desktop session is open Steam is running diff --git a/docs/releases/0.2.0.md b/docs/releases/0.2.0.md new file mode 100644 index 0000000000..16e05b961a --- /dev/null +++ b/docs/releases/0.2.0.md @@ -0,0 +1,202 @@ +# DroidDeck 0.2.0 (beta) + +**Valve's native ARM64 Steam client on your Android handheld.** Windows games run through Valve's ARM64 Proton and FEX, and an optional Linux desktop brings emulators along. + +![Burnout Paradise running through Valve's ARM64 Proton at 60 fps](https://raw.githubusercontent.com/Droid-Deck/DroidDeck/main/docs/releases/media/0.2.0/burnout-paradise.jpg) + +**Needs:** Android 9+, Adreno 730 or newer (or 8xx), ~3 GB free for the runtime (+1.1 GB for Desktop & apps). + +This is the first release from the [Droid-Deck](https://github.com/Droid-Deck) org, so it covers everything DroidDeck does, not just what changed since 0.1.7. `legacy#N` links go to pull requests in [The412Banner/DroidDeck](https://github.com/The412Banner/DroidDeck), from before the move. + +--- + +## Highlights + +### Steam, running natively +The real Steam client in Big Picture, fetched from Valve on your device. Sign in, install, play. Proton for ARM64 is ready before your first game needs it. + +![Steam Big Picture running natively in DroidDeck](https://raw.githubusercontent.com/Droid-Deck/DroidDeck/main/docs/releases/media/0.2.0/big-picture.jpg) + +Turn on **Run Steam when DroidDeck starts** and the app icon takes you straight into Big Picture, startup movie and all. + +![From the Android home screen, through the loading screen and startup movie, into Big Picture](https://raw.githubusercontent.com/Droid-Deck/DroidDeck/main/docs/releases/media/0.2.0/launch-into-steam.gif) + +### A launcher made for handhelds +Your Steam library as a capsule wall, a Games tab with per-game settings, and one tap from launcher to game. + +

+Steam tab with the capsule wall +Games tab with a game's launch settings +

+ +![Tapping Open desktop: the button floods the screen and gathers into the loading throbber](https://raw.githubusercontent.com/Droid-Deck/DroidDeck/main/docs/releases/media/0.2.0/launch-to-desktop.gif) + +### A session menu over any game +Press Back mid-game for display, controls, components and session settings, paged with LB/RB. + +

+Paging through the session menu's tabs +Session menu open over Burnout Paradise +

+ +### Swap FEX, DXVK and VKD3D-Proton per Proton build +Download from the nightlies or import a `.wcp`, and see what the running game is using. + +

+Components manager +Components of the running game in the session menu +

+ +### A Linux desktop, with emulators one tap away +LXQt on the GPU, plus RPCS3, ARMSX2, Dolphin, DuckStation, melonDS, Cemu, PPSSPP and RetroArch. + +

+LXQt desktop with a file manager and terminal +Desktop tab with emulators to install +

+ +### On-screen controls you can lay out yourself +Drag every button where your thumbs want it, with adaptive sticks and phone-sized layouts. + +![On-screen controller layout editor](https://raw.githubusercontent.com/Droid-Deck/DroidDeck/main/docs/releases/media/0.2.0/controller-editor.jpg) + +--- + +## Everything in 0.2.0 + +
+Steam + +- Native ARM64 Steam client under gamescope, on DroidDeck's own Vulkan compositor (@The412Banner) +- Valve's ARM64 Proton and FEX, ready at first sign-in (@The412Banner, [legacy#22](https://github.com/The412Banner/DroidDeck/pull/22), #33) +- Start offline after one sign-in (@The412Banner) +- Steam Deck mode: battery and NIS in Quick Access, MangoHud overlay (@The412Banner, [legacy#9](https://github.com/The412Banner/DroidDeck/pull/9), [legacy#16](https://github.com/The412Banner/DroidDeck/pull/16)) +- Games from your own folders appear in Steam, with store art (@The412Banner, [legacy#9](https://github.com/The412Banner/DroidDeck/pull/9)) +- Components manager for FEX, DXVK and VKD3D-Proton, applied on every launch (@The412Banner, #29) +- GE-Proton and proton-cachyos as extra compatibility tools (@The412Banner, @xXJSONDeruloXx, [legacy#18](https://github.com/The412Banner/DroidDeck/pull/18)) +- FEX presets per session, Stability to Extreme + TSO (@The412Banner) +- Decky Loader, with plugins in Big Picture (@xXJSONDeruloXx, #16) +- Steam's Internet settings and connection indicator work (@maxjivi05) +- Steam sees the device as "DroidDeck" (@xXJSONDeruloXx, #15) +- Steam launchers on the Linux desktop (@The412Banner, #10) +- DroidDeck startup movie, and optionally straight into Steam when the app opens (@xXJSONDeruloXx, #25, #27, #36, #38) + +
+ +
+Launcher + +- Side rail, Games tab, capsule wall, graphite theme, controller hints, phone layouts (@xXJSONDeruloXx, #13, #35, #41) +- Launch buttons flood into the loading screen (@xXJSONDeruloXx, #46) +- Game files and Proton prefix shortcuts on each game's page (@xXJSONDeruloXx, #39) +- Controller navigation everywhere, remembered across the rail (@The412Banner, [legacy#29](https://github.com/The412Banner/DroidDeck/pull/29), [legacy#34](https://github.com/The412Banner/DroidDeck/pull/34), [legacy#38](https://github.com/The412Banner/DroidDeck/pull/38)) +- Built-in file manager, a ROMs folder anywhere (SD cards too), app files in Android's picker (@The412Banner, [legacy#41](https://github.com/The412Banner/DroidDeck/pull/41)) +- Themes and the split-D logo (@The412Banner, @xXJSONDeruloXx, [legacy#4](https://github.com/The412Banner/DroidDeck/pull/4), [legacy#37](https://github.com/The412Banner/DroidDeck/pull/37), #34) +- Use DroidDeck as your Android home app, with Android apps in the front end (@xXJSONDeruloXx, @The412Banner, [legacy#17](https://github.com/The412Banner/DroidDeck/pull/17), [legacy#44](https://github.com/The412Banner/DroidDeck/pull/44)) +- Build identity and latest-build link in the top bar (@xXJSONDeruloXx, [legacy#24](https://github.com/The412Banner/DroidDeck/pull/24), #26) + +
+ +
+Sessions + +- Sessions keep running when you leave the app (@The412Banner) +- Pause policy (Auto, Manual, Never), changeable mid-session, audio recovers after a pause (@xXJSONDeruloXx, [legacy#7](https://github.com/The412Banner/DroidDeck/pull/7), #14) +- Paged session menu with Display, Controls and Settings tabs (@xXJSONDeruloXx, @The412Banner, [legacy#40](https://github.com/The412Banner/DroidDeck/pull/40), #6, #24) +- Back opens the menu; a double press opens Steam's Quick Access (@xXJSONDeruloXx, [legacy#3](https://github.com/The412Banner/DroidDeck/pull/3), [legacy#20](https://github.com/The412Banner/DroidDeck/pull/20)) +- First run sets itself up from the loading screen (@The412Banner, [legacy#12](https://github.com/The412Banner/DroidDeck/pull/12), [legacy#15](https://github.com/The412Banner/DroidDeck/pull/15)) +- Launch on any connected display; a second screen can be a keyboard, trackpad or terminal (@xXJSONDeruloXx, [legacy#13](https://github.com/The412Banner/DroidDeck/pull/13), [legacy#33](https://github.com/The412Banner/DroidDeck/pull/33)) +- Share session logs from the app or the ended-session screen (@xXJSONDeruloXx, @The412Banner, [legacy#11](https://github.com/The412Banner/DroidDeck/pull/11), #17, #41) + +
+ +
+Controls + +- Any controller shows up as an Xbox 360 pad; an on-screen pad fills in when none is connected (@The412Banner) +- On-screen controller editor with adaptive sticks (@maxjivi05, #9) +- On-screen sticks that use the letterbox bars, plus Steam and QAM touch buttons (@The412Banner, @xXJSONDeruloXx, [legacy#6](https://github.com/The412Banner/DroidDeck/pull/6)) +- Real touch in Big Picture; a desktop touchpad that hovers, clicks, scrolls and two-finger drags (@The412Banner, #10, #22) +- Cursor shapes, hidden while you play on a pad (@The412Banner, #18) +- Soft keyboard and a full PC keyboard (@The412Banner, [legacy#25](https://github.com/The412Banner/DroidDeck/pull/25)) + +
+ +
+Display and performance + +- Frame generation: built-in Win-FG, or LSFG from your own Lossless Scaling, 2×–4× (@The412Banner) +- Import or download Turnip drivers per mode, from Banners-Turnip and WinNative (@The412Banner) +- Resolution and shape per mode, including "Exactly this panel" for 4:3 and 3:2 screens (@The412Banner, [legacy#14](https://github.com/The412Banner/DroidDeck/pull/14)) +- Stretch games to fill; Quake-engine games windowed to fit (@The412Banner, [legacy#32](https://github.com/The412Banner/DroidDeck/pull/32)) +- HDR10 on supported panels (experimental) (@The412Banner) +- Runs as a game on Android: sustained performance, fastest panel mode, ADPF hints (@The412Banner) +- Steam's interface stays on the GPU (@maxjivi05) +- Pin Steam and games to chosen CPU cores (@The412Banner) +- Faster proot with WinNative's seccomp and tracing fixes (@maxjivi05, #4, #37) + +
+ +
+Desktop and emulators + +- LXQt on labwc, on the GPU with Vulkan by default (@The412Banner, [legacy#25](https://github.com/The412Banner/DroidDeck/pull/25)) +- Emulators downloaded on request: RetroArch, PPSSPP, RPCS3, DuckStation, ARMSX2, Dolphin, melonDS, Cemu and more (@The412Banner) +- Emulator games launch full screen from the front end, one tile per disc, with box art (@The412Banner, [legacy#29](https://github.com/The412Banner/DroidDeck/pull/29), [legacy#34](https://github.com/The412Banner/DroidDeck/pull/34), [legacy#38](https://github.com/The412Banner/DroidDeck/pull/38)) +- ARMSX2 replaces PCSX2 for PS2: 60 fps where PCSX2 managed 17 (@The412Banner, [legacy#26](https://github.com/The412Banner/DroidDeck/pull/26)) +- Dolphin, melonDS and Cemu set up out of the box (@The412Banner, #10, #18, #42) +- Emulator controllers preconfigured, and RPCS3 shader fixes (@The412Banner, [legacy#25](https://github.com/The412Banner/DroidDeck/pull/25)) + +
+ +
+Audio + +- DirectAudio for games, straight to Android (@The412Banner, [legacy#9](https://github.com/The412Banner/DroidDeck/pull/9), [legacy#11](https://github.com/The412Banner/DroidDeck/pull/11)) +- Microphone for voice chat, on by default (@The412Banner, [legacy#11](https://github.com/The412Banner/DroidDeck/pull/11)) + +
+ +
+Fixed + +- Steam updates failing on read-only files (@The412Banner, #33) +- A dropped finger-up blocking later touches (@The412Banner, #22) +- Stopped sessions leaving stray processes and log spam (@The412Banner, #43) +- Cemu and shadPS4 crashing on the input shim; no cursor on the GPU desktop (@The412Banner, #42) +- Leftovers from crashed or killed sessions cleaned up at the next start (@The412Banner, [legacy#16](https://github.com/The412Banner/DroidDeck/pull/16)) +- The menu's dim layer staying over Steam after switching apps (@xXJSONDeruloXx, #45) +- Steam library capsule art (@xXJSONDeruloXx, #12) +- The menu's Desktop button wrapping (@xXJSONDeruloXx, #28) +- Launcher restarting when a controller connects (@xXJSONDeruloXx, #40) +- Runtime installs racing, or stopping when you leave the app (@xXJSONDeruloXx, #40) +- Steam blocked by Android's child-process limit; Setup lifts it over wireless ADB (@xXJSONDeruloXx, #21) + +
+ +
+Security + +- SHA-256 checked on every catalog, release and Proton download (@xXJSONDeruloXx, #40) +- Runtime archives can't link outside the rootfs (@xXJSONDeruloXx, #40) +- Logs scrub account and persona names, public IPs and device IDs (@The412Banner, #19) +- Signed with DroidDeck's own release key (@The412Banner, [legacy#41](https://github.com/The412Banner/DroidDeck/pull/41)) + +
+ +
+Behind the scenes + +- Every PR's APK published to DroidDeck-CI (@maxjivi05, #3), with signed builds gated on review (@xXJSONDeruloXx, #5) +- Local builds matching CI, and a debug-only ADB agent bridge (@xXJSONDeruloXx, [legacy#5](https://github.com/The412Banner/DroidDeck/pull/5), [legacy#35](https://github.com/The412Banner/DroidDeck/pull/35), #7, #20) +- CI hardening, branch protection and copy clean-ups (@The412Banner, @xXJSONDeruloXx, [legacy#8](https://github.com/The412Banner/DroidDeck/pull/8), [legacy#10](https://github.com/The412Banner/DroidDeck/pull/10), [legacy#41](https://github.com/The412Banner/DroidDeck/pull/41), #8) + +
+ +--- + +**Built on** WinNative by @maxjivi05 (the gamescope runtime, proot session and input interposer), Winlator by brunodev85 (audio and gamepad model), Bannerlator by @The412Banner (file manager, first sign-in flow), lsfg-vk by PancakeTAS, MangoHud by flightlessmango, and Vauzi's Adreno 710/720/722 device entries. + +Not affiliated with Valve. Steam, Proton and Steam Deck are Valve's; the client and Proton are fetched from Valve's servers on your device. + +**Contributors:** @The412Banner, @xXJSONDeruloXx, @maxjivi05 diff --git a/docs/releases/media/0.2.0/big-picture.jpg b/docs/releases/media/0.2.0/big-picture.jpg new file mode 100644 index 0000000000..5c7bf89610 Binary files /dev/null and b/docs/releases/media/0.2.0/big-picture.jpg differ diff --git a/docs/releases/media/0.2.0/burnout-paradise.jpg b/docs/releases/media/0.2.0/burnout-paradise.jpg new file mode 100644 index 0000000000..00d082db40 Binary files /dev/null and b/docs/releases/media/0.2.0/burnout-paradise.jpg differ diff --git a/docs/releases/media/0.2.0/components.jpg b/docs/releases/media/0.2.0/components.jpg new file mode 100644 index 0000000000..c044fd6be5 Binary files /dev/null and b/docs/releases/media/0.2.0/components.jpg differ diff --git a/docs/releases/media/0.2.0/controller-editor.jpg b/docs/releases/media/0.2.0/controller-editor.jpg new file mode 100644 index 0000000000..14dd9a2267 Binary files /dev/null and b/docs/releases/media/0.2.0/controller-editor.jpg differ diff --git a/docs/releases/media/0.2.0/desktop-apps.jpg b/docs/releases/media/0.2.0/desktop-apps.jpg new file mode 100644 index 0000000000..1dc0d018ce Binary files /dev/null and b/docs/releases/media/0.2.0/desktop-apps.jpg differ diff --git a/docs/releases/media/0.2.0/drawer-components.jpg b/docs/releases/media/0.2.0/drawer-components.jpg new file mode 100644 index 0000000000..33a12142b5 Binary files /dev/null and b/docs/releases/media/0.2.0/drawer-components.jpg differ diff --git a/docs/releases/media/0.2.0/drawer-display.jpg b/docs/releases/media/0.2.0/drawer-display.jpg new file mode 100644 index 0000000000..543cd72275 Binary files /dev/null and b/docs/releases/media/0.2.0/drawer-display.jpg differ diff --git a/docs/releases/media/0.2.0/launch-into-steam.gif b/docs/releases/media/0.2.0/launch-into-steam.gif new file mode 100644 index 0000000000..ecddf2d284 Binary files /dev/null and b/docs/releases/media/0.2.0/launch-into-steam.gif differ diff --git a/docs/releases/media/0.2.0/launch-to-desktop.gif b/docs/releases/media/0.2.0/launch-to-desktop.gif new file mode 100644 index 0000000000..59e2e50999 Binary files /dev/null and b/docs/releases/media/0.2.0/launch-to-desktop.gif differ diff --git a/docs/releases/media/0.2.0/launcher-games.jpg b/docs/releases/media/0.2.0/launcher-games.jpg new file mode 100644 index 0000000000..27fad9cdff Binary files /dev/null and b/docs/releases/media/0.2.0/launcher-games.jpg differ diff --git a/docs/releases/media/0.2.0/launcher-steam.jpg b/docs/releases/media/0.2.0/launcher-steam.jpg new file mode 100644 index 0000000000..8cb34ae651 Binary files /dev/null and b/docs/releases/media/0.2.0/launcher-steam.jpg differ diff --git a/docs/releases/media/0.2.0/linux-desktop.jpg b/docs/releases/media/0.2.0/linux-desktop.jpg new file mode 100644 index 0000000000..db70bc23b6 Binary files /dev/null and b/docs/releases/media/0.2.0/linux-desktop.jpg differ diff --git a/docs/releases/media/0.2.0/session-drawer.gif b/docs/releases/media/0.2.0/session-drawer.gif new file mode 100644 index 0000000000..d8f0641706 Binary files /dev/null and b/docs/releases/media/0.2.0/session-drawer.gif differ diff --git a/tools/build_local.sh b/tools/build_local.sh index 6673e469c6..a7a0d4d677 100755 --- a/tools/build_local.sh +++ b/tools/build_local.sh @@ -41,7 +41,8 @@ fi ndk_version=${DROIDDECK_NDK_VERSION:-} if [[ -z "${ndk_version}" ]]; then - ndk_path=$(find "${sdk_dir}/ndk" -mindepth 1 -maxdepth 1 -type d -print | sort -V | tail -1) + # Only complete NDKs: an interrupted sdkmanager install leaves a directory without source.properties. + ndk_path=$(find "${sdk_dir}/ndk" -mindepth 2 -maxdepth 2 -name source.properties -print | xargs -n1 dirname | sort -V | tail -1) ndk_version=${ndk_path##*/} fi if [[ -z "${ndk_version}" || ! -d "${sdk_dir}/ndk/${ndk_version}" ]]; then