diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml
index 7826a41c..52bf9f58 100644
--- a/.github/workflows/android.yml
+++ b/.github/workflows/android.yml
@@ -4,10 +4,6 @@ on:
pull_request:
push:
branches: [master]
-concurrency:
- group: ${{ github.ref }}
- cancel-in-progress: true
-
jobs:
check:
runs-on: ubuntu-24.04
@@ -21,4 +17,4 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v4
- name: Build
- run: ./gradlew assembleNext
+ run: ./gradlew assembleDebug
diff --git a/.github/workflows/schedule.yml b/.github/workflows/schedule.yml
index a42a9c48..eb891b66 100644
--- a/.github/workflows/schedule.yml
+++ b/.github/workflows/schedule.yml
@@ -6,10 +6,6 @@ on:
schedule:
- cron: '0 0 * * *'
-concurrency:
- group: ${{ github.ref }}
- cancel-in-progress: true
-
jobs:
check_date:
runs-on: ubuntu-24.04
diff --git a/build.gradle b/build.gradle
index 80cf474c..59a35139 100644
--- a/build.gradle
+++ b/build.gradle
@@ -14,6 +14,15 @@ if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
+configurations.all {
+ resolutionStrategy.eachDependency {
+ if (requested.group == "androidx.concurrent" && requested.name == "concurrent-futures") {
+ useVersion("1.2.0")
+ because("conflict between compose BOM (1.1.0) and test deps (1.2.0)")
+ }
+ }
+}
+
android {
compileSdk = 36
defaultConfig {
@@ -33,7 +42,6 @@ android {
addConstant("INTENT_NEW_EVENT_ACTION", "com.juick.NEW_EVENT_ACTION")
buildConfigField "boolean", "HIDE_NSFW", "false"
- buildConfigField "boolean", "ENABLE_COMPOSE_UI", "false"
buildConfigField "boolean", "ENABLE_UPDATER", "true"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -42,7 +50,6 @@ android {
}
buildFeatures {
buildConfig true
- viewBinding true
compose true
}
compileOptions {
@@ -66,10 +73,6 @@ android {
minifyEnabled false
signingConfig signingConfigs.release
}
- next {
- initWith debug
- buildConfigField "boolean", "ENABLE_COMPOSE_UI", "true"
- }
store {
initWith release
buildConfigField "boolean", "ENABLE_UPDATER", "false"
@@ -126,12 +129,11 @@ dependencies {
implementation libs.navigation.fragment.ktx
implementation libs.navigation.ui.ktx
implementation libs.savedstate.ktx
- implementation libs.swiperefreshlayout
implementation libs.lifecycle.viewmodel.compose
+ implementation libs.lifecycle.runtime.compose
+ implementation libs.runtime.livedata
implementation libs.lifecycle.extensions
- implementation libs.material
-
// Sign in with Google
googleImplementation libs.credentials.play.services.auth
googleImplementation libs.play.services.auth
@@ -148,24 +150,27 @@ dependencies {
implementation libs.retrofit
implementation libs.converter.kotlinx.serialization
- implementation libs.chatkit
huaweiImplementation libs.push
- implementation libs.fragmentviewbindingdelegate.kt
-
implementation libs.android.image.cropper
// Compose
- nextImplementation libs.activity.compose
- nextImplementation libs.constraintlayout.compose
- nextImplementation platform(libs.compose.bom)
- nextImplementation libs.ui
- nextImplementation libs.ui.graphics
- nextImplementation libs.ui.viewbinding
- nextImplementation libs.ui.tooling.preview
- nextImplementation libs.material.icons.extended
- nextImplementation libs.material3
- nextImplementation libs.ui.tooling
+ implementation libs.activity.compose
+ implementation libs.constraintlayout.compose
+ implementation platform(libs.compose.bom)
+ implementation libs.ui
+ implementation libs.ui.graphics
+ implementation libs.ui.tooling.preview
+ implementation libs.material.icons.extended
+ implementation libs.material3
+ debugImplementation libs.ui.tooling
+
+ // Navigation Compose
+ implementation libs.navigation.compose
+
+ // Coil for image loading
+ implementation libs.coil.compose
+ implementation libs.coil.network.okhttp
// Core library
androidTestImplementation libs.test.core.ktx
@@ -174,10 +179,11 @@ dependencies {
androidTestImplementation libs.truth
androidTestImplementation libs.espresso.core
- // Espresso intents for intercepting ACTION_VIEW
- androidTestImplementation libs.espresso.intents
- // Fragment testing helpers (launchFragmentInContainer)
- androidTestImplementation libs.fragment.testing
+
+ // Compose UI testing
+ androidTestImplementation(platform(libs.compose.bom))
+ androidTestImplementation libs.compose.ui.test.junit4
+ debugImplementation libs.compose.ui.test.manifest
// UI Automator
androidTestImplementation libs.uiautomator.v18
}
diff --git a/gradle.properties b/gradle.properties
index 80cc0346..94fc9956 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,5 +1,5 @@
org.gradle.daemon=false
-org.gradle.parallel=fasle
+org.gradle.parallel=false
org.gradle.jvmargs=-Xmx1536M
org.gradle.vfs.watch=true
android.useAndroidX=true
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index e6539c82..38dfa4e2 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -4,10 +4,10 @@ androidImageCropper = "4.7.0"
appcompat = "1.7.1"
browser = "1.10.0"
chatkit = "5e99a8bf3c"
+coil = "3.4.0"
constraintlayoutCompose = "1.1.1"
credentialsPlayServicesAuth = "1.6.0"
-espressoCore = "3.6.1"
-espressoIntents = "3.7.0"
+espresso = "3.7.0"
firebaseBom = "34.14.1"
composeBom = "2026.05.01"
fragmentTesting = "1.8.9"
@@ -18,7 +18,7 @@ kotlinxSerializationJson = "1.11.0"
coreKtx = "1.18.0"
lifecycleVersion = "2.10.0"
lifecycleExtensions = "2.2.0"
-material = "1.14.0"
+material3 = "1.4.0"
navigationFragmentKtx = "2.9.8"
okhttp = "5.4.0"
oksse = "0.9.0"
@@ -41,13 +41,15 @@ android-image-cropper = { module = "com.vanniktech:android-image-cropper", versi
browser = { module = "androidx.browser:browser", version.ref = "browser" }
appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
chatkit = { module = "com.github.vitalyster:ChatKit", version.ref = "chatkit" }
+coil-compose = { module = "io.coil-kt.coil3:coil-compose", version.ref = "coil" }
+coil-network-okhttp = { module = "io.coil-kt.coil3:coil-network-okhttp", version.ref = "coil" }
compose-bom = { module = "androidx.compose:compose-bom", version.ref = "composeBom" }
constraintlayout-compose = { module = "androidx.constraintlayout:constraintlayout-compose", version.ref = "constraintlayoutCompose" }
converter-kotlinx-serialization = { module = "com.squareup.retrofit2:converter-kotlinx-serialization", version.ref = "retrofit" }
core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" }
credentials-play-services-auth = { module = "androidx.credentials:credentials-play-services-auth", version.ref = "credentialsPlayServicesAuth" }
-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoCore" }
-espresso-intents = { module = "androidx.test.espresso:espresso-intents", version.ref = "espressoIntents" }
+espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso" }
+espresso-intents = { module = "androidx.test.espresso:espresso-intents", version.ref = "espresso" }
firebase-messaging = { module = "com.google.firebase:firebase-messaging" }
firebase-bom = { module = "com.google.firebase:firebase-bom", version.ref = "firebaseBom" }
fragment-testing = { module = "androidx.fragment:fragment-testing", version.ref = "fragmentTesting" }
@@ -56,11 +58,15 @@ googleid = { module = "com.google.android.libraries.identity.googleid:googleid",
junit = { module = "androidx.test.ext:junit", version.ref = "junit" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" }
lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycleVersion" }
+lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "lifecycleVersion" }
+runtime-livedata = { module = "androidx.compose.runtime:runtime-livedata" }
+compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4" }
+compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" }
lifecycle-extensions = { module = "androidx.lifecycle:lifecycle-extensions", version.ref = "lifecycleExtensions" }
logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" }
-material = { module = "com.google.android.material:material", version.ref = "material" }
-material3 = { module = "androidx.compose.material3:material3" }
+material3 = { module = "androidx.compose.material3:material3", version.ref = "material3" }
material-icons-extended = { module = "androidx.compose.material:material-icons-extended" }
+navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigationFragmentKtx" }
navigation-fragment-ktx = { module = "androidx.navigation:navigation-fragment-ktx", version.ref = "navigationFragmentKtx" }
navigation-ui-ktx = { module = "androidx.navigation:navigation-ui-ktx", version.ref = "navigationFragmentKtx" }
okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
diff --git a/src/androidTest/AndroidManifest.xml b/src/androidTest/AndroidManifest.xml
index ae8f37a8..d2084741 100644
--- a/src/androidTest/AndroidManifest.xml
+++ b/src/androidTest/AndroidManifest.xml
@@ -1,6 +1,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/res/layout/activity_main.xml b/src/main/res/layout/activity_main.xml
deleted file mode 100644
index 0baf0272..00000000
--- a/src/main/res/layout/activity_main.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/res/layout/activity_signup.xml b/src/main/res/layout/activity_signup.xml
deleted file mode 100644
index 3f73ddc0..00000000
--- a/src/main/res/layout/activity_signup.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/res/layout/content_main.xml b/src/main/res/layout/content_main.xml
deleted file mode 100644
index f31aa9ec..00000000
--- a/src/main/res/layout/content_main.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/src/main/res/layout/dialog_crop.xml b/src/main/res/layout/dialog_crop.xml
deleted file mode 100644
index 1ab2b671..00000000
--- a/src/main/res/layout/dialog_crop.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/res/layout/fragment_chat.xml b/src/main/res/layout/fragment_chat.xml
deleted file mode 100644
index 930062c2..00000000
--- a/src/main/res/layout/fragment_chat.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/src/main/res/layout/fragment_dialog_list.xml b/src/main/res/layout/fragment_dialog_list.xml
deleted file mode 100644
index 8e4e15dd..00000000
--- a/src/main/res/layout/fragment_dialog_list.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/res/layout/fragment_me.xml b/src/main/res/layout/fragment_me.xml
deleted file mode 100644
index a8548c33..00000000
--- a/src/main/res/layout/fragment_me.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/res/layout/fragment_new_post.xml b/src/main/res/layout/fragment_new_post.xml
deleted file mode 100644
index e0ebfa65..00000000
--- a/src/main/res/layout/fragment_new_post.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/res/layout/fragment_no_auth.xml b/src/main/res/layout/fragment_no_auth.xml
deleted file mode 100644
index 60905e9b..00000000
--- a/src/main/res/layout/fragment_no_auth.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/res/layout/fragment_posts_page.xml b/src/main/res/layout/fragment_posts_page.xml
deleted file mode 100644
index 501742fe..00000000
--- a/src/main/res/layout/fragment_posts_page.xml
+++ /dev/null
@@ -1,174 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/res/layout/fragment_posts_viewpager.xml b/src/main/res/layout/fragment_posts_viewpager.xml
deleted file mode 100644
index 6bc5e462..00000000
--- a/src/main/res/layout/fragment_posts_viewpager.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/src/main/res/layout/fragment_tags_list.xml b/src/main/res/layout/fragment_tags_list.xml
deleted file mode 100644
index d6023ee3..00000000
--- a/src/main/res/layout/fragment_tags_list.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/res/layout/fragment_thread.xml b/src/main/res/layout/fragment_thread.xml
deleted file mode 100644
index 028d2129..00000000
--- a/src/main/res/layout/fragment_thread.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/res/layout/item_post.xml b/src/main/res/layout/item_post.xml
deleted file mode 100644
index cb2c7c58..00000000
--- a/src/main/res/layout/item_post.xml
+++ /dev/null
@@ -1,193 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/res/layout/item_tag.xml b/src/main/res/layout/item_tag.xml
deleted file mode 100644
index 7af45d66..00000000
--- a/src/main/res/layout/item_tag.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/src/main/res/layout/item_thread_reply.xml b/src/main/res/layout/item_thread_reply.xml
deleted file mode 100644
index 8a98142c..00000000
--- a/src/main/res/layout/item_thread_reply.xml
+++ /dev/null
@@ -1,175 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/res/layout/menu_layout_discussions.xml b/src/main/res/layout/menu_layout_discussions.xml
deleted file mode 100644
index 6f0533e2..00000000
--- a/src/main/res/layout/menu_layout_discussions.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/res/layout/menu_layout_profile.xml b/src/main/res/layout/menu_layout_profile.xml
deleted file mode 100644
index 7ab32f2c..00000000
--- a/src/main/res/layout/menu_layout_profile.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/res/menu/bottom_navigation.xml b/src/main/res/menu/bottom_navigation.xml
deleted file mode 100644
index ac870ef1..00000000
--- a/src/main/res/menu/bottom_navigation.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
diff --git a/src/main/res/menu/toolbar.xml b/src/main/res/menu/toolbar.xml
deleted file mode 100644
index 7f10ef7d..00000000
--- a/src/main/res/menu/toolbar.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
diff --git a/src/main/res/navigation/navigation.xml b/src/main/res/navigation/navigation.xml
deleted file mode 100644
index ba4c5838..00000000
--- a/src/main/res/navigation/navigation.xml
+++ /dev/null
@@ -1,140 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/res/values/styles.xml b/src/main/res/values/styles.xml
index 77d32044..492b2293 100644
--- a/src/main/res/values/styles.xml
+++ b/src/main/res/values/styles.xml
@@ -17,13 +17,12 @@
-->
-
@@ -32,15 +31,4 @@
- @color/colorTextBackground
- @color/colorText
-
-
-
\ No newline at end of file
diff --git a/src/next/google/google-services.json b/src/next/google/google-services.json
deleted file mode 100644
index 752a1f8f..00000000
--- a/src/next/google/google-services.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "project_info": {
- "project_number": "",
- "project_id": ""
- },
- "client": [
- {
- "client_info": {
- "mobilesdk_app_id": "1:123456789012:android:1234567890123456",
- "android_client_info": {
- "package_name": "com.juick.debug"
- }
- },
- "oauth_client": [
- {
- "client_id": "",
- "client_type": 3
- },
- {
- "client_id": "",
- "client_type": 1,
- "android_info": {
- "package_name": "com.juick.debug",
- "certificate_hash": ""
- }
- }
- ],
- "api_key": [
- {
- "current_key": ""
- }
- ]
- }
- ],
- "configuration_version": "1"
-}
diff --git a/src/next/java/com/juick/android/NextSignInActivity.kt b/src/next/java/com/juick/android/NextSignInActivity.kt
deleted file mode 100644
index 13d2fb7a..00000000
--- a/src/next/java/com/juick/android/NextSignInActivity.kt
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2008-2024, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package com.juick.android
-
-import android.os.Bundle
-import android.widget.Toast
-import androidx.activity.ComponentActivity
-import androidx.activity.compose.setContent
-import androidx.compose.foundation.Image
-import androidx.compose.foundation.layout.Box
-import androidx.compose.foundation.layout.fillMaxSize
-import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.text.KeyboardOptions
-import androidx.compose.material3.Button
-import androidx.compose.material3.Scaffold
-import androidx.compose.material3.Text
-import androidx.compose.material3.TextField
-import androidx.compose.runtime.Composable
-import androidx.compose.runtime.getValue
-import androidx.compose.runtime.mutableStateOf
-import androidx.compose.runtime.remember
-import androidx.compose.runtime.setValue
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.graphics.RectangleShape
-import androidx.compose.ui.res.painterResource
-import androidx.compose.ui.res.stringResource
-import androidx.compose.ui.text.input.ImeAction
-import androidx.compose.ui.text.input.KeyboardType
-import androidx.compose.ui.tooling.preview.Preview
-import androidx.constraintlayout.compose.ConstraintLayout
-import com.juick.R
-import com.juick.android.ui.AppTheme
-import com.juick.android.ui.standardSpacing
-
-class NextSignInActivity : ComponentActivity() {
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContent {
- SignInView()
- }
- }
-
- @Composable
- fun SignInView() {
- var nick by remember { mutableStateOf("") }
- var password by remember { mutableStateOf("") }
- AppTheme {
- Scaffold { contentPadding ->
- Box(modifier = Modifier.padding(contentPadding)) {
- ConstraintLayout(modifier = Modifier.fillMaxSize()) {
- val (logo, nickField, passwordField, submitButton) = createRefs()
- Image(
- modifier = Modifier.constrainAs(logo) {
- centerTo(parent)
- },
- painter = painterResource(R.drawable.ic_logo),
- contentDescription = "Main logo"
- )
- TextField(
- modifier = Modifier.constrainAs(nickField) {
- top.linkTo(logo.bottom, margin = standardSpacing)
- start.linkTo(parent.start)
- end.linkTo(parent.end)
- }, value = nick, onValueChange = { nick = it })
- TextField(
- modifier = Modifier.constrainAs(passwordField) {
- top.linkTo(nickField.bottom, margin = standardSpacing)
- start.linkTo(parent.start)
- end.linkTo(parent.end)
- },
- value = password, onValueChange = { password = it },
- keyboardOptions = KeyboardOptions(
- imeAction = ImeAction.Done,
- keyboardType = KeyboardType.Password
- ),
- )
- Button(
- modifier = Modifier.constrainAs(submitButton) {
- top.linkTo(passwordField.bottom, standardSpacing)
- start.linkTo(passwordField.start)
- end.linkTo(passwordField.end)
- },
- onClick = {
- if (nick.isEmpty() || password.isEmpty()) {
- Toast.makeText(
- this@NextSignInActivity,
- R.string.Enter_nick_and_password,
- Toast.LENGTH_SHORT
- ).show()
- return@Button
- }
- }, shape = RectangleShape) {
- Text(stringResource(R.string.login))
- }
- }
- }
- }
- }
- }
-
- @Preview(apiLevel = 34)
- @Composable
- fun PreviewSignInView() {
- SignInView()
- }
-}
\ No newline at end of file
diff --git a/src/next/java/com/juick/android/ui/Theme.kt b/src/next/java/com/juick/android/ui/Theme.kt
deleted file mode 100644
index afff995b..00000000
--- a/src/next/java/com/juick/android/ui/Theme.kt
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2008-2024, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.juick.android.ui
-
-import android.app.Activity
-import androidx.compose.foundation.isSystemInDarkTheme
-import androidx.compose.material3.MaterialTheme
-import androidx.compose.material3.darkColorScheme
-import androidx.compose.material3.lightColorScheme
-import androidx.compose.runtime.Composable
-import androidx.compose.runtime.SideEffect
-import androidx.compose.ui.graphics.Color
-import androidx.compose.ui.graphics.toArgb
-import androidx.compose.ui.platform.LocalView
-import androidx.compose.ui.unit.dp
-import androidx.core.view.WindowCompat
-
-@Composable
-fun AppTheme(
- useDarkTheme: Boolean = isSystemInDarkTheme(),
- content: @Composable () -> Unit
-) {
- val colors = when {
- useDarkTheme -> darkColorScheme()
- else -> lightColorScheme().copy(
- primary = Color(0xff3c77aa),
- onPrimary = Color(0xfffdfdfe),
- primaryContainer = Color(0xfffdfdfe),
- onPrimaryContainer = Color(0xff3c77aa)
- )
- }
-
- val view = LocalView.current
- if (!view.isInEditMode) {
- SideEffect {
- val window = (view.context as Activity).window
- window.statusBarColor = colors.primary.toArgb()
- WindowCompat
- .getInsetsController(window, view)
- .isAppearanceLightStatusBars = useDarkTheme
- }
- }
-
- MaterialTheme(
- colorScheme = colors,
- content = content
- )
-}
-
-val standardSpacing = 16.dp
\ No newline at end of file