This commit is contained in:
ponzischeme89
2026-08-21 10:38:41 +12:00
parent 5467fba0eb
commit af1ca4370c
9 changed files with 107 additions and 15 deletions
+3 -2
View File
@@ -1,3 +1,4 @@
import com.android.build.api.dsl.ApplicationExtension
import java.util.Properties
plugins {
@@ -63,7 +64,7 @@ val projectNoticeText =
// A release workflow can derive the app version from its Git tag without editing the
// source tree. Local builds keep using the checked-in default.
val defaultVersionName = "0.2.84"
val defaultVersionName = "0.2.85"
val membyVersionName: String =
(project.findProperty("memby.versionName") as String?)
?.trim()
@@ -95,7 +96,7 @@ fun environmentSecret(key: String): String? {
return System.getenv(key)?.trim()?.takeIf { it.isNotEmpty() }
}
android {
extensions.configure<ApplicationExtension> {
namespace = "com.ponzischeme89.memby"
// Raised to 37 by the Lifecycle 2.11 / Activity 1.13 upgrade, which refuse to be
// consumed by a project compiled against anything older. This is a *compile* target
@@ -1687,7 +1687,7 @@ internal fun MediaRow(
onVerticalFocusRequestConsumed: (Int) -> Unit,
onMoveVertical: (itemIndex: Int, direction: RowFocusDirection) -> Boolean,
onContentFocused: () -> Unit,
onItemFocused: (BaseItem) -> Unit,
onItemFocused: (item: BaseItem, itemIndex: Int) -> Unit,
onItemSelected: (BaseItem) -> Unit,
onItemLongPressed: (BaseItem) -> Unit,
density: String = "standard",
@@ -1840,7 +1840,9 @@ internal fun MediaRow(
}
val focused: () -> Unit = {
onContentFocused()
onItemFocused(item)
// LazyRow already knows the semantic position. Passing it on
// avoids searching the row again on every D-pad focus move.
onItemFocused(item, index)
}
val format = cardFormat(row.kind, item, artworkStyle)
if (row.kind == MediaRowKind.CONTINUE) {
@@ -1593,9 +1593,8 @@ internal fun HomeScreen(
true
},
onContentFocused = { navigationExpanded = false },
onItemFocused = { item ->
val itemIndex = row.items.indexOfFirst { it.id == item.id }
if (itemIndex >= 0) rowFocusPositions[row.id] = itemIndex
onItemFocused = { item, itemIndex ->
rowFocusPositions[row.id] = itemIndex
rowFocusedBelowHero = true
if (selectedDestination == BrowseDestination.HOME) {
focusedHomeRowId = row.id
@@ -77,7 +77,7 @@ internal object LaunchIntro {
* - **The player is returned, not released.** It goes back to the process cache on dispose,
* which is what lets the very next playback still open on a prepared instance.
*/
@OptIn(UnstableApi::class)
@androidx.annotation.OptIn(markerClass = [UnstableApi::class])
@Composable
internal fun LaunchPrerollVideo(
modifier: Modifier = Modifier,
@@ -19,7 +19,7 @@ import com.ponzischeme89.memby.R
* sought back to the beginning and prepared again after use rather than reconstructed for
* every title.
*/
@OptIn(UnstableApi::class)
@androidx.annotation.OptIn(markerClass = [UnstableApi::class])
internal object PrerollPreloader {
private val mainHandler = Handler(Looper.getMainLooper())
private var applicationContext: Context? = null
@@ -1,6 +1,7 @@
package com.ponzischeme89.memby.ui
import com.ponzischeme89.memby.data.HomeCache
import com.ponzischeme89.memby.data.PlaybackPosition
import com.ponzischeme89.memby.data.model.BaseItem
import com.ponzischeme89.memby.data.model.HomeRow
import com.ponzischeme89.memby.data.model.UserItemData
@@ -36,8 +36,8 @@ class ResumableMediaCardTest {
@Test
fun finishTimeUsesRemainingRuntime() {
val now = 1_000_000L
val runtime = 60L * 60L * TICKS_PER_MILLISECOND_FOR_TEST
val position = 15L * 60L * TICKS_PER_MILLISECOND_FOR_TEST
val runtime = 60L * 60L * MILLIS_PER_SECOND * TICKS_PER_MILLISECOND_FOR_TEST
val position = 15L * 60L * MILLIS_PER_SECOND * TICKS_PER_MILLISECOND_FOR_TEST
assertEquals(
now + 45L * 60L * 1_000L,
@@ -61,6 +61,7 @@ class ResumableMediaCardTest {
}
private companion object {
const val MILLIS_PER_SECOND = 1_000L
const val TICKS_PER_MILLISECOND_FOR_TEST = 10_000L
}
}