diff --git a/.github/workflows/build-desktop-platforms.yml b/.github/workflows/build-desktop-platforms.yml index ed6cea52b..0b1426c89 100644 --- a/.github/workflows/build-desktop-platforms.yml +++ b/.github/workflows/build-desktop-platforms.yml @@ -139,18 +139,25 @@ jobs: build-linux: runs-on: ubuntu-latest + container: + image: debian:12 steps: + - name: Install build dependencies + run: | + apt-get update + apt-get install -y curl git + # Install JDK 21 + apt-get install -y wget apt-transport-https gnupg + mkdir -p /etc/apt/keyrings + wget -O /etc/apt/keyrings/adoptium.asc https://packages.adoptium.net/artifactory/api/gpg/key/public + echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list + apt-get update + apt-get install -y temurin-21-jdk + - name: Checkout code uses: actions/checkout@v4 - - name: Set up JDK 21 - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '21' - cache: 'gradle' - - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 with: diff --git a/composeApp/release/baselineProfiles/0/composeApp-release.dm b/composeApp/release/baselineProfiles/0/composeApp-release.dm index 170df4837..9aa218e48 100644 Binary files a/composeApp/release/baselineProfiles/0/composeApp-release.dm and b/composeApp/release/baselineProfiles/0/composeApp-release.dm differ diff --git a/composeApp/release/baselineProfiles/1/composeApp-release.dm b/composeApp/release/baselineProfiles/1/composeApp-release.dm index 103cca311..f425720e2 100644 Binary files a/composeApp/release/baselineProfiles/1/composeApp-release.dm and b/composeApp/release/baselineProfiles/1/composeApp-release.dm differ diff --git a/composeApp/src/androidMain/kotlin/zed/rainxch/githubstore/core/presentation/utils/ApplyAndroidSystemBars.kt b/composeApp/src/androidMain/kotlin/zed/rainxch/githubstore/core/presentation/utils/ApplyAndroidSystemBars.kt new file mode 100644 index 000000000..6f1cf9512 --- /dev/null +++ b/composeApp/src/androidMain/kotlin/zed/rainxch/githubstore/core/presentation/utils/ApplyAndroidSystemBars.kt @@ -0,0 +1,33 @@ +package zed.rainxch.githubstore.core.presentation.utils + +import android.app.Activity +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.runtime.Composable +import androidx.compose.runtime.DisposableEffect +import androidx.compose.runtime.SideEffect +import androidx.compose.ui.platform.LocalContext +import androidx.core.view.WindowCompat +import androidx.core.view.WindowInsetsControllerCompat + +@Composable +actual fun ApplyAndroidSystemBars(isDarkTheme: Boolean?) { + val context = LocalContext.current + val activity = context as? Activity ?: return + + val isDark = isDarkTheme ?: isSystemInDarkTheme() + + DisposableEffect(isDark) { + activity.updateSystemBars(isDark) + onDispose { } + } +} + +// androidMain +fun Activity.updateSystemBars(isDarkTheme: Boolean) { + WindowCompat.setDecorFitsSystemWindows(window, false) + + val controller = WindowInsetsControllerCompat(window, window.decorView) + + controller.isAppearanceLightStatusBars = !isDarkTheme + controller.isAppearanceLightNavigationBars = !isDarkTheme +} diff --git a/composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/App.kt b/composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/App.kt index f22f59a18..6714f9c74 100644 --- a/composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/App.kt +++ b/composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/App.kt @@ -20,6 +20,7 @@ import zed.rainxch.githubstore.app.app_state.components.RateLimitDialog import zed.rainxch.githubstore.app.navigation.AppNavigation import zed.rainxch.githubstore.app.navigation.GithubStoreGraph import zed.rainxch.githubstore.core.presentation.theme.GithubStoreTheme +import zed.rainxch.githubstore.core.presentation.utils.ApplyAndroidSystemBars @OptIn(ExperimentalMaterial3ExpressiveApi::class) @Composable @@ -42,6 +43,8 @@ fun App( isAmoledTheme = state.isAmoledTheme, isDarkTheme = state.isDarkTheme ?: isSystemInDarkTheme() ) { + ApplyAndroidSystemBars(state.isDarkTheme) + LaunchedEffect(state.isCheckingAuth) { if (!state.isCheckingAuth) { onAuthenticationChecked() diff --git a/composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/BottomNavigation.kt b/composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/BottomNavigation.kt index 6ac6d9f50..399acae49 100644 --- a/composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/BottomNavigation.kt +++ b/composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/BottomNavigation.kt @@ -14,6 +14,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color +import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.unit.dp import io.github.fletchmckee.liquid.liquefiable import io.github.fletchmckee.liquid.liquid @@ -48,7 +49,7 @@ fun BottomNavigation( } } else Modifier ) - .padding(10.dp), + .pointerInput(Unit) { }, ) { BottomNavigationUtils .items() @@ -69,13 +70,15 @@ fun BottomNavigation( MaterialTheme.colorScheme.onPrimaryContainer } else MaterialTheme.colorScheme.onSurface, ), - shapes = IconButtonDefaults.shapes() + shapes = IconButtonDefaults.shapes(), + modifier = Modifier + .background(Color.Transparent) + .padding(8.dp) ) { Icon( imageVector = item.iconRes, contentDescription = stringResource(item.titleRes), - modifier = Modifier - .padding(6.dp) + modifier = Modifier.padding(4.dp) ) } } diff --git a/composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/BottomNavigationUtils.kt b/composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/BottomNavigationUtils.kt index d84435f44..eccba222d 100644 --- a/composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/BottomNavigationUtils.kt +++ b/composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/BottomNavigationUtils.kt @@ -30,16 +30,16 @@ object BottomNavigationUtils { iconRes = Icons.Outlined.Search, screen = GithubStoreGraph.SearchScreen ), - BottomNavigationItem( - titleRes = Res.string.installed_apps, - iconRes = Icons.Outlined.Apps, - screen = GithubStoreGraph.AppsScreen - ), BottomNavigationItem( titleRes = Res.string.favourites, iconRes = Icons.Outlined.Favorite, screen = GithubStoreGraph.FavouritesScreen ), + BottomNavigationItem( + titleRes = Res.string.installed_apps, + iconRes = Icons.Outlined.Apps, + screen = GithubStoreGraph.AppsScreen + ), BottomNavigationItem( titleRes = Res.string.settings_title, iconRes = Icons.Outlined.Settings, diff --git a/composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/core/presentation/utils/ApplyAndroidSystemBars.kt b/composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/core/presentation/utils/ApplyAndroidSystemBars.kt new file mode 100644 index 000000000..f81a102d4 --- /dev/null +++ b/composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/core/presentation/utils/ApplyAndroidSystemBars.kt @@ -0,0 +1,6 @@ +package zed.rainxch.githubstore.core.presentation.utils + +import androidx.compose.runtime.Composable + +@Composable +expect fun ApplyAndroidSystemBars(isDarkTheme: Boolean?) \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/feature/search/presentation/SearchRoot.kt b/composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/feature/search/presentation/SearchRoot.kt index f3bbbc98c..ca543d84f 100644 --- a/composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/feature/search/presentation/SearchRoot.kt +++ b/composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/feature/search/presentation/SearchRoot.kt @@ -54,6 +54,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.KeyboardType +import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import githubstore.composeapp.generated.resources.Res @@ -409,7 +410,10 @@ private fun SearchTopbar( Text( text = stringResource(Res.string.search_repositories_hint), style = MaterialTheme.typography.bodyLarge, - color = MaterialTheme.colorScheme.onSurfaceVariant + color = MaterialTheme.colorScheme.onSurfaceVariant, + softWrap = false, + maxLines = 1, + overflow = TextOverflow.Ellipsis ) }, textStyle = MaterialTheme.typography.bodyLarge.copy( diff --git a/composeApp/src/jvmMain/kotlin/zed/rainxch/githubstore/core/presentation/utils/ApplyAndroidSystemBars.jvm.kt b/composeApp/src/jvmMain/kotlin/zed/rainxch/githubstore/core/presentation/utils/ApplyAndroidSystemBars.jvm.kt new file mode 100644 index 000000000..f6ac04093 --- /dev/null +++ b/composeApp/src/jvmMain/kotlin/zed/rainxch/githubstore/core/presentation/utils/ApplyAndroidSystemBars.jvm.kt @@ -0,0 +1,8 @@ +package zed.rainxch.githubstore.core.presentation.utils + +import androidx.compose.runtime.Composable + +@Composable +actual fun ApplyAndroidSystemBars(isDarkTheme: Boolean?) { + // No-op +} \ No newline at end of file