Bump various dependencies

This commit is contained in:
William Brawner 2024-11-16 16:40:25 -07:00
parent 7447a5ca6d
commit b5c23fc5ca
Signed by: wbrawner
GPG key ID: 8FF12381C6C90D35
17 changed files with 119 additions and 125 deletions

10
.gitignore vendored
View file

@ -1,15 +1,11 @@
*.iml *.iml
.gradle .gradle
/local.properties /local.properties
/.idea/caches .idea
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store .DS_Store
/build /build
/captures /captures
.externalNativeBuild .externalNativeBuild
.cxx .cxx
keystore.properties keystore.properties
.kotlin

View file

@ -237,6 +237,7 @@
<option name="preferredColumnWidths"> <option name="preferredColumnWidths">
<map> <map>
<entry key="Duration" value="90" /> <entry key="Duration" value="90" />
<entry key="Medium_Phone_API_35" value="120" />
<entry key="Pixel_3a_API_33_arm64-v8a" value="120" /> <entry key="Pixel_3a_API_33_arm64-v8a" value="120" />
<entry key="Tests" value="360" /> <entry key="Tests" value="360" />
</map> </map>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="KotlinJpsPluginSettings"> <component name="KotlinJpsPluginSettings">
<option name="version" value="1.9.22" /> <option name="version" value="2.0.21" />
</component> </component>
</project> </project>

View file

