Skip to content

Commit f859d3c

Browse files
authored
Merge pull request #99 from xLexip/develop
Stable Release (v1.0.0)
2 parents adc4bc5 + 95c5068 commit f859d3c

File tree

3 files changed

+29
-11
lines changed

3 files changed

+29
-11
lines changed

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ life**.
1919
## 🚀 Quick Start (2 minutes)
2020

2121
1. **Install** Adaptive Theme.
22-
2. **Grant the permission** with our [web-tool](https://lexip.dev/setup), Shizuku, or other methods
22+
2. **Grant the permission** with a [web-tool](https://lexip.dev/setup), Shizuku, or other methods
2323
below.
2424
3. **Pick your lux threshold** and you’re done. ✅
2525

@@ -56,20 +56,19 @@ permission (`WRITE_SECURE_SETTINGS`) has to be granted.
5656
The app comes with an easy step-by-step setup process, that lets you choose one of the following
5757
methods to do so:
5858

59-
* Web Tool (Recommended) – Use our browser-based setup tool on a secondary device (Computer, Tablet,
60-
or Phone). No code or ADB
61-
installation required (WebADB).
62-
👉 **[lexip.dev/setup](https://lexip.dev/setup)**
59+
* **Web Tool (Recommended)** – Use our browser-based setup tool on a secondary device (Computer,
60+
Tablet,
61+
or Phone). No code or ADB
62+
installation required (WebADB).
63+
👉 **[lexip.dev/setup](https://lexip.dev/setup)**
6364

6465
* **Shizuku** – If you have **[Shizuku](https://github.com/RikkaApps/Shizuku)** installed and
6566
configured, you can
6667
grant the permission directly within the Adaptive Theme app.
6768

6869
* **Root** – If your device is rooted, you can grant the permission with one tap inside the app.
6970

70-
* **Manual ADB** – If you have ADB installed on your computer, you can run the ADB grant
71-
command manually via your
72-
terminal.
71+
* **Manual ADB** – If you have ADB installed on your computer, you can run the ADB command manually.
7372

7473
## ⚙️ How it Works
7574

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ android {
1616
applicationId = "dev.lexip.hecate"
1717
minSdk = 34
1818
targetSdk = 35
19-
versionCode = 93
20-
versionName = "0.12.2"
19+
versionCode = 97
20+
versionName = "1.0.0"
2121
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2222
}
2323

app/src/main/kotlin/dev/lexip/hecate/ui/MainScreen.kt

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import android.content.ClipboardManager
1818
import android.content.pm.PackageManager
1919
import android.widget.Toast
2020
import androidx.compose.animation.AnimatedVisibility
21+
import androidx.compose.animation.core.Animatable
22+
import androidx.compose.animation.core.tween
2123
import androidx.compose.animation.fadeIn
2224
import androidx.compose.animation.fadeOut
2325
import androidx.compose.animation.slideInVertically
@@ -27,6 +29,7 @@ import androidx.compose.foundation.layout.Column
2729
import androidx.compose.foundation.layout.Spacer
2830
import androidx.compose.foundation.layout.fillMaxSize
2931
import androidx.compose.foundation.layout.fillMaxWidth
32+
import androidx.compose.foundation.layout.offset
3033
import androidx.compose.foundation.layout.padding
3134
import androidx.compose.foundation.rememberScrollState
3235
import androidx.compose.foundation.shape.RoundedCornerShape
@@ -55,6 +58,7 @@ import androidx.compose.ui.platform.LocalDensity
5558
import androidx.compose.ui.platform.LocalHapticFeedback
5659
import androidx.compose.ui.platform.LocalWindowInfo
5760
import androidx.compose.ui.res.stringResource
61+
import androidx.compose.ui.unit.IntOffset
5862
import androidx.compose.ui.unit.dp
5963
import androidx.compose.ui.unit.sp
6064
import androidx.core.content.ContextCompat
@@ -100,6 +104,18 @@ fun MainScreen(
100104

101105
val showCustomDialog = remember { mutableStateOf(false) }
102106
val setupShakeKey = remember { mutableIntStateOf(0) }
107+
val textShakeKey = remember { mutableIntStateOf(0) }
108+
109+
// Text shake animation for the conditions text (shown when the threshold changes)
110+
val textOffsetAnim = remember { Animatable(0f) }
111+
LaunchedEffect(textShakeKey.intValue) {
112+
if (textShakeKey.intValue > 0) {
113+
val offsets = listOf(-3f, 3f, -2f, 2f, -1f, 1f, -0.5f, 0.5f, 0f)
114+
for (o in offsets) {
115+
textOffsetAnim.animateTo(o, animationSpec = tween(durationMillis = 80))
116+
}
117+
}
118+
}
103119

104120
LaunchedEffect(mainViewModel) {
105121
mainViewModel.uiEvents.collect { event ->
@@ -178,7 +194,9 @@ fun MainScreen(
178194
)
179195
Spacer(modifier = Modifier.padding(top = 8.dp))
180196
Text(
181-
modifier = Modifier.padding(horizontal = horizontalOffsetPadding),
197+
modifier = Modifier
198+
.padding(horizontal = horizontalOffsetPadding)
199+
.offset { IntOffset(textOffsetAnim.value.dp.roundToPx(), 0) },
182200
text = stringResource(id = R.string.description_switching_conditions),
183201
style = MaterialTheme.typography.bodyLarge.copy(lineHeight = 21.sp)
184202
)
@@ -253,6 +271,7 @@ fun MainScreen(
253271
onValueChange = { index ->
254272
mainViewModel.setPendingCustomSliderLux(lux[index])
255273
mainViewModel.onSliderValueCommitted(index)
274+
textShakeKey.intValue += 1
256275
},
257276
enabled = uiState.adaptiveThemeEnabled,
258277
firstCard = true,

0 commit comments

Comments
 (0)