Första stegen mot multiplattform gjorda. Skapat shared.
This commit is contained in:
@@ -46,8 +46,8 @@ android {
|
||||
applicationId = "app.klottr"
|
||||
minSdk = 26
|
||||
targetSdk = 35
|
||||
versionCode = 13
|
||||
versionName = "0.2.6"
|
||||
versionCode = 14
|
||||
versionName = "0.3.0"
|
||||
|
||||
// Byggtid i UTC (ISO 8601) genereras vid build-konfiguration
|
||||
val buildTimeUtc = Instant.now().toString()
|
||||
@@ -88,6 +88,7 @@ android {
|
||||
dependencies {
|
||||
// Compose
|
||||
val composeBom = platform("androidx.compose:compose-bom:2025.01.00")
|
||||
implementation(project(":shared"))
|
||||
implementation(composeBom)
|
||||
androidTestImplementation(composeBom)
|
||||
implementation("androidx.activity:activity-compose:1.9.3")
|
||||
|
||||
@@ -63,6 +63,7 @@ import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Switch
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
@@ -106,6 +107,7 @@ import app.klottr.net.createNoteDoc
|
||||
import app.klottr.net.deleteNote
|
||||
import app.klottr.net.fetchNoteDetail
|
||||
import app.klottr.net.uploadImageFromUri
|
||||
import app.klottr.shared.SharedPing
|
||||
import app.klottr.theme.KlottrTheme
|
||||
import app.klottr.util.Auth
|
||||
import app.klottr.util.Config
|
||||
@@ -205,6 +207,10 @@ class MainActivity : ComponentActivity() {
|
||||
|
||||
setContent {
|
||||
val context = LocalContext.current
|
||||
|
||||
// För att testa att :shared fungerar
|
||||
val sharedPing = remember { SharedPing().ping() }
|
||||
|
||||
var night by remember { mutableStateOf(SettingsStore.getNightMode(context)) }
|
||||
DisposableEffect(Unit) {
|
||||
val listener = SettingsStore.observe(context) { key ->
|
||||
@@ -215,6 +221,11 @@ class MainActivity : ComponentActivity() {
|
||||
onDispose { SettingsStore.unobserve(context, listener) }
|
||||
}
|
||||
|
||||
// ⬇️ NYTILLÄGG: logga en gång när värdet finns
|
||||
LaunchedEffect(sharedPing) {
|
||||
Log.d("Klottr", "Shared ping = $sharedPing")
|
||||
}
|
||||
|
||||
KlottrTheme(darkTheme = night) {
|
||||
KlottrApp(
|
||||
onRequestPerms = { this@MainActivity.requestAllRuntimePerms() },
|
||||
|
||||
Reference in New Issue
Block a user