@ -3,10 +3,11 @@ import java.io.FileNotFoundException
import java.util.* import java.util.*
plugins { plugins {
id("com.android.application") alias(libs.plugins.android.application)
id("kotlin-android") alias(libs.plugins.kotlin.android)
id("kotlin-kapt") alias(libs.plugins.kotlin.ksp)
id("dagger.hilt.android.plugin") alias(libs.plugins.hilt.android)
alias(libs.plugins.compose)
} }
val keystoreProperties = Properties() val keystoreProperties = Properties()
@ -56,11 +57,11 @@ android {
} }
} }
compileOptions { compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_21
} }
kotlinOptions { kotlinOptions {
jvmTarget = "1.8" jvmTarget = "21"
} }
buildFeatures { buildFeatures {
compose = true compose = true
@ -77,7 +78,7 @@ dependencies {
implementation(libs.bundles.compose) implementation(libs.bundles.compose)
implementation(libs.hilt.android.core) implementation(libs.hilt.android.core)
implementation(libs.hilt.navigation.compose) implementation(libs.hilt.navigation.compose)
kapt(libs.hilt.android.kapt) ksp(libs.hilt.android.ksp)
implementation(libs.androidx.core) implementation(libs.androidx.core)
implementation(libs.androidx.appcompat) implementation(libs.androidx.appcompat)
implementation(libs.androidx.splash) implementation(libs.androidx.splash)
@ -92,7 +93,7 @@ dependencies {
androidTestImplementation(libs.test.ext) androidTestImplementation(libs.test.ext)
androidTestImplementation(libs.espresso) androidTestImplementation(libs.espresso)
androidTestImplementation(libs.hilt.android.testing) androidTestImplementation(libs.hilt.android.testing)
kaptAndroidTest(libs.hilt.android.kapt) kspAndroidTest(libs.hilt.android.ksp)
androidTestImplementation(libs.compose.test.junit) androidTestImplementation(libs.compose.test.junit)
debugImplementation(libs.compose.test.manifest) debugImplementation(libs.compose.test.manifest)
} }

View file

@ -4,7 +4,6 @@ import android.content.Context
import androidx.compose.ui.test.* import androidx.compose.ui.test.*
import androidx.compose.ui.test.junit4.ComposeTestRule import androidx.compose.ui.test.junit4.ComposeTestRule
import androidx.test.platform.app.InstrumentationRegistry import androidx.test.platform.app.InstrumentationRegistry
import com.wbrawner.pihelper.CONNECT_BUTTON_TAG
fun onAddScreen(testRule: ComposeTestRule, actions: AddScreenRobot.() -> Unit) = fun onAddScreen(testRule: ComposeTestRule, actions: AddScreenRobot.() -> Unit) =
AddScreenRobot(testRule).apply { actions() } AddScreenRobot(testRule).apply { actions() }
@ -22,7 +21,7 @@ class AddScreenRobot(private val testRule: ComposeTestRule) {
fun inputHost(host: String) = fun inputHost(host: String) =
testRule.onNodeWithContentDescription("Pi-hole host input").performTextInput(host) testRule.onNodeWithContentDescription("Pi-hole host input").performTextInput(host)
fun clickConnect() = testRule.onNode(hasTestTag(CONNECT_BUTTON_TAG)).performClick() fun clickConnect() = testRule.onNode(hasText("Connect")).performClick()
fun verifyErrorMessageIsDisplayed(message: String) { fun verifyErrorMessageIsDisplayed(message: String) {
testRule.waitUntil(2_000) { testRule.waitUntil(2_000) {

View file

@ -6,6 +6,7 @@ import android.net.NetworkCapabilities
import android.os.Build import android.os.Build
import android.widget.Toast import android.widget.Toast
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
@ -24,6 +25,7 @@ val emulatorBuildModels = listOf(
@Composable @Composable
fun AddScreen(store: Store) { fun AddScreen(store: Store) {
val state by store.state.collectAsState()
val effect by store.effects.collectAsState(initial = Effect.Empty) val effect by store.effects.collectAsState(initial = Effect.Empty)
val context = LocalContext.current val context = LocalContext.current
AddScreen( AddScreen(
@ -39,8 +41,7 @@ fun AddScreen(store: Store) {
connectivityManager.allNetworks connectivityManager.allNetworks
.filter { .filter {
connectivityManager.getNetworkCapabilities(it) connectivityManager.getNetworkCapabilities(it)
?.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) ?.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) == true
?: false
} }
.mapNotNull { network -> .mapNotNull { network ->
connectivityManager.getLinkProperties(network) connectivityManager.getLinkProperties(network)
@ -61,7 +62,7 @@ fun AddScreen(store: Store) {
connectToPihole = { connectToPihole = {
store.dispatch(Action.Connect(it)) store.dispatch(Action.Connect(it))
}, },
store.state.value.loading, state.loading,
error = effect as? Effect.Error error = effect as? Effect.Error
) )
} }

View file

@ -7,6 +7,7 @@ import android.view.View
import android.view.WindowInsetsController import android.view.WindowInsetsController
import android.view.animation.AnticipateInterpolator import android.view.animation.AnticipateInterpolator
import androidx.activity.compose.setContent import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.compose.animation.ExperimentalAnimationApi import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.foundation.isSystemInDarkTheme
@ -39,23 +40,8 @@ class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
installSplashScreen() installSplashScreen()
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent { setContent {
val isDarkTheme = isSystemInDarkTheme()
LaunchedEffect(key1 = isDarkTheme) {
if (isDarkTheme) return@LaunchedEffect
window.navigationBarColor =
ContextCompat.getColor(this@MainActivity, R.color.colorSurface)
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
window.insetsController?.setSystemBarsAppearance(
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS or WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS,
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS or WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS
)
} else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O) {
@Suppress("DEPRECATION")
window.decorView.systemUiVisibility =
View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR or View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
}
}
val launchIntent = remember { intent } val launchIntent = remember { intent }
LaunchedEffect(launchIntent) { LaunchedEffect(launchIntent) {
ShortcutActions.fromIntentAction(launchIntent.action)?.let { action -> ShortcutActions.fromIntentAction(launchIntent.action)?.let { action ->

View file

@ -4,19 +4,24 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.material.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import com.wbrawner.pihelper.shared.Store import com.wbrawner.pihelper.shared.Store
import com.wbrawner.pihelper.shared.ui.component.LoadingSpinner
import com.wbrawner.pihelper.shared.ui.theme.PihelperTheme import com.wbrawner.pihelper.shared.ui.theme.PihelperTheme
@Composable @Composable
fun ScanScreen(store: Store) { fun ScanScreen(store: Store) {
ScanningStatus(store.state.value.scanning?.let { "Scanning $it..." }) val state by store.state.collectAsState()
ScanningStatus(state.scanning?.let { "Scanning $it..." })
} }
@Composable @Composable

View file

@ -1,25 +1,12 @@
import java.net.URI plugins {
alias(libs.plugins.android.application) apply false
buildscript { alias(libs.plugins.android.library) apply false
repositories { alias(libs.plugins.kotlin.android) apply false
gradlePluginPortal() alias(libs.plugins.kotlin.jvm) apply false
google() alias(libs.plugins.kotlin.multiplatform) apply false
mavenCentral() alias(libs.plugins.kotlin.serialization) apply false
} alias(libs.plugins.compose) apply false
dependencies { alias(libs.plugins.jetbrainsCompose) apply false
classpath(libs.bundles.plugins) alias(libs.plugins.hilt.android) apply false
} alias(libs.plugins.kotlin.ksp) apply false
}
allprojects {
repositories {
google()
mavenCentral()
maven {
url = URI("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
maven {
url = URI("https://maven.pkg.jetbrains.space/public/p/compose/dev/")
}
}
} }

View file

@ -1,24 +1,27 @@
[versions] [versions]
androidx-core = "1.10.1" androidGradlePlugin = "8.7.2"
androidx-appcompat = "1.6.1" androidx-core = "1.15.0"
androidx-appcompat = "1.7.0"
androidx-splash = "1.0.1" androidx-splash = "1.0.1"
androidx-test-runner = "1.5.2" androidx-test-runner = "1.6.2"
androidx-test-orchestrator = "1.4.2" androidx-test-orchestrator = "1.5.1"
compose = "1.6.0" compose = "1.7.5"
compose-multiplatform = "1.7.1"
compose-compiler = "1.4.2" compose-compiler = "1.4.2"
compose-material = "1.5.0" compose-material = "1.7.5"
compose-material3 = "1.1.1" compose-material3 = "1.3.1"
espresso = "3.5.1" espresso = "3.6.1"
hilt-android = "2.44" hilt-android = "2.51.1"
kotlin = "1.9.22" kotlin = "2.0.21"
kotlinx-serialization = "1.4.1" kotlin-ksp = "2.0.21-1.0.28"
kotlinx-coroutines = "1.6.4" kotlinx-serialization = "1.6.3"
kotlinx-datetime = "0.4.0" kotlinx-coroutines = "1.9.0"
ktor = "2.1.2" kotlinx-datetime = "0.6.0"
material = "1.9.0" ktor = "2.3.12"
logbackClassic = "1.5.12"
material = "1.12.0"
maxSdk = "35" maxSdk = "35"
minSdk = "23" minSdk = "23"
navigation = "2.7.0"
okhttp = "4.10.0" okhttp = "4.10.0"
plausible = "0.1.0-SNAPSHOT" plausible = "0.1.0-SNAPSHOT"
settings = "0.8.1" settings = "0.8.1"
@ -26,7 +29,6 @@ versionCode = "5"
versionName = "1.1.1" versionName = "1.1.1"
[libraries] [libraries]
android-gradle = { module = "com.android.tools.build:gradle", version = "8.7.2" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" } androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }
androidx-core = { module = "androidx.core:core-ktx", version.ref = "androidx-core" } androidx-core = { module = "androidx.core:core-ktx", version.ref = "androidx-core" }
androidx-splash = { module = "androidx.core:core-splashscreen", version.ref = "androidx-splash" } androidx-splash = { module = "androidx.core:core-splashscreen", version.ref = "androidx-splash" }
@ -36,25 +38,17 @@ compose-activity = { module = "androidx.activity:activity-compose", version = "1
compose-material = { module = "androidx.compose.material:material", version.ref = "compose-material" } compose-material = { module = "androidx.compose.material:material", version.ref = "compose-material" }
compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "compose-material3" } compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "compose-material3" }
compose-material3-window = { module = "androidx.compose.material3:material3-window-size-class", version.ref = "compose-material3" } compose-material3-window = { module = "androidx.compose.material3:material3-window-size-class", version.ref = "compose-material3" }
compose-plugin-jetbrains = { module = "org.jetbrains.compose:compose-gradle-plugin", version.ref = "compose" }
compose-test-junit = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "compose" } compose-test-junit = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "compose" }
compose-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "compose" } compose-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "compose" }
compose-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" } compose-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" } compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
dagger-hilt = { module = "com.google.dagger:hilt-android-gradle-plugin", version.ref = "hilt-android" }
espresso = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso" } espresso = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso" }
hilt-android-core = { module = "com.google.dagger:hilt-android", version.ref = "hilt-android" } hilt-android-core = { module = "com.google.dagger:hilt-android", version.ref = "hilt-android" }
hilt-android-kapt = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt-android" } hilt-android-ksp = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt-android" }
hilt-android-testing = { module = "com.google.dagger:hilt-android-testing", version.ref = "hilt-android" } hilt-android-testing = { module = "com.google.dagger:hilt-android-testing", version.ref = "hilt-android" }
hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version = "1.0.0" } hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version = "1.2.0" }
junit = { module = "junit:junit", version = "4.13.2" } junit = { module = "junit:junit", version = "4.13.2" }
kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
ktor-client-ios = { module = "io.ktor:ktor-client-ios", version.ref = "ktor" }
ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" }
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" } ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
ktor-client-android = { module = "io.ktor:ktor-client-android", version.ref = "ktor" }
ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" } ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" }
ktor-client-serialization = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" } ktor-client-serialization = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" }
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" } ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
@ -63,14 +57,12 @@ kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-c
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" } kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-jvm = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "kotlinx-coroutines" } kotlinx-coroutines-jvm = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "kotlinx-coroutines" }
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" } kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" }
kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" } kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logbackClassic" }
material = { module = "com.google.android.material:material", version.ref = "material" } material = { module = "com.google.android.material:material", version.ref = "material" }
mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp" } mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp" }
multiplatform-settings = { module = "com.russhwolf:multiplatform-settings-no-arg", version.ref = "settings" } multiplatform-settings = { module = "com.russhwolf:multiplatform-settings-no-arg", version.ref = "settings" }
navigation-compose = { module = "androidx.navigation:navigation-compose", version = "navigation" } navigation-compose = { module = "androidx.navigation:navigation-compose", version = "navigation" }
navigation-fragment = { module = "androidx.navigation:navigation-fragment-ktx", version.ref = "navigation" }
navigation-ui = { module = "androidx.navigation:navigation-ui-ktx", version.ref = "navigation" }
plausible = { module = "com.wbrawner.plausible:plausible-android", version.ref = "plausible" } plausible = { module = "com.wbrawner.plausible:plausible-android", version.ref = "plausible" }
preference = { module = "androidx.preference:preference-ktx", version = "1.2.0" } preference = { module = "androidx.preference:preference-ktx", version = "1.2.0" }
test-ext = { module = "androidx.test.ext:junit", version = "1.1.5" } test-ext = { module = "androidx.test.ext:junit", version = "1.1.5" }
@ -78,4 +70,15 @@ test-ext = { module = "androidx.test.ext:junit", version = "1.1.5" }
[bundles] [bundles]
compose = ["compose-ui", "compose-material", "compose-material3", "compose-material3-window", "compose-tooling", "compose-activity", "navigation-compose"] compose = ["compose-ui", "compose-material", "compose-material3", "compose-material3-window", "compose-tooling", "compose-activity", "navigation-compose"]
coroutines = ["kotlinx-coroutines-core", "kotlinx-coroutines-android"] coroutines = ["kotlinx-coroutines-core", "kotlinx-coroutines-android"]
plugins = ["android-gradle", "compose-plugin-jetbrains", "kotlin-gradle", "dagger-hilt", "kotlin-serialization"]
[plugins]
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" }
compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-ksp = { id = "com.google.devtools.ksp", version.ref = "kotlin-ksp" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
hilt-android = { id = "com.google.dagger.hilt.android", version.ref = "hilt-android" }
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-multiplatform" }

View file

@ -1,4 +1,26 @@
import java.net.URI
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven {
url = URI("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
maven {
url = URI("https://maven.pkg.jetbrains.space/public/p/compose/dev/")
}
}
}
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
rootProject.name = "Pi-helper" rootProject.name = "Pi-helper"
include(":app") include(":app", ":desktop", ":shared")
include(":desktop")
include(":shared")

View file

@ -1,12 +1,13 @@
plugins { plugins {
kotlin("multiplatform") alias(libs.plugins.kotlin.multiplatform)
id("com.android.library") alias(libs.plugins.android.library)
kotlin("plugin.serialization") alias(libs.plugins.jetbrainsCompose)
id("org.jetbrains.compose") alias(libs.plugins.compose)
alias(libs.plugins.kotlin.serialization)
} }
kotlin { kotlin {
android() androidTarget()
listOf(iosArm64(), iosSimulatorArm64()).forEach { listOf(iosArm64(), iosSimulatorArm64()).forEach {
it.binaries.framework { it.binaries.framework {
baseName = "Pihelper" baseName = "Pihelper"
@ -30,13 +31,14 @@ kotlin {
api(compose.foundation) api(compose.foundation)
api(compose.material3) api(compose.material3)
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
implementation(compose.components.resources) api(compose.components.resources)
} }
} }
val androidMain by getting { val androidMain by getting {
dependencies { dependencies {
implementation(libs.plausible) implementation(libs.plausible)
api(compose.runtime)
} }
} }
@ -64,11 +66,10 @@ android {
compileSdk = libs.versions.maxSdk.get().toInt() compileSdk = libs.versions.maxSdk.get().toInt()
defaultConfig { defaultConfig {
minSdk = libs.versions.minSdk.get().toInt() minSdk = libs.versions.minSdk.get().toInt()
targetSdk = libs.versions.maxSdk.get().toInt()
} }
compileOptions { compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_21
} }
buildTypes { buildTypes {
release { release {

View file

@ -8,7 +8,7 @@ import androidx.compose.foundation.text.ClickableText
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material3.* import androidx.compose.material3.*
import androidx.compose.material3.TopAppBarDefaults.smallTopAppBarColors import androidx.compose.material3.TopAppBarDefaults.topAppBarColors
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
@ -37,7 +37,7 @@ fun InfoScreen(onBackClicked: () -> Unit, onForgetPiholeClicked: () -> Unit) {
Scaffold( Scaffold(
topBar = { topBar = {
TopAppBar( TopAppBar(
colors = smallTopAppBarColors( colors = topAppBarColors(
containerColor = MaterialTheme.colorScheme.surface containerColor = MaterialTheme.colorScheme.surface
), ),
title = { Text("About Pi-helper") }, title = { Text("About Pi-helper") },

View file

@ -11,7 +11,7 @@ import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Settings import androidx.compose.material.icons.filled.Settings
import androidx.compose.material3.* import androidx.compose.material3.*
import androidx.compose.material3.TopAppBarDefaults.smallTopAppBarColors import androidx.compose.material3.TopAppBarDefaults.topAppBarColors
import androidx.compose.runtime.* import androidx.compose.runtime.*
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
@ -67,7 +67,7 @@ fun MainScreen(
topBar = { topBar = {
TopAppBar( TopAppBar(
title = { Text("Pi-helper") }, title = { Text("Pi-helper") },
colors = smallTopAppBarColors( colors = topAppBarColors(
containerColor = MaterialTheme.colorScheme.background, containerColor = MaterialTheme.colorScheme.background,
titleContentColor = MaterialTheme.colorScheme.onBackground titleContentColor = MaterialTheme.colorScheme.onBackground
), ),
@ -109,7 +109,7 @@ fun MainScreen(
Text( Text(
color = MaterialTheme.colorScheme.primary, color = MaterialTheme.colorScheme.primary,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
text = "${it.message}" text = it.message
) )
} }
} }

View file

@ -10,9 +10,12 @@ import androidx.compose.ui.draw.rotate
import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.graphics.ColorFilter
import org.jetbrains.compose.resources.DrawableResource import org.jetbrains.compose.resources.DrawableResource
import org.jetbrains.compose.resources.ExperimentalResourceApi import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.InternalResourceApi
import org.jetbrains.compose.resources.painterResource import org.jetbrains.compose.resources.painterResource
import pi_helper.shared.generated.resources.Res
import pi_helper.shared.generated.resources.ic_app_logo
@OptIn(ExperimentalResourceApi::class) @OptIn(ExperimentalResourceApi::class, InternalResourceApi::class)
@Composable @Composable
fun LoadingSpinner(animate: Boolean = false) { fun LoadingSpinner(animate: Boolean = false) {
val animation = rememberInfiniteTransition() val animation = rememberInfiniteTransition()
@ -27,7 +30,7 @@ fun LoadingSpinner(animate: Boolean = false) {
) )
Image( Image(
modifier = Modifier.rotate(if (animate) rotation else 0f), modifier = Modifier.rotate(if (animate) rotation else 0f),
painter = painterResource(DrawableResource("img/ic_app_logo.xml")), painter = painterResource(Res.drawable.ic_app_logo),
contentDescription = "Loading", contentDescription = "Loading",
colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.onBackground) colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.onBackground)
) )

View file

@ -1,11 +0,0 @@
package com.wbrawner.pihelper.shared.ui.theme
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Shapes
import androidx.compose.ui.unit.dp
val Shapes = Shapes(
small = RoundedCornerShape(4.dp),
medium = RoundedCornerShape(4.dp),
large = RoundedCornerShape(0.dp)
)