Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
198 commits
Select commit Hold shift + click to select a range
01aa6d9
Update build.gradle.kts
SunnyVishnu3 Mar 6, 2026
b75752c
Create LiquidUIPreferences.kt
SunnyVishnu3 Mar 6, 2026
0d87afa
Create LiquidUIEffects.kt
SunnyVishnu3 Mar 6, 2026
43c1f66
Update LiquidUIEffects.kt
SunnyVishnu3 Mar 6, 2026
814a384
Update build.yml
SunnyVishnu3 Mar 6, 2026
8294518
Update build.yml
SunnyVishnu3 Mar 6, 2026
706e376
Update LiquidUIPreferences.kt
SunnyVishnu3 Mar 6, 2026
0a3d051
Create LiquidComponents.kt
SunnyVishnu3 Mar 6, 2026
18553ec
Update LiquidUIEffects.kt
SunnyVishnu3 Mar 7, 2026
64b5299
Update LiquidUIPreferences.kt
SunnyVishnu3 Mar 7, 2026
84ee0c4
Delete app/src/main/java/app/marlboroadvance/mpvex/ui/components/liqu…
SunnyVishnu3 Mar 7, 2026
ea66246
Update LiquidUIEffects.kt
SunnyVishnu3 Mar 7, 2026
7ceee9a
Update LiquidUIEffects.kt
SunnyVishnu3 Mar 7, 2026
493a0b0
Create LiquidPlayerControls.kt
SunnyVishnu3 Mar 7, 2026
8aecc70
Create LiquidComponents.kt
SunnyVishnu3 Mar 7, 2026
34339f8
add more liquid codes
SunnyVishnu3 Mar 7, 2026
2f2fb1e
Merge branch 'marlboro-advance:master' into Liquid
SunnyVishnu3 Mar 7, 2026
afebe5a
Create LiquidUISettingsScreen.kt
SunnyVishnu3 Mar 7, 2026
d346c12
Update LiquidUISettingsScreen.kt
SunnyVishnu3 Mar 7, 2026
19d863b
Update LiquidUIToggle.kt
SunnyVishnu3 Mar 7, 2026
3c3bb86
Update PlayerControls.kt
SunnyVishnu3 Mar 7, 2026
d913cd5
Update PlayerControls.kt
SunnyVishnu3 Mar 7, 2026
6cd7eb0
Update PlayerControls.kt
SunnyVishnu3 Mar 7, 2026
8bbee59
Update AppearancePreferencesScreen.kt
SunnyVishnu3 Mar 7, 2026
9cdcb78
Update AppearancePreferencesScreen.kt
SunnyVishnu3 Mar 7, 2026
f4971f9
Update FileSystemBrowserScreen.kt
SunnyVishnu3 Mar 7, 2026
f944dbc
Update FileSystemBrowserScreen.kt
SunnyVishnu3 Mar 7, 2026
8e26eec
Update FileSystemBrowserScreen.kt
SunnyVishnu3 Mar 7, 2026
857fc12
Update FileSystemBrowserScreen.kt
SunnyVishnu3 Mar 7, 2026
581b169
Update LiquidComponents.kt
SunnyVishnu3 Mar 7, 2026
39c1a9b
Update LiquidComponents.kt
SunnyVishnu3 Mar 7, 2026
16beeff
Update LiquidComponents.kt
SunnyVishnu3 Mar 7, 2026
1bf01a4
Update LiquidComponents.kt
SunnyVishnu3 Mar 7, 2026
4199eea
Update LiquidUIPreferences.kt
SunnyVishnu3 Mar 7, 2026
76280c0
Update LiquidUIToggle.kt
SunnyVishnu3 Mar 7, 2026
39b56b6
Update LiquidUISettingsScreen.kt
SunnyVishnu3 Mar 7, 2026
a8f90e2
Update LiquidUIToggle.kt
SunnyVishnu3 Mar 7, 2026
c1aed50
Update LiquidUISettingsScreen.kt
SunnyVishnu3 Mar 7, 2026
f5d720c
Update AppearancePreferencesScreen.kt
SunnyVishnu3 Mar 7, 2026
8af4ffc
Update AppearancePreferencesScreen.kt
SunnyVishnu3 Mar 7, 2026
a8a9fae
Update LiquidUIToggle.kt
SunnyVishnu3 Mar 7, 2026
46482fd
Update LiquidUIToggle.kt
SunnyVishnu3 Mar 7, 2026
4592ec3
Update LiquidUIToggle.kt
SunnyVishnu3 Mar 7, 2026
1c99b49
Update AppearancePreferencesScreen.kt
SunnyVishnu3 Mar 7, 2026
2cebfd1
Update LiquidUIToggle.kt
SunnyVishnu3 Mar 7, 2026
895609e
Update LiquidUIToggle.kt
SunnyVishnu3 Mar 7, 2026
8c67871
Update LiquidUIToggle.kt
SunnyVishnu3 Mar 7, 2026
6431511
Create LiquidSwitchPreference.kt
SunnyVishnu3 Mar 7, 2026
032254a
Update LiquidUIToggle.kt
SunnyVishnu3 Mar 7, 2026
abc83a1
Update LiquidSwitchPreference.kt
SunnyVishnu3 Mar 7, 2026
263dec8
Update AppearancePreferencesScreen.kt
SunnyVishnu3 Mar 7, 2026
35ecf4b
Update AppearancePreferencesScreen.kt
SunnyVishnu3 Mar 7, 2026
db22d2d
Update AppearancePreferencesScreen.kt
SunnyVishnu3 Mar 7, 2026
c656a38
Update AppearancePreferencesScreen.kt
SunnyVishnu3 Mar 7, 2026
efea1bc
Update AppearancePreferencesScreen.kt
SunnyVishnu3 Mar 7, 2026
757a171
Merge branch 'marlboro-advance:master' into Liquid
SunnyVishnu3 Mar 7, 2026
37ae65a
Update LiquidUIToggle.kt
SunnyVishnu3 Mar 7, 2026
e896859
Update AppearancePreferencesScreen.kt
SunnyVishnu3 Mar 7, 2026
3a905ba
Update SubtitleSettingsMiscellaneousCard.kt
SunnyVishnu3 Mar 7, 2026
d0160ad
Update PlaybackSpeedSheet.kt
SunnyVishnu3 Mar 7, 2026
014f5ab
Update AdvancedPreferencesScreen.kt
SunnyVishnu3 Mar 7, 2026
b2cfc0d
Update AudioPreferencesScreen.kt
SunnyVishnu3 Mar 7, 2026
c338b25
Update DecoderPreferencesScreen.kt
SunnyVishnu3 Mar 7, 2026
50a81ee
Update GesturePreferencesScreen.kt
SunnyVishnu3 Mar 7, 2026
3e763d3
Update PlayerControlsPreferencesScreen.kt
SunnyVishnu3 Mar 7, 2026
2bd9b6d
Update PlayerPreferencesScreen.kt
SunnyVishnu3 Mar 7, 2026
7b59b56
Update SubtitlesPreferencesScreen.kt
SunnyVishnu3 Mar 7, 2026
44c3e79
Update AppearancePreferencesScreen.kt
SunnyVishnu3 Mar 7, 2026
2107d5f
Update Seekbar.kt
SunnyVishnu3 Mar 7, 2026
cff0300
Update SeekbarStyle.kt
SunnyVishnu3 Mar 8, 2026
5d7ac65
Update SeekbarStyle.kt
SunnyVishnu3 Mar 8, 2026
a3e5ff1
Update Seekbar.kt
SunnyVishnu3 Mar 8, 2026
8e6ba95
Update Seekbar.kt
SunnyVishnu3 Mar 8, 2026
fec1ac2
Update Seekbar.kt
SunnyVishnu3 Mar 8, 2026
95c4dda
Update Seekbar.kt
SunnyVishnu3 Mar 8, 2026
29476f0
Update Seekbar.kt
SunnyVishnu3 Mar 8, 2026
29f80d7
Update Seekbar.kt
SunnyVishnu3 Mar 8, 2026
ed375f8
Update build.gradle.kts
SunnyVishnu3 Mar 8, 2026
ec1daf8
Update Seekbar.kt
SunnyVishnu3 Mar 8, 2026
15ffd37
Update Seekbar.kt
SunnyVishnu3 Mar 8, 2026
f1294df
Update Seekbar.kt
SunnyVishnu3 Mar 8, 2026
e79132b
Update Seekbar.kt
SunnyVishnu3 Mar 8, 2026
e2302a4
Update MainScreen.kt
SunnyVishnu3 Mar 8, 2026
19eb1ff
Create LiquidGlassSurface.kt
SunnyVishnu3 Mar 8, 2026
1b1fb81
Update FloatingBottomBar.kt
SunnyVishnu3 Mar 8, 2026
7d8bc14
Update FloatingBottomBar.kt
SunnyVishnu3 Mar 8, 2026
b35c844
Update MainScreen.kt
SunnyVishnu3 Mar 8, 2026
c99cb52
Merge branch 'marlboro-advance:master' into Liquid
SunnyVishnu3 Mar 8, 2026
3f4cee8
Update VideoListScreen.kt
SunnyVishnu3 Mar 8, 2026
809f209
Update VideoListScreen.kt
SunnyVishnu3 Mar 8, 2026
e4ff3ca
Update FileSystemBrowserScreen.kt
SunnyVishnu3 Mar 8, 2026
e282581
Update VideoListScreen.kt
SunnyVishnu3 Mar 8, 2026
379fe77
Update VideoListScreen.kt
SunnyVishnu3 Mar 8, 2026
9c59242
Update FileSystemBrowserScreen.kt
SunnyVishnu3 Mar 8, 2026
59367e8
Update VideoListScreen.kt
SunnyVishnu3 Mar 8, 2026
ebfc10c
Update FloatingBottomBar.kt
SunnyVishnu3 Mar 8, 2026
3de607b
Update FloatingBottomBar.kt
SunnyVishnu3 Mar 8, 2026
f73de4a
Update RecentlyPlayedScreen.kt
SunnyVishnu3 Mar 8, 2026
ba92321
Update VideoListScreen.kt
SunnyVishnu3 Mar 8, 2026
4d7393e
Update VideoListScreen.kt
SunnyVishnu3 Mar 8, 2026
b0117d7
Update VideoListScreen.kt
SunnyVishnu3 Mar 8, 2026
e7738c0
Update VideoListScreen.kt
SunnyVishnu3 Mar 8, 2026
1228711
Update FileSystemBrowserScreen.kt
SunnyVishnu3 Mar 8, 2026
d5314f2
Update FileSystemBrowserScreen.kt
SunnyVishnu3 Mar 8, 2026
e7c740c
Update FileSystemBrowserScreen.kt
SunnyVishnu3 Mar 8, 2026
0578fb5
Update LiquidUIPreferences.kt
SunnyVishnu3 Mar 8, 2026
1fdd09d
Update AppearancePreferencesScreen.kt
SunnyVishnu3 Mar 8, 2026
375038b
Update LiquidGlassSurface.kt
SunnyVishnu3 Mar 8, 2026
96ba195
Update LiquidUIPreferences.kt
SunnyVishnu3 Mar 8, 2026
7507a8b
Update AppearancePreferencesScreen.kt
SunnyVishnu3 Mar 8, 2026
7069973
Update LiquidUIPreferences.kt
SunnyVishnu3 Mar 8, 2026
d921a39
Update Seekbar.kt
SunnyVishnu3 Mar 8, 2026
392787a
Update Seekbar.kt
SunnyVishnu3 Mar 8, 2026
497d305
Update Seekbar.kt
SunnyVishnu3 Mar 8, 2026
81f5e64
Update Seekbar.kt
SunnyVishnu3 Mar 8, 2026
2c3b7f2
Update Seekbar.kt
SunnyVishnu3 Mar 8, 2026
c72be10
Update Seekbar.kt
SunnyVishnu3 Mar 8, 2026
e3b6806
Update Seekbar.kt
SunnyVishnu3 Mar 8, 2026
e3b59df
Update Seekbar.kt
SunnyVishnu3 Mar 8, 2026
cee909b
Update Seekbar.kt
SunnyVishnu3 Mar 8, 2026
8703f51
Update Seekbar.kt
SunnyVishnu3 Mar 9, 2026
12c7ddd
Update Seekbar.kt
SunnyVishnu3 Mar 9, 2026
12202ed
Update Seekbar.kt
SunnyVishnu3 Mar 9, 2026
2e10f7c
Update Seekbar.kt
SunnyVishnu3 Mar 9, 2026
96f42a4
Update Seekbar.kt
SunnyVishnu3 Mar 9, 2026
da5b909
Update Seekbar.kt
SunnyVishnu3 Mar 9, 2026
6431480
Update Seekbar.kt
SunnyVishnu3 Mar 9, 2026
08369a9
Update Seekbar.kt
SunnyVishnu3 Mar 9, 2026
90ea14d
Update Seekbar.kt
SunnyVishnu3 Mar 9, 2026
217d478
Update Seekbar.kt
SunnyVishnu3 Mar 9, 2026
2412133
Update Seekbar.kt
SunnyVishnu3 Mar 9, 2026
2a00171
Update Seekbar.kt
SunnyVishnu3 Mar 9, 2026
3b9159d
Update Seekbar.kt
SunnyVishnu3 Mar 9, 2026
e3bc077
Update LiquidUIToggle.kt
SunnyVishnu3 Mar 9, 2026
436a8d2
Update LiquidUIPreferences.kt
SunnyVishnu3 Mar 9, 2026
a9b4d27
Update LiquidGlassSurface.kt
SunnyVishnu3 Mar 9, 2026
063c11d
Update AppearancePreferencesScreen.kt
SunnyVishnu3 Mar 9, 2026
e982c79
Update AppearancePreferencesScreen.kt
SunnyVishnu3 Mar 9, 2026
75fb6d3
Update LiquidUIPreferences.kt
SunnyVishnu3 Mar 9, 2026
e9a3197
Update LiquidComponents.kt
SunnyVishnu3 Mar 9, 2026
87f0181
Update PlayerControls.kt
SunnyVishnu3 Mar 9, 2026
6546299
Update PlayerControls.kt
SunnyVishnu3 Mar 9, 2026
eb6550c
Update PlayerControls.kt
SunnyVishnu3 Mar 9, 2026
2d934d3
Update LiquidComponents.kt
SunnyVishnu3 Mar 9, 2026
baa0dcd
Update LiquidComponents.kt
SunnyVishnu3 Mar 9, 2026
a8984e3
Update LiquidComponents.kt
SunnyVishnu3 Mar 9, 2026
988f4cc
Update LiquidComponents.kt
SunnyVishnu3 Mar 9, 2026
5f30aad
Update LiquidComponents.kt
SunnyVishnu3 Mar 9, 2026
37a0e3d
Update PlayerControls.kt
SunnyVishnu3 Mar 9, 2026
ba86eb7
Update ControlsButton.kt
SunnyVishnu3 Mar 9, 2026
09bfcd4
Update LiquidComponents.kt
SunnyVishnu3 Mar 9, 2026
9198ac6
Update PlayerControls.kt
SunnyVishnu3 Mar 9, 2026
515fec8
Update ControlsButton.kt
SunnyVishnu3 Mar 9, 2026
59bcf35
Update ControlsButton.kt
SunnyVishnu3 Mar 9, 2026
e1bb053
Update PlayerControls.kt
SunnyVishnu3 Mar 9, 2026
12920a3
Update LiquidComponents.kt
SunnyVishnu3 Mar 9, 2026
51689c2
Update LiquidComponents.kt
SunnyVishnu3 Mar 9, 2026
4a6b90c
Update PlayerUpdates.kt
SunnyVishnu3 Mar 10, 2026
073fa95
Update SpeedControlSlider.kt
SunnyVishnu3 Mar 10, 2026
3178473
Update CurrentChapter.kt
SunnyVishnu3 Mar 10, 2026
d3ed86e
Update SlideToUnlock.kt
SunnyVishnu3 Mar 10, 2026
3626600
Update PlayerControlsShared.kt
SunnyVishnu3 Mar 10, 2026
71c1c75
Update VerticalSliders.kt
SunnyVishnu3 Mar 10, 2026
98fca22
Update LiquidComponents.kt
SunnyVishnu3 Mar 10, 2026
7c934ed
Update SlideToUnlock.kt
SunnyVishnu3 Mar 10, 2026
1bf7b0a
Update SlideToUnlock.kt
SunnyVishnu3 Mar 10, 2026
25fe66f
Update SlideToUnlock.kt
SunnyVishnu3 Mar 10, 2026
cd9f1ac
Update PlayerUpdates.kt
SunnyVishnu3 Mar 10, 2026
a2b13b2
Update PlayerUpdates.kt
SunnyVishnu3 Mar 10, 2026
c59540e
Update LiquidComponents.kt
SunnyVishnu3 Mar 10, 2026
d9f1cf1
Update PlayerControlsShared.kt
SunnyVishnu3 Mar 10, 2026
ad79255
Update PlayerControlsShared.kt
SunnyVishnu3 Mar 10, 2026
edb00f0
Enhance player functionality with ambient mode improvements and fixes…
SunnyVishnu3 Mar 10, 2026
9bd93cb
Merge
SunnyVishnu3 Mar 10, 2026
305bd9d
Update PlayerControlsShared.kt
SunnyVishnu3 Mar 10, 2026
3140f26
Update PlayerControlsShared.kt
SunnyVishnu3 Mar 10, 2026
2bd35df
Update VerticalSliders.kt
SunnyVishnu3 Mar 10, 2026
e935046
Update PlayerControlsShared.kt
SunnyVishnu3 Mar 10, 2026
d2afc09
Update DraggablePanel.kt
SunnyVishnu3 Mar 10, 2026
026c2e7
Update PlayerSheet.kt
SunnyVishnu3 Mar 10, 2026
9f84457
Update PlayerPanels.kt
SunnyVishnu3 Mar 10, 2026
68b043d
Create LiquidAlertDialog.kt
SunnyVishnu3 Mar 10, 2026
5c84f65
Create LiquidCard.kt
SunnyVishnu3 Mar 10, 2026
80dc0f2
Update MainActivity.kt
SunnyVishnu3 Mar 10, 2026
eedc588
Update MainActivity.kt
SunnyVishnu3 Mar 10, 2026
c584e6d
Update MainActivity.kt
SunnyVishnu3 Mar 10, 2026
9aa1b06
Update MainActivity.kt
SunnyVishnu3 Mar 10, 2026
97a19ff
Update MainActivity.kt
SunnyVishnu3 Mar 10, 2026
048e0bb
Update LiquidUIPreferences.kt
SunnyVishnu3 Mar 10, 2026
0a57a2b
Update LiquidUIPreferences.kt
SunnyVishnu3 Mar 10, 2026
e9e3399
Update LiquidUIPreferences.kt
SunnyVishnu3 Mar 10, 2026
c0dfecb
Update LiquidCard.kt
SunnyVishnu3 Mar 10, 2026
db809d3
Update LiquidCard.kt
SunnyVishnu3 Mar 10, 2026
7e994f1
Update AppearancePreferencesScreen.kt
SunnyVishnu3 Mar 10, 2026
be08fbe
Liquid (#10)
Graywizard888 May 2, 2026
9e9bf4a
Merge branch 'Test' into Liquid
SunnyVishnu3 May 2, 2026
d2816b3
Refactor PlayerControls with code cleanup and fixes
SunnyVishnu3 May 2, 2026
37c4605
Refactor SectionHeaderWithInfo component
SunnyVishnu3 May 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ android {
applicationId = "app.marlboroadvance.mpvex"
minSdk = 26
targetSdk = 36
versionCode = 128
versionCode = 129
versionName = "1.2.9"

vectorDrawables {
Expand Down Expand Up @@ -237,6 +237,17 @@ dependencies {
implementation(libs.nanohttpd)
implementation(libs.lazycolumnscrollbar)
implementation(libs.reorderable)

// LIQUID GLASS DEPENDENCIES
// AndroidLiquidGlass 2.0.0-alpha03 (Contains the advanced lens effects)
implementation("io.github.kyant0:backdrop:2.0.0-alpha03")

// SHAPES LIBRARY 1.2.0 (MINIMUM REQUIRED for G2 continuous curves)
implementation("io.github.kyant0:shapes:1.2.0")

// DataStore for preferences persistence (To toggle the UI on/off)
implementation("androidx.datastore:datastore-preferences:1.0.0")
implementation("androidx.graphics:graphics-core:1.0.4")
}

/* ---------------- Git helpers ---------------- */
Expand Down
47 changes: 22 additions & 25 deletions app/src/main/java/app/marlboroadvance/mpvex/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.TransformOrigin
import androidx.compose.ui.graphics.toArgb
Expand Down Expand Up @@ -50,17 +51,20 @@ import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.withContext
import org.koin.android.ext.android.inject

// --- NEW LIQUID IMPORTS ---
import com.kyant.backdrop.backdrops.layerBackdrop
import com.kyant.backdrop.backdrops.rememberLayerBackdrop
import app.marlboroadvance.mpvex.ui.components.liquid.LocalLiquidBackdrop

/**
* Main entry point for the application
*/
class MainActivity : ComponentActivity() {
private val appearancePreferences by inject<AppearancePreferences>()
private val networkRepository by inject<NetworkRepository>()

// Create a coroutine scope tied to the activity lifecycle
private val activityScope = CoroutineScope(SupervisorJob() + Dispatchers.Main)

// Register the ActivityResultLauncher at class level
private val mediaAccessLauncher = registerForActivityResult(
ActivityResultContracts.StartIntentSenderForResult()
) { result ->
Expand All @@ -72,11 +76,9 @@ class MainActivity : ComponentActivity() {

PermissionUtils.setMediaAccessLauncher(mediaAccessLauncher)

// Register proxy lifecycle observer for network streaming
lifecycle.addObserver(app.marlboroadvance.mpvex.ui.browser.networkstreaming.proxy.ProxyLifecycleObserver())

setContent {
// Set up theme and edge-to-edge display
val dark by appearancePreferences.darkMode.collectAsState()
val isSystemInDarkTheme = isSystemInDarkTheme()
val isDarkMode = dark == DarkMode.Dark || (dark == DarkMode.System && isSystemInDarkTheme)
Expand All @@ -87,14 +89,20 @@ class MainActivity : ComponentActivity() {
) { isDarkMode },
)

// Auto-connect to saved network connections
LaunchedEffect(Unit) {
autoConnectToNetworks()
}

MpvexTheme {
// Correct initialization of the backdrop engine
val backdrop = rememberLayerBackdrop()

Surface {
Navigator()
CompositionLocalProvider(
LocalLiquidBackdrop provides backdrop
) {
Navigator()
}
}
}
}
Expand All @@ -108,14 +116,9 @@ class MainActivity : ComponentActivity() {
}
}

/**
* Auto-connect to network connections that are marked for auto-connection
*/
private suspend fun autoConnectToNetworks() {
// Delay auto-connect to let UI settle first
kotlinx.coroutines.delay(500)

// Use coroutineScope for properly structured concurrency
withContext(Dispatchers.IO) {
try {
val autoConnectConnections = networkRepository.getAutoConnectConnections()
Expand All @@ -137,15 +140,12 @@ class MainActivity : ComponentActivity() {
}
} catch (e: Exception) {
withContext(Dispatchers.Main) {
Log.e("MainActivity", "Error during auto-connect", e)
Log.e("MainActivity", "Error during auto-connect", e)
}
}
}
}

/**
* Navigator that handles screen transitions and provides shared states
*/
@Composable
fun Navigator() {
val backstack = rememberNavBackStack(MainScreen)
Expand All @@ -156,7 +156,6 @@ class MainActivity : ComponentActivity() {
val context = LocalContext.current
val currentVersion = BuildConfig.VERSION_NAME.replace("-dev", "")

// Conditionally initialize update feature based on build config
val updateViewModel: UpdateViewModel? = if (BuildConfig.ENABLE_UPDATE_FEATURE) {
viewModel(context as ComponentActivity)
} else {
Expand All @@ -166,7 +165,6 @@ class MainActivity : ComponentActivity() {
val isDownloading by (updateViewModel?.isDownloading ?: MutableStateFlow(false)).collectAsState()
val downloadProgress by (updateViewModel?.downloadProgress ?: MutableStateFlow(0f)).collectAsState()

// Provide both LocalBackStack and the LazyList/Grid states to all screens
CompositionLocalProvider(
LocalBackStack provides typedBackstack
) {
Expand All @@ -186,35 +184,34 @@ class MainActivity : ComponentActivity() {
transitionSpec = {
(
fadeIn(animationSpec = tween(220)) +
slideIn(animationSpec = tween(220)) { IntOffset(it.width / 2, 0) }
slideIn(animationSpec = tween(220)) { IntOffset(it.width / 2, 0) }
) togetherWith (
fadeOut(animationSpec = tween(220)) +
slideOut(animationSpec = tween(220)) { IntOffset(-it.width / 2, 0) }
)
},
predictivePopTransitionSpec = {
(
(
fadeIn(animationSpec = tween(220)) +
scaleIn(
animationSpec = tween(220, delayMillis = 30),
initialScale = .9f,
TransformOrigin(-1f, .5f),
)
)
) togetherWith (
fadeOut(animationSpec = tween(220)) +
scaleOut(
animationSpec = tween(220, delayMillis = 30),
targetScale = .9f,
TransformOrigin(-1f, .5f),
TransformOrigin(-1f, .5f),
)
)
},
)

// Display Update Dialog when appropriate (only if update feature is enabled)
if (BuildConfig.ENABLE_UPDATE_FEATURE && updateViewModel != null) {
when (updateState) {
is UpdateViewModel.UpdateState.Available -> {
is UpdateViewModel.UpdateState.Available -> {
val release = (updateState as UpdateViewModel.UpdateState.Available).release
UpdateDialog(
release = release,
Expand All @@ -227,7 +224,7 @@ class MainActivity : ComponentActivity() {
onIgnore = { updateViewModel.ignoreVersion(release.tagName.removePrefix("v")) }
)
}
is UpdateViewModel.UpdateState.ReadyToInstall -> {
is UpdateViewModel.UpdateState.ReadyToInstall -> {
val release = (updateState as UpdateViewModel.UpdateState.ReadyToInstall).release
UpdateDialog(
release = release,
Expand All @@ -240,7 +237,7 @@ class MainActivity : ComponentActivity() {
onIgnore = { updateViewModel.ignoreVersion(release.tagName.removePrefix("v")) }
)
}
else -> {}
else -> {}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package app.marlboroadvance.mpvex.preferences

import android.content.Context
import androidx.datastore.preferences.core.booleanPreferencesKey
import androidx.datastore.preferences.core.floatPreferencesKey
import androidx.datastore.preferences.core.longPreferencesKey
import androidx.datastore.preferences.core.edit
import androidx.datastore.preferences.preferencesDataStore
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map

private val Context.liquidUIDataStore by preferencesDataStore(name = "liquid_ui_prefs")

// --- THE TARGET ENUM ---
// Adding CARD here automatically generates the entire UI tab in AppearancePreferencesScreen!
enum class LiquidTarget(val id: String, val title: String) {
NAV("nav", "Navigation"),
BUTTON("btn", "Buttons"),
DIALOG("dlg", "Dialogs"),
CARD("card", "Browser Cards")
}

class LiquidUIPreferences(context: Context) {
private val dataStore = context.liquidUIDataStore

companion object {
val LIQUID_UI_ENABLED = booleanPreferencesKey("liquid_ui_enabled")
val LIQUID_TOGGLE_COLOR = longPreferencesKey("liquid_toggle_color")
val LIQUID_SLIDER_COLOR = longPreferencesKey("liquid_slider_color")

// Legacy Keys to prevent crashes in other screens
val LIQUID_BLUR_ENABLED = booleanPreferencesKey("liquid_blur_enabled")
val LIQUID_LENS_ENABLED = booleanPreferencesKey("liquid_lens_enabled")
val LIQUID_VIBRANCY_ENABLED_LEGACY = booleanPreferencesKey("liquid_vibrancy_enabled_legacy")
}

// Master Toggles
val liquidUIEnabledFlow: Flow<Boolean> = dataStore.data.map { it[LIQUID_UI_ENABLED] ?: false }
val liquidToggleColorFlow: Flow<Long> = dataStore.data.map { it[LIQUID_TOGGLE_COLOR] ?: 0xFF4CAF50 }
val liquidSliderColorFlow: Flow<Long> = dataStore.data.map { it[LIQUID_SLIDER_COLOR] ?: 0xFF2196F3 }

suspend fun setLiquidUIEnabled(enabled: Boolean) { dataStore.edit { it[LIQUID_UI_ENABLED] = enabled } }
suspend fun setToggleColor(color: Long) { dataStore.edit { it[LIQUID_TOGGLE_COLOR] = color } }
suspend fun setSliderColor(color: Long) { dataStore.edit { it[LIQUID_SLIDER_COLOR] = color } }

// --- DYNAMIC TARGET FLOWS ---
fun blurRadiusFlow(target: LiquidTarget): Flow<Float> = dataStore.data.map { it[floatPreferencesKey("${target.id}_blur")] ?: 0f }
fun refractionHeightFlow(target: LiquidTarget): Flow<Float> = dataStore.data.map { it[floatPreferencesKey("${target.id}_height")] ?: 40f }
fun refractionAmountFlow(target: LiquidTarget): Flow<Float> = dataStore.data.map { it[floatPreferencesKey("${target.id}_amount")] ?: 23f }
// CHANGED: default raised 0.15f → 0.5f. Old value let backdrop text bleed through navigation/dialog
// glass; 0.5f is the Backdrop docs' recommended balance of "glass look" vs. text readability.
fun tintAlphaFlow(target: LiquidTarget): Flow<Float> = dataStore.data.map { it[floatPreferencesKey("${target.id}_alpha")] ?: 0.5f }

fun chromaticAberrationFlow(target: LiquidTarget): Flow<Boolean> = dataStore.data.map { it[booleanPreferencesKey("${target.id}_chromatic")] ?: false }
fun depthEffectFlow(target: LiquidTarget): Flow<Boolean> = dataStore.data.map { it[booleanPreferencesKey("${target.id}_depth")] ?: true }
fun vibrancyEnabledFlow(target: LiquidTarget): Flow<Boolean> = dataStore.data.map { it[booleanPreferencesKey("${target.id}_vibrancy")] ?: true }

// --- DYNAMIC TARGET SETTERS ---
suspend fun setBlurRadius(target: LiquidTarget, value: Float) { dataStore.edit { it[floatPreferencesKey("${target.id}_blur")] = value } }
suspend fun setRefractionHeight(target: LiquidTarget, value: Float) { dataStore.edit { it[floatPreferencesKey("${target.id}_height")] = value } }
suspend fun setRefractionAmount(target: LiquidTarget, value: Float) { dataStore.edit { it[floatPreferencesKey("${target.id}_amount")] = value } }
suspend fun setTintAlpha(target: LiquidTarget, value: Float) { dataStore.edit { it[floatPreferencesKey("${target.id}_alpha")] = value } }

suspend fun setChromaticAberration(target: LiquidTarget, enabled: Boolean) { dataStore.edit { it[booleanPreferencesKey("${target.id}_chromatic")] = enabled } }
suspend fun setDepthEffect(target: LiquidTarget, enabled: Boolean) { dataStore.edit { it[booleanPreferencesKey("${target.id}_depth")] = enabled } }
suspend fun setVibrancyEnabled(target: LiquidTarget, enabled: Boolean) { dataStore.edit { it[booleanPreferencesKey("${target.id}_vibrancy")] = enabled } }

// --- LEGACY FALLBACKS (Keeps LiquidUISettingsScreen.kt from crashing!) ---
val liquidBlurEnabledFlow: Flow<Boolean> = dataStore.data.map { it[LIQUID_BLUR_ENABLED] ?: true }
val liquidLensEnabledFlow: Flow<Boolean> = dataStore.data.map { it[LIQUID_LENS_ENABLED] ?: true }
val liquidVibrancyEnabledFlow: Flow<Boolean> = dataStore.data.map { it[LIQUID_VIBRANCY_ENABLED_LEGACY] ?: true }

suspend fun setBlurEnabled(enabled: Boolean) { dataStore.edit { it[LIQUID_BLUR_ENABLED] = enabled } }
suspend fun setLensEnabled(enabled: Boolean) { dataStore.edit { it[LIQUID_LENS_ENABLED] = enabled } }

// This perfectly satisfies the old screen while leaving the new engine untouched!
suspend fun setVibrancyEnabled(enabled: Boolean) { dataStore.edit { it[LIQUID_VIBRANCY_ENABLED_LEGACY] = enabled } }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package app.marlboroadvance.mpvex.preferences

import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.ArrowBack
import androidx.compose.material.icons.automirrored.outlined.Segment
import androidx.compose.material.icons.outlined.AspectRatio
import androidx.compose.material.icons.outlined.Audiotrack
import androidx.compose.material.icons.outlined.Bookmarks
Expand All @@ -16,6 +17,7 @@ import androidx.compose.material.icons.outlined.Subtitles
import androidx.compose.material.icons.outlined.Title
import androidx.compose.material.icons.outlined.Flip
import androidx.compose.material.icons.outlined.Repeat
import androidx.compose.material.icons.outlined.Segment
import androidx.compose.material.icons.outlined.ZoomIn
import androidx.compose.material.icons.outlined.FastForward
import androidx.compose.material.icons.outlined.Shuffle
Expand Down Expand Up @@ -52,7 +54,7 @@ enum class PlayerButton(
SHUFFLE(Icons.Outlined.Shuffle),
MIRROR(Icons.Outlined.Flip),
VERTICAL_FLIP(Icons.Outlined.Flip),
AB_LOOP(Icons.Outlined.Repeat),
AB_LOOP(Icons.AutoMirrored.Outlined.Segment),
CUSTOM_SKIP(Icons.Outlined.FastForward),
BACKGROUND_PLAYBACK(Icons.Outlined.Headset),
AMBIENT_MODE(Icons.Outlined.BlurOn),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,6 @@ class PlayerPreferences(
val customButtons = preferenceStore.getString("custom_buttons_json", "[]")

// Ambience Mode
val ambientBlurSamples = preferenceStore.getInt("ambient_blur_samples", 24)
val ambientMaxRadius = preferenceStore.getFloat("ambient_max_radius", 0.18f)
val ambientGlowIntensity = preferenceStore.getFloat("ambient_glow_intensity", 1.4f)
val ambientSatBoost = preferenceStore.getFloat("ambient_sat_boost", 1.2f)
val ambientDitherNoise = preferenceStore.getFloat("ambient_dither_noise", 0.0f)
val ambientBezelDepth = preferenceStore.getFloat("ambient_bezel_depth", 0.0f)
val ambientVignetteStrength = preferenceStore.getFloat("ambient_vignette_strength", 0.5f)
val ambientWarmth = preferenceStore.getFloat("ambient_warmth", 0.0f)
val ambientEdgeSmooth = preferenceStore.getFloat("ambient_edge_smooth", 0.02f)
val ambientFadeCurve = preferenceStore.getFloat("ambient_fade_curve", 1.5f)
val ambientOpacity = preferenceStore.getFloat("ambient_opacity", 1.0f)
val isAmbientEnabled = preferenceStore.getBoolean("ambient_enabled", false)

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ enum class SeekbarStyle {
Standard,
Wavy,
Thick,
Liquid,
}
Loading
Loading