Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ android {
kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_21
freeCompilerArgs.add("-Xcontext-receivers")
}
}

Expand All @@ -121,6 +120,7 @@ dependencies {
implementation(libs.firebase.analytics.ktx)
implementation(libs.firebase.crashlytics)
implementation(libs.javapoet)
implementation(libs.javax.inject)
implementation(libs.kotlin.math)
implementation(libs.metrox.viewmodel.compose)
implementation(platform(libs.compose.bom))
Expand All @@ -130,6 +130,14 @@ dependencies {
implementation(libs.datastore.preferences)
implementation(libs.mixpanel)

constraints {
// androidx.test.ext:junit 1.3.0 requires concurrent-futures 1.2.0, but transitive
// deps like profileinstaller pull in 1.1.0 on the main classpath. AGP's consistent
// resolution then locks androidTest to 1.1.0, conflicting with junit's requirement.
// Bumping this here lets normal conflict resolution converge on 1.2.0 everywhere.
implementation(libs.androidx.concurrent.futures)
}

debugImplementation(libs.compose.ui.test.manifest)

testImplementation(libs.coroutines.android)
Expand Down
124 changes: 69 additions & 55 deletions app/src/main/java/dev/simonas/quies/onboarding/OnboardingComponents.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import kotlin.math.sin

interface CanvasComponent {

context(DrawScope)
context(drawScope: DrawScope)
fun draw(progress: Float, isGlitch: Boolean): Vals

data class Vals(
Expand Down Expand Up @@ -66,7 +66,7 @@ class Splash(
private val exit: ClosedRange<Float>,
) : CanvasComponent {

context(DrawScope)
context(drawScope: DrawScope)
override fun draw(progress: Float, isGlitch: Boolean): Vals {
val vals = Vals(
glichyness = progress.rangeNorm(
Expand All @@ -84,17 +84,19 @@ class Splash(
.times(0.8f),
)

drawDialogLine(
textMeasurer,
isGlitch = isGlitch,
text = text,
vals = vals,
offset = textOffset,
textSizeMulti = 0.75f,
glitchPaleness = 0f,
offsetMultiplierX = 2f,
offsetMultiplierY = 2f,
)
with(drawScope) {
drawDialogLine(
textMeasurer,
isGlitch = isGlitch,
text = text,
vals = vals,
offset = textOffset,
textSizeMulti = 0.75f,
glitchPaleness = 0f,
offsetMultiplierX = 2f,
offsetMultiplierY = 2f,
)
}
return vals.copy(
glichyness = vals.glichyness,
)
Expand All @@ -105,20 +107,22 @@ class OpenerDialogLine(
private val textMeasurer: TextMeasurer,
) : CanvasComponent {

context(DrawScope)
context(drawScope: DrawScope)
override fun draw(progress: Float, isGlitch: Boolean): Vals {
val vals = Vals(
glichyness = glitch(1, progress),
visibility = progress
.rangeNorm(0.80f..1.95f)
.hill(DIALOG_HILL_SIDE),
)
drawDialogLine(
textMeasurer,
isGlitch = isGlitch,
text = "This game is about creating meaningful dialogues",
vals = vals,
)
with(drawScope) {
drawDialogLine(
textMeasurer,
isGlitch = isGlitch,
text = "This game is about creating meaningful dialogues",
vals = vals,
)
}
return vals
}
}
Expand All @@ -127,20 +131,22 @@ class ChillOutDialogLine(
private val textMeasurer: TextMeasurer,
) : CanvasComponent {

context(DrawScope)
context(drawScope: DrawScope)
override fun draw(progress: Float, isGlitch: Boolean): Vals {
val vals = Vals(
glichyness = glitch(2, progress),
visibility = progress
.rangeNorm(2.00f..2.95f)
.hill(DIALOG_HILL_SIDE),
)
drawDialogLine(
textMeasurer,
isGlitch = isGlitch,
text = "Slowly getting the conversation to the next level",
vals = vals,
)
with(drawScope) {
drawDialogLine(
textMeasurer,
isGlitch = isGlitch,
text = "Slowly getting the conversation to the next level",
vals = vals,
)
}
return vals
}
}
Expand All @@ -149,20 +155,22 @@ class ExcuseDialogLine(
private val textMeasurer: TextMeasurer,
) : CanvasComponent {

context(DrawScope)
context(drawScope: DrawScope)
override fun draw(progress: Float, isGlitch: Boolean): Vals {
val vals = Vals(
glichyness = glitch(3, progress),
visibility = progress
.rangeNorm(3.00f..3.95f)
.hill(DIALOG_HILL_SIDE),
)
drawDialogLine(
textMeasurer,
isGlitch = isGlitch,
text = "An excuse to talk about things you’ve never had",
vals = vals,
)
with(drawScope) {
drawDialogLine(
textMeasurer,
isGlitch = isGlitch,
text = "An excuse to talk about things you’ve never had",
vals = vals,
)
}
return vals
}
}
Expand All @@ -171,20 +179,22 @@ class LetItOutDialogLine(
private val textMeasurer: TextMeasurer,
) : CanvasComponent {

context(DrawScope)
context(drawScope: DrawScope)
override fun draw(progress: Float, isGlitch: Boolean): Vals {
val vals = Vals(
glichyness = glitch(4, progress),
visibility = progress
.rangeNorm(4.00f..4.95f)
.hill(DIALOG_HILL_SIDE),
)
drawDialogLine(
textMeasurer,
isGlitch = isGlitch,
text = "Share things we have kept to ourselves",
vals = vals,
)
with(drawScope) {
drawDialogLine(
textMeasurer,
isGlitch = isGlitch,
text = "Share things we have kept to ourselves",
vals = vals,
)
}
return vals
}
}
Expand All @@ -193,20 +203,22 @@ class ConnectionDialogLine(
private val textMeasurer: TextMeasurer,
) : CanvasComponent {

context(DrawScope)
context(drawScope: DrawScope)
override fun draw(progress: Float, isGlitch: Boolean): Vals {
val vals = Vals(
glichyness = glitch(5, progress),
visibility = progress
.rangeNorm(5.00f..5.95f)
.hill(DIALOG_HILL_SIDE),
)
drawDialogLine(
textMeasurer,
isGlitch = isGlitch,
text = "Build a bridge between two or more inner worlds",
vals = vals,
)
with(drawScope) {
drawDialogLine(
textMeasurer,
isGlitch = isGlitch,
text = "Build a bridge between two or more inner worlds",
vals = vals,
)
}
return vals
}
}
Expand All @@ -215,7 +227,7 @@ class OutroDialogLine(
private val textMeasurer: TextMeasurer,
) : CanvasComponent {

context(DrawScope)
context(drawScope: DrawScope)
override fun draw(progress: Float, isGlitch: Boolean): Vals {
val vals = Vals(
glichyness = glitch(
Expand All @@ -232,12 +244,14 @@ class OutroDialogLine(
.rangeNorm(6.00f..6.95f)
.hill(DIALOG_HILL_SIDE),
)
drawDialogLine(
textMeasurer,
isGlitch = isGlitch,
text = "Be honest\nShare your feelings\nThat’s the way to win",
vals = vals,
)
with(drawScope) {
drawDialogLine(
textMeasurer,
isGlitch = isGlitch,
text = "Be honest\nShare your feelings\nThat’s the way to win",
vals = vals,
)
}
return vals
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/test/java/dev/simonas/quies/utils/TurbineKtx.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.advanceUntilIdle

context(TestScope)
context(testScope: TestScope)
suspend inline fun <T> Flow<T>.testLast(
crossinline validate: TurbineTestContext<T>.(T) -> Unit,
) {
test {
advanceUntilIdle()
testScope.advanceUntilIdle()
validate(expectMostRecentItem())
}
}
6 changes: 6 additions & 0 deletions config/detekt/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,12 @@ formatting:
active: true
android: true
autoCorrect: true
# detekt 1.23.8's bundled ktlint doesn't understand Kotlin 2.4's named
# context parameters (`context(name: Type)`) - it either crashes
# (Wrapping) or emits false positives (SpacingAroundColon,
# NoUnusedImports) on files that use them. Exclude those files from the
# whole formatting ruleset until detekt ships a newer ktlint.
excludes: ['**/onboarding/OnboardingComponents.kt', '**/utils/TurbineKtx.kt']
AnnotationOnSeparateLine:
active: true
autoCorrect: true
Expand Down
68 changes: 36 additions & 32 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,49 +1,51 @@
[versions]
agp = "9.2.1"
agp = "9.3.1"
androidx_activity_compose = "1.13.0"
androidx_test = "1.7.0"
androidx_test_ext = "1.3.0"
appcompat = "1.7.1"
benmanesversion = "0.47.0"
colormath = "3.3.2"
colormath-ext-jetpack-compose = "3.3.2"
appcompat = "1.8.0"
benmanesversion = "0.61.0"
colormath = "3.6.1"
colormath-ext-jetpack-compose = "3.6.1"
compile_sdk_version = "37"
compose-lifecycle = "2.10.0"
compose-lifecycle = "2.11.0"
compose-navigation = "2.9.8"
compose_bom = "2026.05.00"
constraint_layout = "2.1.4"
core_ktx = "1.18.0"
coroutines = "1.10.2"
datastore = "1.1.1"
datastore-preferences = "1.1.1"
compose_bom = "2026.08.00"
concurrent_futures = "1.2.0"
constraint_layout = "2.2.2"
core_ktx = "1.19.0"
coroutines = "1.11.0"
datastore = "1.2.1"
datastore-preferences = "1.2.1"
detekt = "1.23.8"
espresso_core = "3.7.0"
firebase_analytics = "22.0.0"
firebase_bom = "33.0.0"
firebase_crashlytics = "19.0.0"
firebase_ktx = "22.0.0"
google_services = "4.4.1"
hilt = "2.56.2"
hilt-navigation-compose = "1.2.0"
firebase_analytics = "23.2.0"
firebase_bom = "34.18.0"
firebase_crashlytics = "20.1.0"
firebase_ktx = "22.5.0"
google_services = "4.5.0"
hilt = "2.60.1"
hilt-navigation-compose = "1.4.0"
javapoet = "1.13.0"
javax_inject = "1"
junit = "4.13.2"
junit-jupiter = "5.11.4"
kaml = "0.55.0"
kotlin = "2.3.0"
kotlin-math = "1.5.3"
ksp = "2.3.2"
ktlint_gradle = "11.5.0"
junit-jupiter = "6.1.3"
kaml = "0.104.0"
kotlin = "2.4.10"
kotlin-math = "1.8.0"
ksp = "2.3.11"
ktlint_gradle = "14.2.0"
min_sdk_version = "28"
metro = "1.4.2"
mixpanel-android = "8.2.1"
mockito-android = "5.4.0"
mockito-kotlin = "5.1.0"
play_publisher = "3.9.1"
mixpanel-android = "8.9.0"
mockito-android = "5.23.0"
mockito-kotlin = "6.3.0"
play_publisher = "4.1.1"
simple_flank = "0.4.0"
target_sdk_version = "37"
truth = "1.1.5"
turbine = "1.0.0"
material = "1.12.0"
truth = "1.4.5"
turbine = "1.2.1"
material = "1.14.0"

[libraries]
agp = { module = "com.android.tools.build:gradle", version.ref = "agp" }
Expand All @@ -55,6 +57,7 @@ androidx_test_ext_junit = { module = "androidx.test.ext:junit", version.ref = "a
androidx_test_ext_junit_ktx = { module = "androidx.test.ext:junit-ktx", version.ref = "androidx.test.ext" }
androidx_test_rules = { module = "androidx.test:rules", version.ref = "androidx.test" }
androidx_test_runner = { module = "androidx.test:runner", version.ref = "androidx.test" }
androidx_concurrent_futures = { module = "androidx.concurrent:concurrent-futures", version.ref = "concurrent_futures" }
colormath = { module = "com.github.ajalt.colormath:colormath", version.ref = "colormath" }
colormath-ext-jetpack-compose = { module = "com.github.ajalt.colormath:colormath-ext-jetpack-compose", version.ref = "colormath-ext-jetpack-compose" }
compose-navigation = { module = "androidx.navigation:navigation-compose", version.ref = "compose-navigation" }
Expand Down Expand Up @@ -83,6 +86,7 @@ hilt-compiler = { module = "com.google.dagger:hilt-compiler", version.ref = "hil
hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "hilt-navigation-compose" }
hilt-testing = { module = "com.google.dagger:hilt-android-testing", version.ref = "hilt" }
javapoet = { module = "com.squareup:javapoet", version.ref = "javapoet" }
javax_inject = { module = "javax.inject:javax.inject", version.ref = "javax_inject" }
junit = { module = "junit:junit", version.ref = "junit" }
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" }
kaml = { module = "com.charleskorn.kaml:kaml", version.ref = "kaml" }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading