diff --git a/.github/workflows/build_macos_binary.yml b/.github/workflows/build_macos_binary.yml
new file mode 100644
index 0000000..6765854
--- /dev/null
+++ b/.github/workflows/build_macos_binary.yml
@@ -0,0 +1,27 @@
+name: Build & Ship
+
+on:
+ workflow_dispatch:
+
+jobs:
+ desktop-build:
+ runs-on: macos-latest
+ timeout-minutes: 45
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: actions/setup-java@v4
+ with:
+ distribution: 'corretto'
+ java-version: '17'
+
+ - name: Build exe app
+ run: |
+ .\gradlew packageReleaseExe
+
+ - name: Archive Artifacts Release
+ uses: actions/upload-artifact@v4
+ with:
+ name: Windows Release
+ if-no-files-found: ignore
+ path: build/compose/binaries/main-release/dmg
\ No newline at end of file
diff --git a/.github/workflows/build_windows_binary.yml b/.github/workflows/build_windows_binary.yml
new file mode 100644
index 0000000..4966bd0
--- /dev/null
+++ b/.github/workflows/build_windows_binary.yml
@@ -0,0 +1,27 @@
+name: Build & Ship
+
+on:
+ workflow_dispatch:
+
+jobs:
+ desktop-build:
+ runs-on: windows-latest
+ timeout-minutes: 45
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: actions/setup-java@v4
+ with:
+ distribution: 'corretto'
+ java-version: '17'
+
+ - name: Build exe app
+ run: |
+ .\gradlew packageReleaseExe
+
+ - name: Archive Artifacts Release
+ uses: actions/upload-artifact@v4
+ with:
+ name: Windows Release
+ if-no-files-found: ignore
+ path: build/compose/binaries/main-release/exe
\ No newline at end of file
diff --git a/.github/workflows/pull_request_check.yaml b/.github/workflows/pull_request_check.yaml
index 37d4dfe..c8f08b6 100644
--- a/.github/workflows/pull_request_check.yaml
+++ b/.github/workflows/pull_request_check.yaml
@@ -15,7 +15,7 @@ jobs:
java-version: '17'
- uses: ruby/setup-ruby@v1
with:
- ruby-version: '3.0'
+ ruby-version: '3'
- name: Install danger
run: |
gem install danger danger-junit danger-checkstyle_format
diff --git a/.idea/AdbPad-develop.iml b/.idea/AdbPad-develop.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/.idea/AdbPad-develop.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/appInsightsSettings.xml b/.idea/appInsightsSettings.xml
new file mode 100644
index 0000000..f06b65e
--- /dev/null
+++ b/.idea/appInsightsSettings.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/artifacts/adbpad_jvm_1_3_0.xml b/.idea/artifacts/adbpad_jvm_1_3_0.xml
new file mode 100644
index 0000000..e7e1f78
--- /dev/null
+++ b/.idea/artifacts/adbpad_jvm_1_3_0.xml
@@ -0,0 +1,8 @@
+
+
+ $PROJECT_DIR$/build/libs
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/caches/deviceStreaming.xml b/.idea/caches/deviceStreaming.xml
new file mode 100644
index 0000000..b81700b
--- /dev/null
+++ b/.idea/caches/deviceStreaming.xml
@@ -0,0 +1,329 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index fa29266..77ef4f3 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -4,15 +4,16 @@
-
-
+
+
+
diff --git a/.idea/migrations.xml b/.idea/migrations.xml
new file mode 100644
index 0000000..f8051a6
--- /dev/null
+++ b/.idea/migrations.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index b0137f1..ac801d8 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,4 +1,3 @@
-
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..16660f1
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Dangerfile b/Dangerfile
index 7ee1a69..0266d6d 100644
--- a/Dangerfile
+++ b/Dangerfile
@@ -9,4 +9,4 @@ end
# Notify ktlint warning
checkstyle_format.base_path = Dir.pwd
-checkstyle_format.report 'build/reports/ktlint/ktlintJvmMainSourceSetCheck/ktlintJvmMainSourceSetCheck.xml'
\ No newline at end of file
+checkstyle_format.report 'build/reports/ktlint/ktlintJvmMainSourceSetCheck/ktlintJvmMainSourceSetCheck.xml'
diff --git a/build.gradle.kts b/build.gradle.kts
index cea47d0..ca04fa8 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,3 +1,5 @@
+import org.gradle.internal.impldep.org.junit.experimental.categories.Categories.CategoryFilter.exclude
+
plugins {
alias(libs.plugins.multiplatform)
alias(libs.plugins.compose)
@@ -7,7 +9,7 @@ plugins {
}
group = "jp.kaleidot725"
-version = "1.2.0"
+version = "1.3.0"
repositories {
mavenCentral()
@@ -18,11 +20,6 @@ repositories {
}
kotlin {
- jvmToolchain {
- vendor = JvmVendorSpec.JETBRAINS
- languageVersion = JavaLanguageVersion.of(17)
- }
-
jvm {
}
sourceSets {
@@ -36,12 +33,10 @@ kotlin {
implementation(libs.kotlinx.coroutines.swing)
implementation(libs.kotlin.serialization)
implementation(libs.koin)
- implementation(libs.jSystemThemeDetectorVer)
- implementation("org.jetbrains.jewel:jewel-int-ui-standalone-241:0.26.2")
- implementation("org.jetbrains.jewel:jewel-int-ui-decorated-window-241:0.26.2")
implementation(compose.desktop.currentOs) { exclude(group = "org.jetbrains.compose.material") }
implementation(libs.ktor.core)
implementation(libs.ktor.client.okhttp)
+ implementation(libs.jSystemThemeDetectorVer)
}
}
val jvmTest by getting {
@@ -55,6 +50,10 @@ kotlin {
compose.desktop {
application {
mainClass = "MainKt"
+ buildTypes.release {
+ proguard.isEnabled = false
+ }
+
nativeDistributions {
packageName = "AdbPad"
modules("jdk.management")
@@ -64,6 +63,11 @@ compose.desktop {
org.jetbrains.compose.desktop.application.dsl.TargetFormat.Dmg,
org.jetbrains.compose.desktop.application.dsl.TargetFormat.Msi,
org.jetbrains.compose.desktop.application.dsl.TargetFormat.Deb,
+ org.jetbrains.compose.desktop.application.dsl.TargetFormat.Exe,
+ )
+
+ jvmArgs(
+ "-Dapple.awt.application.appearance=NSAppearanceNameDarkAqua",
)
macOS {
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 07239ec..3f1c688 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -2,7 +2,7 @@
kotlin="2.0.21"
kotlin_coroutines="1.9.0"
kotlin_serialization="1.7.3"
-compose="1.7.0"
+compose="1.7.3"
ktlint_plugin="12.1.1"
adam="0.5.8"
junit="5.11.3"
diff --git a/src/jvmMain/compose-desktop.pro b/src/jvmMain/compose-desktop.pro
new file mode 100644
index 0000000..84f47f0
--- /dev/null
+++ b/src/jvmMain/compose-desktop.pro
@@ -0,0 +1,119 @@
+# 保留 Jetpack Compose 的编译器生成代码和注解
+-keep class androidx.compose.** { *; }
+-keep class androidx.lifecycle.** { *; }
+-keepattributes *Annotation*
+
+# 禁止混淆 Compose 的内联函数
+-keepclassmembers class ** {
+ @androidx.compose.runtime.Composable ;
+}
+
+# 保留 UI Preview 用于开发
+-keep class androidx.compose.ui.tooling.** { *; }
+
+# 保留 Kotlin 协程的内联函数和调试信息
+-keep class kotlinx.coroutines.** { *; }
+-keepattributes *Annotation*
+-keepclassmembers class **$* { *; }
+
+# 保留 Koin 的 DI 容器
+-keep class org.koin.** { *; }
+-keepclassmembers class org.koin.** { *; }
+
+# Room 的实体类和 DAO
+-keep @androidx.room.* class * { *; }
+-keep class androidx.room.** { *; }
+-keep interface androidx.room.** { *; }
+-keep class android.arch.** { *; }
+-keep @androidx.room.Entity class *
+-keep class androidx.sqlite.** { *; }
+
+
+
+# DataStore 相关规则
+-keep class androidx.datastore.** { *; }
+-keepattributes *Annotation*
+
+# 保留 Compose Multiplatform 的底层实现
+-keep class org.jetbrains.compose.** { *; }
+
+
+
+# ----------------------------------------- Basic ------------------------------------------------ #
+-keepattributes *Annotation*
+
+# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
+-keepclasseswithmembernames class * {
+ native ;
+}
+
+# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
+-keepclassmembers enum * {
+ public static **[] values();
+ public static ** valueOf(java.lang.String);
+}
+
+
+# ----------------------------------------- Okio ------------------------------------------------- #
+# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
+-dontwarn org.codehaus.mojo.animal_sniffer.*
+
+
+# ----------------------------------------- OkHttp ----------------------------------------------- #
+# JSR 305 annotations are for embedding nullability information.
+-dontwarn javax.annotation.**
+
+# A resource is loaded with a relative path so the package of this class must be preserved.
+-adaptresourcefilenames okhttp3/internal/publicsuffix/PublicSuffixDatabase.gz
+
+# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
+-dontwarn org.codehaus.mojo.animal_sniffer.*
+
+# OkHttp platform used only on JVM and when Conscrypt and other security providers are available.
+-dontwarn okhttp3.internal.platform.**
+-dontwarn org.conscrypt.**
+-dontwarn org.bouncycastle.**
+-dontwarn org.openjsse.**
+
+
+# ----------------------------------------- kotlinx serialization -------------------------------- #
+-keepattributes *Annotation*, InnerClasses
+-dontnote kotlinx.serialization.AnnotationsKt # core serialization annotations
+
+# kotlinx-serialization-json specific. Add this if you have java.lang.NoClassDefFoundError kotlinx.serialization.json.JsonObjectSerializer
+-keepclassmembers class kotlinx.serialization.json.** {
+ *** Companion;
+}
+-keepclasseswithmembers class kotlinx.serialization.json.** {
+ kotlinx.serialization.KSerializer serializer(...);
+}
+
+
+# ----------------------------------------- ktor ------------------------------------------------- #
+-keep class io.ktor.** { *; }
+-keepclassmembers class io.ktor.** { volatile ; }
+-keep class io.ktor.client.engine.cio.** { *; }
+-keep class kotlinx.coroutines.** { *; }
+-dontwarn kotlinx.atomicfu.**
+-dontwarn io.netty.**
+-dontwarn com.typesafe.**
+-dontwarn org.slf4j.**
+
+# Obfuscation breaks coroutines/ktor for some reason
+-dontobfuscate
+
+
+# ----------------------------------------- App Ruls --------------------------------------------- #
+# Change here com.github.panpf.sketch.sample
+-keepclassmembers @kotlinx.serialization.Serializable class com.github.panpf.sketch.sample.** {
+ # lookup for plugin generated serializable classes
+ *** Companion;
+ # lookup for serializable objects
+ *** INSTANCE;
+ kotlinx.serialization.KSerializer serializer(...);
+}
+# lookup for plugin generated serializable classes
+-if @kotlinx.serialization.Serializable class com.github.panpf.sketch.sample.**
+-keepclassmembers class com.github.panpf.sketch.sample.<1>$Companion {
+ kotlinx.serialization.KSerializer serializer(...);
+}
\ No newline at end of file
diff --git a/src/jvmMain/kotlin/jp/kaleidot725/adbpad/Main.kt b/src/jvmMain/kotlin/jp/kaleidot725/adbpad/Main.kt
index 9c39527..a8ee73e 100644
--- a/src/jvmMain/kotlin/jp/kaleidot725/adbpad/Main.kt
+++ b/src/jvmMain/kotlin/jp/kaleidot725/adbpad/Main.kt
@@ -4,16 +4,17 @@ import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentSize
+import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Colors
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
-import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.RestartAlt
import androidx.compose.runtime.Composable
@@ -28,12 +29,12 @@ import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.rotate
-import androidx.compose.ui.graphics.Color
import androidx.compose.ui.input.pointer.PointerEventType
import androidx.compose.ui.input.pointer.onPointerEvent
import androidx.compose.ui.res.painterResource
-import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
+import androidx.compose.ui.window.Window
+import androidx.compose.ui.window.WindowScope
import androidx.compose.ui.window.WindowState
import androidx.compose.ui.window.application
import jp.kaleidot725.adbpad.MainCategory
@@ -44,7 +45,6 @@ import jp.kaleidot725.adbpad.domain.model.Dialog
import jp.kaleidot725.adbpad.domain.model.UserColor
import jp.kaleidot725.adbpad.domain.model.device.Device
import jp.kaleidot725.adbpad.domain.model.language.Language
-import jp.kaleidot725.adbpad.domain.model.log.Event
import jp.kaleidot725.adbpad.domain.model.setting.WindowSize
import jp.kaleidot725.adbpad.domain.model.setting.getWindowSize
import jp.kaleidot725.adbpad.repository.di.repositoryModule
@@ -59,19 +59,6 @@ import jp.kaleidot725.adbpad.ui.screen.screenshot.ScreenshotScreen
import jp.kaleidot725.adbpad.ui.screen.setting.SettingScreen
import jp.kaleidot725.adbpad.ui.screen.setting.SettingStateHolder
import jp.kaleidot725.adbpad.ui.screen.text.TextCommandScreen
-import org.jetbrains.jewel.foundation.theme.JewelTheme
-import org.jetbrains.jewel.intui.standalone.theme.IntUiTheme
-import org.jetbrains.jewel.intui.standalone.theme.darkThemeDefinition
-import org.jetbrains.jewel.intui.standalone.theme.lightThemeDefinition
-import org.jetbrains.jewel.intui.window.decoratedWindow
-import org.jetbrains.jewel.intui.window.styling.dark
-import org.jetbrains.jewel.intui.window.styling.light
-import org.jetbrains.jewel.ui.ComponentStyling
-import org.jetbrains.jewel.window.DecoratedWindow
-import org.jetbrains.jewel.window.DecoratedWindowScope
-import org.jetbrains.jewel.window.TitleBar
-import org.jetbrains.jewel.window.newFullscreenControls
-import org.jetbrains.jewel.window.styling.TitleBarStyle
import org.koin.core.context.GlobalContext
import org.koin.core.context.startKoin
@@ -92,32 +79,15 @@ fun main() {
mutableStateOf(WindowState(width = state.size.width.dp, height = state.size.height.dp))
}
- MaterialTheme(colors = if (state.isDark) DarkColors else LightColors) {
- IntUiTheme(
- theme =
- if (state.isDark) {
- JewelTheme.darkThemeDefinition()
- } else {
- JewelTheme.lightThemeDefinition()
- },
- styling =
- if (state.isDark) {
- ComponentStyling.decoratedWindow(titleBarStyle = TitleBarStyle.dark())
- } else {
- ComponentStyling.decoratedWindow(titleBarStyle = TitleBarStyle.light())
- },
- ) {
- DecoratedWindow(
+ val isDark = state.isDark
+ if (isDark != null) {
+ MaterialTheme(colors = if (isDark) DarkColors else LightColors) {
+ Window(
title = Language.windowTitle,
icon = painterResource("icon.png"),
onCloseRequest = ::exitApplication,
state = windowState,
) {
- TitleBarView(
- state = state,
- onSelectDevice = mainStateHolder::selectDevice,
- onRefresh = mainStateHolder::refresh,
- )
App(mainStateHolder)
}
}
@@ -125,59 +95,8 @@ fun main() {
}
}
-@OptIn(ExperimentalComposeUiApi::class)
@Composable
-fun DecoratedWindowScope.TitleBarView(
- state: MainState,
- onSelectDevice: (Device) -> Unit,
- onRefresh: () -> Unit,
-) {
- TitleBar(
- style = TitleBarStyle.dark(),
- modifier = Modifier.newFullscreenControls(),
- ) {
- Row(Modifier.align(Alignment.Start).wrapContentSize()) {
- DropDownDeviceMenu(
- devices = state.devices,
- selectedDevice = state.selectedDevice,
- onSelectDevice = onSelectDevice,
- modifier = Modifier.width(200.dp),
- )
- }
-
- Text(
- text = title,
- color = Color.White,
- textAlign = TextAlign.Center,
- )
-
- Row(Modifier.align(Alignment.End).wrapContentSize().padding(4.dp)) {
- var isPress: Boolean by remember { mutableStateOf(false) }
- val degrees: Float by animateFloatAsState(if (isPress) -90f else 0f)
- Box(
- modifier =
- Modifier
- .size(28.dp)
- .clip(RoundedCornerShape(4.dp))
- .clickableBackground(isDarker = true)
- .onPointerEvent(PointerEventType.Press) { isPress = true }
- .onPointerEvent(PointerEventType.Release) { isPress = false }
- .clickable { onRefresh() },
- ) {
- Icon(
- imageVector = Icons.Default.RestartAlt,
- tint = Color.White,
- contentDescription = null,
- modifier = Modifier.rotate(degrees).align(Alignment.Center),
- )
- }
- }
- }
-}
-
-@Composable
-fun DecoratedWindowScope.App(mainStateHolder: MainStateHolder) {
- val event by mainStateHolder.event.collectAsState(Event.NULL)
+fun WindowScope.App(mainStateHolder: MainStateHolder) {
val state by mainStateHolder.state.collectAsState()
val decoratedWindowScope = this
@@ -192,6 +111,13 @@ fun DecoratedWindowScope.App(mainStateHolder: MainStateHolder) {
Crossfade(state.language) {
Surface {
ScreenLayout(
+ top = {
+ TitleBarView(
+ state = state,
+ onSelectDevice = mainStateHolder::selectDevice,
+ onRefresh = mainStateHolder::refresh,
+ )
+ },
navigationRail = {
NavigationRail(
category = state.category,
@@ -321,6 +247,52 @@ fun DecoratedWindowScope.App(mainStateHolder: MainStateHolder) {
}
}
+@OptIn(ExperimentalComposeUiApi::class)
+@Composable
+private fun TitleBarView(
+ state: MainState,
+ onSelectDevice: (Device) -> Unit,
+ onRefresh: () -> Unit,
+) {
+ Surface(
+ color = MaterialTheme.colors.background,
+ modifier = Modifier.fillMaxWidth(),
+ ) {
+ Box {
+ Row(Modifier.align(Alignment.CenterStart).wrapContentSize()) {
+ DropDownDeviceMenu(
+ devices = state.devices,
+ selectedDevice = state.selectedDevice,
+ onSelectDevice = onSelectDevice,
+ modifier = Modifier.wrapContentWidth(),
+ )
+ }
+
+ Row(Modifier.align(Alignment.CenterEnd).wrapContentSize().padding(4.dp)) {
+ var isPress: Boolean by remember { mutableStateOf(false) }
+ val degrees: Float by animateFloatAsState(if (isPress) -90f else 0f)
+ Box(
+ modifier =
+ Modifier
+ .size(28.dp)
+ .clip(RoundedCornerShape(4.dp))
+ .clickableBackground(isDarker = true)
+ .onPointerEvent(PointerEventType.Press) { isPress = true }
+ .onPointerEvent(PointerEventType.Release) { isPress = false }
+ .clickable { onRefresh() },
+ ) {
+ Icon(
+ imageVector = Icons.Default.RestartAlt,
+ tint = MaterialTheme.colors.onBackground,
+ contentDescription = null,
+ modifier = Modifier.rotate(degrees).align(Alignment.Center),
+ )
+ }
+ }
+ }
+ }
+}
+
private val LightColors =
Colors(
primary = UserColor.Light.PRIMARY,
diff --git a/src/jvmMain/kotlin/jp/kaleidot725/adbpad/MainState.kt b/src/jvmMain/kotlin/jp/kaleidot725/adbpad/MainState.kt
index 794bb92..912b629 100644
--- a/src/jvmMain/kotlin/jp/kaleidot725/adbpad/MainState.kt
+++ b/src/jvmMain/kotlin/jp/kaleidot725/adbpad/MainState.kt
@@ -7,7 +7,7 @@ import jp.kaleidot725.adbpad.domain.model.setting.WindowSize
data class MainState(
val language: Language.Type = Language.Type.ENGLISH,
- val isDark: Boolean = false,
+ val isDark: Boolean? = null,
val size: WindowSize = WindowSize.UNKNOWN,
val dialog: Dialog? = null,
val category: MainCategory = MainCategory.Command,
diff --git a/src/jvmMain/kotlin/jp/kaleidot725/adbpad/MainStateHolder.kt b/src/jvmMain/kotlin/jp/kaleidot725/adbpad/MainStateHolder.kt
index 1d280e3..b651b67 100644
--- a/src/jvmMain/kotlin/jp/kaleidot725/adbpad/MainStateHolder.kt
+++ b/src/jvmMain/kotlin/jp/kaleidot725/adbpad/MainStateHolder.kt
@@ -3,13 +3,11 @@ package jp.kaleidot725.adbpad
import jp.kaleidot725.adbpad.domain.model.Dialog
import jp.kaleidot725.adbpad.domain.model.device.Device
import jp.kaleidot725.adbpad.domain.model.language.Language
-import jp.kaleidot725.adbpad.domain.model.log.Event
import jp.kaleidot725.adbpad.domain.model.setting.WindowSize
import jp.kaleidot725.adbpad.domain.usecase.adb.StartAdbUseCase
import jp.kaleidot725.adbpad.domain.usecase.device.GetSelectedDeviceFlowUseCase
import jp.kaleidot725.adbpad.domain.usecase.device.SelectDeviceUseCase
import jp.kaleidot725.adbpad.domain.usecase.device.UpdateDevicesUseCase
-import jp.kaleidot725.adbpad.domain.usecase.event.GetEventFlowUseCase
import jp.kaleidot725.adbpad.domain.usecase.language.GetLanguageUseCase
import jp.kaleidot725.adbpad.domain.usecase.refresh.RefreshUseCase
import jp.kaleidot725.adbpad.domain.usecase.theme.GetDarkModeFlowUseCase
@@ -26,7 +24,6 @@ import kotlinx.coroutines.Job
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableStateFlow
-import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
@@ -40,7 +37,6 @@ class MainStateHolder(
val commandStateHolder: CommandStateHolder,
val textCommandStateHolder: TextCommandStateHolder,
val screenshotStateHolder: ScreenshotStateHolder,
- private val getEventFlowUseCase: GetEventFlowUseCase,
private val getWindowSizeUseCase: GetWindowSizeUseCase,
private val saveWindowSizeUseCase: SaveWindowSizeUseCase,
private val startAdbUseCase: StartAdbUseCase,
@@ -54,7 +50,7 @@ class MainStateHolder(
private val coroutineScope: CoroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Main + Dispatchers.IO)
private val language: MutableStateFlow = MutableStateFlow(Language.Type.ENGLISH)
private val windowSize: MutableStateFlow = MutableStateFlow(WindowSize.UNKNOWN)
- private val isDark: MutableStateFlow = MutableStateFlow(true)
+ private val isDark: MutableStateFlow = MutableStateFlow(null)
private val dialog: MutableStateFlow