Skip to content

Commit 3c8aca8

Browse files
authored
Merge branch 'main' into flatpak-pr
2 parents 466c697 + 67bb54d commit 3c8aca8

78 files changed

Lines changed: 3705 additions & 588 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-desktop-platforms.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,28 @@ jobs:
267267
ls -lh "$OUTPUT" "$OUTPUT.zsync"
268268
shell: bash
269269

270+
- name: Patch deb scripts for headless/WSL compatibility
271+
run: |
272+
set -euo pipefail
273+
for deb in composeApp/build/compose/binaries/main/deb/*.deb; do
274+
[ -f "$deb" ] || continue
275+
echo "Patching: $deb"
276+
tmpdir=$(mktemp -d)
277+
dpkg-deb -R "$deb" "$tmpdir"
278+
279+
for script in "$tmpdir/DEBIAN/postinst" "$tmpdir/DEBIAN/prerm" "$tmpdir/DEBIAN/postrm"; do
280+
[ -f "$script" ] || continue
281+
# Make xdg-desktop-menu / xdg-icon-resource / xdg-mime calls non-fatal
282+
# so install/remove succeeds in headless environments (WSL, containers, servers)
283+
sed -i '/xdg-desktop-menu\|xdg-icon-resource\|xdg-mime/{/|| true$/!s/$/ || true/}' "$script"
284+
done
285+
286+
dpkg-deb -b "$tmpdir" "$deb"
287+
rm -rf "$tmpdir"
288+
echo "Patched successfully: $deb"
289+
done
290+
shell: bash
291+
270292
- name: Upload Linux installers
271293
uses: actions/upload-artifact@v4
272294
with:

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ Built with Kotlin Multiplatform and Compose Multiplatform for Android and Deskto
6464

6565
</div>
6666

67+
<div align="center"><a href="https://github.com/Safouene1/support-palestine-banner/blob/master/Markdown-pages/Support.md"><img src="https://raw.githubusercontent.com/Safouene1/support-palestine-banner/master/banner-project.svg" alt="Support Palestine" style="width: 100%;"></a></div>
68+
6769
> [!CAUTION]
6870
> Free and Open-Source Android is under threat. Google will turn Android into a locked-down platform, restricting your essential freedom to install apps of your choice. Make your voice heard – [keepandroidopen.org](https://keepandroidopen.org/).
6971

composeApp/src/androidMain/kotlin/zed/rainxch/githubstore/app/GithubStoreApp.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import zed.rainxch.core.data.services.UpdateScheduler
1717
import zed.rainxch.core.domain.model.InstallSource
1818
import zed.rainxch.core.domain.model.InstalledApp
1919
import zed.rainxch.core.domain.repository.InstalledAppsRepository
20-
import zed.rainxch.core.domain.repository.ThemesRepository
20+
import zed.rainxch.core.domain.repository.TweaksRepository
2121
import zed.rainxch.core.domain.system.PackageMonitor
2222
import zed.rainxch.githubstore.app.di.initKoin
2323

@@ -83,7 +83,7 @@ class GithubStoreApp : Application() {
8383
private fun scheduleBackgroundUpdateChecks() {
8484
appScope.launch {
8585
try {
86-
val intervalHours = get<ThemesRepository>().getUpdateCheckInterval().first()
86+
val intervalHours = get<TweaksRepository>().getUpdateCheckInterval().first()
8787
UpdateScheduler.schedule(
8888
context = this@GithubStoreApp,
8989
intervalHours = intervalHours,

composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/Main.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ fun App(deepLinkUri: String? = null) {
102102

103103
AppNavigation(
104104
navController = navController,
105+
isLiquidGlassEnabled = state.isLiquidGlassEnabled,
105106
)
106107
}
107108
}

composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/MainState.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ data class MainState(
1313
val isAmoledTheme: Boolean = false,
1414
val isDarkTheme: Boolean? = null,
1515
val currentFontTheme: FontTheme = FontTheme.CUSTOM,
16+
val isLiquidGlassEnabled: Boolean = true,
1617
)

composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/MainViewModel.kt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import kotlinx.coroutines.launch
1010
import zed.rainxch.core.domain.repository.AuthenticationState
1111
import zed.rainxch.core.domain.repository.InstalledAppsRepository
1212
import zed.rainxch.core.domain.repository.RateLimitRepository
13-
import zed.rainxch.core.domain.repository.ThemesRepository
13+
import zed.rainxch.core.domain.repository.TweaksRepository
1414
import zed.rainxch.core.domain.use_cases.SyncInstalledAppsUseCase
1515

1616
class MainViewModel(
17-
private val themesRepository: ThemesRepository,
17+
private val tweaksRepository: TweaksRepository,
1818
private val installedAppsRepository: InstalledAppsRepository,
1919
private val authenticationState: AuthenticationState,
2020
private val rateLimitRepository: RateLimitRepository,
@@ -37,7 +37,7 @@ class MainViewModel(
3737
}
3838

3939
viewModelScope.launch {
40-
themesRepository
40+
tweaksRepository
4141
.getThemeColor()
4242
.collect { theme ->
4343
_state.update {
@@ -46,7 +46,7 @@ class MainViewModel(
4646
}
4747
}
4848
viewModelScope.launch {
49-
themesRepository
49+
tweaksRepository
5050
.getAmoledTheme()
5151
.collect { isAmoled ->
5252
_state.update {
@@ -55,7 +55,7 @@ class MainViewModel(
5555
}
5656
}
5757
viewModelScope.launch {
58-
themesRepository
58+
tweaksRepository
5959
.getIsDarkTheme()
6060
.collect { isDarkTheme ->
6161
_state.update {
@@ -65,7 +65,7 @@ class MainViewModel(
6565
}
6666

6767
viewModelScope.launch {
68-
themesRepository
68+
tweaksRepository
6969
.getFontTheme()
7070
.collect { fontTheme ->
7171
_state.update {
@@ -74,6 +74,12 @@ class MainViewModel(
7474
}
7575
}
7676

77+
viewModelScope.launch {
78+
tweaksRepository.getLiquidGlassEnabled().collect { enabled ->
79+
_state.update { it.copy(isLiquidGlassEnabled = enabled) }
80+
}
81+
}
82+
7783
viewModelScope.launch {
7884
rateLimitRepository.rateLimitState.collect { rateLimitInfo ->
7985
_state.update { currentState ->

composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/di/SharedModules.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ val mainModule: Module =
99
module {
1010
viewModel {
1111
MainViewModel(
12-
themesRepository = get(),
12+
tweaksRepository = get(),
1313
installedAppsRepository = get(),
1414
rateLimitRepository = get(),
1515
syncUseCase = get(),

composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/AppNavigation.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ import zed.rainxch.search.presentation.SearchRoot
4040
import zed.rainxch.starred.presentation.StarredReposRoot
4141

4242
@Composable
43-
fun AppNavigation(navController: NavHostController) {
43+
fun AppNavigation(
44+
navController: NavHostController,
45+
isLiquidGlassEnabled: Boolean = true,
46+
) {
4447
val liquidState = rememberLiquidState()
4548
var bottomNavigationHeight by remember { mutableStateOf(0.dp) }
4649
val density = LocalDensity.current
@@ -294,6 +297,7 @@ fun AppNavigation(navController: NavHostController) {
294297
}
295298
},
296299
isUpdateAvailable = appsState.apps.any { it.installedApp.isUpdateAvailable },
300+
isLiquidGlassEnabled = isLiquidGlassEnabled,
297301
modifier =
298302
Modifier
299303
.align(Alignment.BottomCenter)

composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/BottomNavigation.kt

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import androidx.compose.animation.core.animateFloatAsState
88
import androidx.compose.animation.core.spring
99
import androidx.compose.animation.core.tween
1010
import androidx.compose.foundation.background
11+
import androidx.compose.foundation.border
1112
import androidx.compose.foundation.clickable
1213
import androidx.compose.foundation.interaction.MutableInteractionSource
1314
import androidx.compose.foundation.interaction.collectIsPressedAsState
@@ -65,6 +66,7 @@ fun BottomNavigation(
6566
currentScreen: GithubStoreGraph,
6667
onNavigate: (GithubStoreGraph) -> Unit,
6768
isUpdateAvailable: Boolean,
69+
isLiquidGlassEnabled: Boolean = true,
6870
modifier: Modifier = Modifier,
6971
) {
7072
val liquidState = LocalBottomNavigationLiquid.current
@@ -129,31 +131,36 @@ fun BottomNavigation(
129131
modifier = modifier,
130132
contentAlignment = Alignment.Center,
131133
) {
134+
val useLiquid = isLiquidGlassEnabled && isLiquidFrostAvailable()
135+
132136
Box(
133137
modifier =
134138
Modifier
135139
.clip(CircleShape)
136-
.background(
137-
if (isLiquidFrostAvailable()) {
138-
MaterialTheme.colorScheme.surfaceContainerHighest.copy(
139-
alpha = if (isDarkTheme) .25f else .15f,
140-
)
141-
} else {
142-
MaterialTheme.colorScheme.surfaceContainerHighest
143-
},
144-
).then(
145-
if (isLiquidFrostAvailable()) {
146-
Modifier.liquid(liquidState) {
147-
this.shape = CircleShape
148-
this.frost = if (isDarkTheme) 12.dp else 10.dp
149-
this.curve = if (isDarkTheme) .35f else .45f
150-
this.refraction = if (isDarkTheme) .08f else .12f
151-
this.dispersion = if (isDarkTheme) .18f else .25f
152-
this.saturation = if (isDarkTheme) .40f else .55f
153-
this.contrast = if (isDarkTheme) 1.8f else 1.6f
154-
}
140+
.then(
141+
if (useLiquid) {
142+
Modifier
143+
.background(
144+
MaterialTheme.colorScheme.surfaceContainerHighest.copy(
145+
alpha = if (isDarkTheme) .25f else .15f,
146+
),
147+
).liquid(liquidState) {
148+
this.shape = CircleShape
149+
this.frost = if (isDarkTheme) 12.dp else 10.dp
150+
this.curve = if (isDarkTheme) .35f else .45f
151+
this.refraction = if (isDarkTheme) .08f else .12f
152+
this.dispersion = if (isDarkTheme) .18f else .25f
153+
this.saturation = if (isDarkTheme) .40f else .55f
154+
this.contrast = if (isDarkTheme) 1.8f else 1.6f
155+
}
155156
} else {
156157
Modifier
158+
.background(MaterialTheme.colorScheme.surfaceContainer)
159+
.border(
160+
width = 1.dp,
161+
color = MaterialTheme.colorScheme.outlineVariant,
162+
shape = CircleShape,
163+
)
157164
},
158165
).pointerInput(Unit) { },
159166
) {

0 commit comments

Comments
 (0)