chore: update dependencies

This commit is contained in:
rushiiMachine 2025-05-17 12:14:06 -07:00
parent 5a226ee602
commit 85dfb2962d
No known key found for this signature in database
GPG key ID: DCBE5952BB3B6420
8 changed files with 66 additions and 72 deletions

View file

@ -15,11 +15,11 @@ val gitHasHasLocalChanges = providers.execIgnoreCode("git", "status", "-s").isNo
android {
namespace = "com.aliucord.manager"
compileSdk = 35
compileSdk = 36
defaultConfig {
minSdk = 24
targetSdk = 35
targetSdk = 36
versionCode = 1
versionName = "0.0.1"

View file

@ -12,8 +12,10 @@ import androidx.compose.ui.tooling.preview.*
import androidx.core.graphics.drawable.toBitmap
import com.aliucord.manager.R
import com.aliucord.manager.ui.components.ManagerTheme
import com.aliucord.manager.ui.screens.iconopts.*
import com.aliucord.manager.ui.screens.iconopts.IconOptionsMode
import com.aliucord.manager.ui.screens.iconopts.IconOptionsScreenContent
import com.aliucord.manager.ui.screens.patchopts.PatchOptions.IconReplacement
import dev.zt64.compose.pipette.HsvColor
import java.io.ByteArrayOutputStream
// This preview has scrollable/interactable content that cannot be properly tested from an IDE preview
@ -26,11 +28,11 @@ private fun IconOptionsScreenPreview(
parameters: IconOptionsParameters,
) {
var mode by remember { mutableStateOf(parameters.mode) }
var color by remember { mutableStateOf(parameters.selectedColor.toHSVState()) }
var color by remember { mutableStateOf(HsvColor(parameters.selectedColor)) }
DisposableEffect(parameters) {
mode = parameters.mode
color = parameters.selectedColor.toHSVState()
color = HsvColor(parameters.selectedColor)
onDispose {}
}
@ -41,6 +43,7 @@ private fun IconOptionsScreenPreview(
mode = mode,
setMode = { mode = it },
selectedColor = color,
setSelectedColor = { color = it },
selectedImage = { image },
setSelectedImage = {},
)

View file

@ -1,27 +0,0 @@
package com.aliucord.manager.ui.screens.iconopts
import androidx.compose.runtime.*
import androidx.compose.ui.graphics.Color
import dev.zt64.compose.pipette.util.*
@Stable
class HSVColorState(
hue: Float,
saturation: Float,
value: Float,
) {
var hue by mutableFloatStateOf(hue)
var saturation by mutableFloatStateOf(saturation)
var value by mutableFloatStateOf(value)
fun toARGB(): Color = Color.hsv(hue, saturation, value)
override fun toString(): String = "HSVColorState($hue, $saturation, $value)"
}
fun Color.toHSVState(): HSVColorState {
return HSVColorState(
hue = this.hue,
saturation = this.saturation,
value = this.hsvValue,
)
}

View file

@ -13,6 +13,7 @@ import com.aliucord.manager.R
import com.aliucord.manager.ui.screens.patchopts.PatchOptions.IconReplacement
import com.aliucord.manager.util.launchBlock
import com.aliucord.manager.util.showToast
import dev.zt64.compose.pipette.HsvColor
import java.io.IOException
class IconOptionsModel(
@ -28,11 +29,15 @@ class IconOptionsModel(
}
// ---------- Replacement color ---------- //
var selectedColor by mutableStateOf<HSVColorState>(IconReplacement.Aliucord.color.toHSVState())
var selectedColor by mutableStateOf(HsvColor(IconReplacement.Aliucord.color))
private set
fun initSelectedColor(color: Color) {
selectedColor = color.toHSVState()
fun changeSelectedColor(color: HsvColor) {
selectedColor = color
}
private fun initSelectedColor(color: Color) {
selectedColor = HsvColor(color)
}
// ---------- Replacement color ---------- //
@ -92,7 +97,7 @@ class IconOptionsModel(
fun generateConfig(): IconReplacement = when (mode) {
IconOptionsMode.Original -> IconReplacement.Original
IconOptionsMode.Aliucord -> IconReplacement.Aliucord
IconOptionsMode.CustomColor -> IconReplacement.CustomColor(color = selectedColor.toARGB())
IconOptionsMode.CustomColor -> IconReplacement.CustomColor(color = selectedColor.toColor())
IconOptionsMode.CustomImage -> IconReplacement.CustomImage(
imageBytes = selectedImage ?: throw IllegalStateException("Cannot generate config without a selected image"),
)

View file

@ -29,7 +29,7 @@ import com.aliucord.manager.ui.components.*
import com.aliucord.manager.ui.screens.iconopts.components.*
import com.aliucord.manager.ui.util.ColorSaver
import dev.zt64.compose.pipette.CircularColorPicker
import dev.zt64.compose.pipette.util.*
import dev.zt64.compose.pipette.HsvColor
import kotlinx.parcelize.IgnoredOnParcel
import kotlinx.parcelize.Parcelize
@ -57,6 +57,7 @@ class IconOptionsScreen(
mode = model.mode,
setMode = model::changeMode,
selectedColor = model.selectedColor,
setSelectedColor = model::changeSelectedColor,
selectedImage = { model.selectedImage },
setSelectedImage = model::changeSelectedImageUri,
)
@ -67,7 +68,8 @@ class IconOptionsScreen(
fun IconOptionsScreenContent(
mode: IconOptionsMode,
setMode: (IconOptionsMode) -> Unit,
selectedColor: HSVColorState,
selectedColor: HsvColor,
setSelectedColor: (HsvColor) -> Unit,
selectedImage: () -> ByteArray?,
setSelectedImage: (Uri) -> Unit,
) {
@ -118,7 +120,10 @@ fun IconOptionsScreenContent(
enter = fadeIn(tween(delayMillis = 250)),
exit = fadeOut(tween(durationMillis = 200)),
) {
CustomColorOptions(selectedColor)
CustomColorOptions(
color = selectedColor,
setColor = setSelectedColor,
)
}
AnimatedVisibility(
@ -136,11 +141,14 @@ fun IconOptionsScreenContent(
}
@Composable
private fun CustomColorOptions(color: HSVColorState) {
private fun CustomColorOptions(
color: HsvColor,
setColor: (HsvColor) -> Unit,
) {
// This color is separated from the live color and intentionally lags behind while the RGBTextField is being edited.
// When this changes, then the text inside the RGBTextField is reset to the fully formatted color.
// As such, this only happens when the color is changed via the other color pickers.
var initialRGBFieldColor by rememberSaveable(stateSaver = ColorSaver) { mutableStateOf(color.toARGB()) }
var initialRGBFieldColor by rememberSaveable(stateSaver = ColorSaver) { mutableStateOf(color.toColor()) }
Column(
verticalArrangement = Arrangement.spacedBy(30.dp),
@ -156,9 +164,10 @@ private fun CustomColorOptions(color: HSVColorState) {
saturation = color.saturation,
value = color.value,
onColorChange = { hue, saturation ->
color.hue = hue
color.saturation = saturation
initialRGBFieldColor = color.toARGB()
color.copy(hue = hue, saturation = saturation).let {
setColor(it)
initialRGBFieldColor = it.toColor()
}
},
modifier = Modifier
.padding(top = 12.dp)
@ -173,9 +182,11 @@ private fun CustomColorOptions(color: HSVColorState) {
) {
InteractiveSlider(
value = color.value,
onValueChange = {
color.value = it
initialRGBFieldColor = color.toARGB()
onValueChange = { value ->
color.copy(value = value).let {
setColor(it)
initialRGBFieldColor = it.toColor()
}
},
valueRange = 0f..1f,
brush = Brush.horizontalGradient(
@ -184,7 +195,7 @@ private fun CustomColorOptions(color: HSVColorState) {
Color.hsv(color.hue, color.saturation, 1f)
),
),
thumbColor = color.toARGB(),
thumbColor = color.toColor(),
)
}
@ -194,11 +205,7 @@ private fun CustomColorOptions(color: HSVColorState) {
) {
RGBTextField(
initialColor = initialRGBFieldColor,
setColor = {
color.hue = it.hue
color.saturation = it.saturation
color.value = it.hsvValue
},
setColor = { setColor(HsvColor(it)) },
modifier = Modifier.padding(top = 12.dp),
)
}

View file

@ -5,6 +5,12 @@ import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.runtime.Stable
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.LayoutDirection
import com.aliucord.manager.ui.util.paddings.PaddingValuesSides.Companion.Bottom
import com.aliucord.manager.ui.util.paddings.PaddingValuesSides.Companion.End
import com.aliucord.manager.ui.util.paddings.PaddingValuesSides.Companion.Left
import com.aliucord.manager.ui.util.paddings.PaddingValuesSides.Companion.Right
import com.aliucord.manager.ui.util.paddings.PaddingValuesSides.Companion.Start
import com.aliucord.manager.ui.util.paddings.PaddingValuesSides.Companion.Top
/**
* Remove particular side values from [PaddingValues].

View file

@ -3,6 +3,7 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# Android
android.useAndroidX=true
android.enableR8.fullMode=true
android.javaCompile.suppressSourceTargetDeprecationWarning=true
# Kotlin
kotlin.code.style=official

View file

@ -1,30 +1,29 @@
[versions]
accompanist = "0.37.0"
agp = "8.7.3" # 8.8 breaks proguard
androidx-activity = "1.10.0"
androidx-core = "1.15.0"
accompanist = "0.37.3"
agp = "8.10.0"
androidx-activity = "1.10.1"
androidx-core = "1.16.0"
androidx-splashscreen = "1.0.1"
androidx-lifecycle = "2.8.7"
apksig = "8.8.0"
androidx-lifecycle = "2.9.0"
apksig = "8.10.0"
axml = "1.0.1"
binary-resources = "2.0.0"
bouncycastle = "1.80"
coil = "3.1.0"
compose = "1.7.7"
compose-tracing = "1.7.7"
compose-material3 = "1.3.1"
compose-pipette = "1.0.0-beta01"
coil = "3.2.0"
compose = "1.8.1"
compose-material3 = "1.3.2"
compose-pipette = "1.0.1"
#diff = "4.12"
koin = "4.0.2"
kotlin = "2.1.10"
koin = "4.0.4"
kotlin = "2.1.21"
kotlinx-datetime = "0.6.2"
kotlinx-immutable = "0.3.8"
kotlinx-serialization = "1.8.0"
ktor = "3.0.3"
kotlinx-immutable = "0.4.0"
kotlinx-serialization = "1.8.1"
ktor = "3.1.3"
microg = "0.3.6.244735"
shimmer = "1.3.2"
smali = "3.0.9"
voyager = "1.0.1"
voyager = "1.1.0-beta03"
zip = "2.2.0"
[libraries]
@ -52,8 +51,8 @@ compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref =
compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "compose-material3" }
# Compose debug tooling
compose-runtime-tracing = { module = "androidx.compose.runtime:runtime-tracing", version.ref = "compose" }
compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" }
compose-runtime-tracing = { module = "androidx.compose.runtime:runtime-tracing", version.ref = "compose-tracing" }
# Extra compose libs
compose-pipette = { module = "dev.zt64.compose.pipette:compose-pipette", version.ref = "compose-pipette" }
@ -86,7 +85,7 @@ axml = { module = "com.aliucord:axml", version.ref = "axml" }
binaryResources = { module = "com.aliucord:binary-resources", version.ref = "binary-resources" }
bouncycastle = { module = "org.bouncycastle:bcpkix-jdk18on", version.ref = "bouncycastle" }
#diff = { module = "io.github.java-diff-utils:java-diff-utils", version.ref = "diff" }
diff = "com.github.Aliucord:java-diff-utils:a0002d1d40" # TODO: remove when https://github.com/java-diff-utils/java-diff-utils/pull/198 is merged
diff = "com.github.Aliucord:java-diff-utils:a0002d1d40" # TODO: remove when https://github.com/java-diff-utils/java-diff-utils/pull/198 is released
smali = { module = "com.android.tools.smali:smali", version.ref = "smali" }
baksmali = { module = "com.android.tools.smali:smali-baksmali", version.ref = "smali" }
zip = { module = "io.github.diamondminer88:zip-android", version.ref = "zip" } # Only use the "aar" artifact