Compare commits
3 commits
9febeae894
...
54fb000cc8
Author | SHA1 | Date | |
---|---|---|---|
54fb000cc8 | |||
0b26a16f1f | |||
dba5313c74 |
7 changed files with 16 additions and 57 deletions
|
@ -16,7 +16,18 @@ object PiHelperModule {
|
|||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun providesAnalyticsHelper(): AnalyticsHelper = PlausibleAnalyticsHelper
|
||||
fun providesAnalyticsHelper(): AnalyticsHelper = object : AnalyticsHelper {
|
||||
override fun pageView(route: Route) {
|
||||
// Not implemented
|
||||
}
|
||||
|
||||
override fun event(
|
||||
event: AnalyticsEvent,
|
||||
route: Route
|
||||
) {
|
||||
// Not implemented
|
||||
}
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
|
|
|
@ -7,6 +7,4 @@
|
|||
<string name="action_disable_30_seconds_short">Disable for 30 seconds</string>
|
||||
<string name="action_disable_5_minutes">Disable for 5 minutes</string>
|
||||
<string name="action_disable_5_minutes_short">Disable for 5 minutes</string>
|
||||
<string name="plausible_domain">pihelper.android.wbrawner.com</string>
|
||||
<string name="plausible_host">https://plausible.wbrawner.com</string>
|
||||
</resources>
|
||||
|
|
|
@ -1,38 +1,15 @@
|
|||
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("org.jetbrains.compose")
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
alias(libs.plugins.compose)
|
||||
alias(libs.plugins.jetbrainsCompose)
|
||||
java
|
||||
}
|
||||
|
||||
group = "com.wbrawner.pihelper"
|
||||
version = "1.0-SNAPSHOT"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
|
||||
google()
|
||||
}
|
||||
|
||||
val osName = System.getProperty("os.name")
|
||||
val targetOs = when {
|
||||
osName == "Mac OS X" -> "macos"
|
||||
osName.startsWith("Win") -> "windows"
|
||||
osName.startsWith("Linux") -> "linux"
|
||||
else -> error("Unsupported OS: $osName")
|
||||
}
|
||||
|
||||
val targetArch = when (val osArch = System.getProperty("os.arch")) {
|
||||
"x86_64", "amd64" -> "x64"
|
||||
"aarch64" -> "arm64"
|
||||
else -> error("Unsupported arch: $osArch")
|
||||
}
|
||||
|
||||
val skikoVersion = "0.7.77" // or any more recent version
|
||||
val target = "${targetOs}-${targetArch}"
|
||||
|
||||
|
||||
dependencies {
|
||||
// Note, if you develop a library, you should use compose.desktop.common.
|
||||
// compose.desktop.currentOs should be used in launcher-sourceSet
|
||||
|
@ -40,9 +17,8 @@ dependencies {
|
|||
// With compose.desktop.common you will also lose @Preview functionality
|
||||
implementation(project(":shared"))
|
||||
implementation(compose.desktop.currentOs)
|
||||
// implementation("org.jetbrains.skiko:skiko-awt-runtime-$target:$skikoVersion")
|
||||
implementation(libs.kotlinx.coroutines.jvm)
|
||||
implementation("ch.qos.logback:logback-classic:1.4.5")
|
||||
implementation(libs.logback.classic)
|
||||
}
|
||||
|
||||
compose.desktop {
|
||||
|
|
|
@ -23,7 +23,6 @@ material = "1.12.0"
|
|||
maxSdk = "35"
|
||||
minSdk = "23"
|
||||
okhttp = "4.10.0"
|
||||
plausible = "0.1.0-SNAPSHOT"
|
||||
settings = "0.8.1"
|
||||
versionCode = "5"
|
||||
versionName = "1.1.1"
|
||||
|
@ -63,7 +62,6 @@ material = { module = "com.google.android.material:material", version.ref = "mat
|
|||
mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp" }
|
||||
multiplatform-settings = { module = "com.russhwolf:multiplatform-settings-no-arg", version.ref = "settings" }
|
||||
navigation-compose = { module = "androidx.navigation:navigation-compose", version = "navigation" }
|
||||
plausible = { module = "com.wbrawner.plausible:plausible-android", version.ref = "plausible" }
|
||||
preference = { module = "androidx.preference:preference-ktx", version = "1.2.0" }
|
||||
test-ext = { module = "androidx.test.ext:junit", version = "1.1.5" }
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ kotlin {
|
|||
|
||||
val androidMain by getting {
|
||||
dependencies {
|
||||
implementation(libs.plausible)
|
||||
api(compose.runtime)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
package com.wbrawner.pihelper.shared
|
||||
|
||||
import com.wbrawner.plausible.android.Plausible
|
||||
|
||||
object PlausibleAnalyticsHelper : AnalyticsHelper {
|
||||
override fun pageView(route: Route) {
|
||||
Plausible.pageView(route.path)
|
||||
}
|
||||
|
||||
override fun event(event: AnalyticsEvent, route: Route) {
|
||||
val props = when (event) {
|
||||
is AnalyticsEvent.DisableButtonClicked -> mapOf("duration" to event.duration)
|
||||
is AnalyticsEvent.LinkClicked -> mapOf("link" to event.link)
|
||||
else -> null
|
||||
}
|
||||
Plausible.event(event.name, route.path, props = props)
|
||||
}
|
||||
}
|
|
@ -104,11 +104,6 @@ fun InfoScreen(onBackClicked: () -> Unit, onForgetPiholeClicked: () -> Unit) {
|
|||
) {
|
||||
message.getStringAnnotations(it, it).firstOrNull()?.let { annotation ->
|
||||
uriHandler.openUri(annotation.item)
|
||||
// TODO: Move this to the store?
|
||||
// PlausibleAnalyticsHelper.event(
|
||||
// AnalyticsEvent.LinkClicked(annotation.item),
|
||||
// Route.ABOUT
|
||||
// )
|
||||
}
|
||||
}
|
||||
TextButton(onClick = onForgetPiholeClicked) {
|
||||
|
|
Loading…
Reference in a new issue