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: 6 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ plugins {

android {
namespace = "com.yapp.orbit"
compileSdk = 35
compileSdk = libs.versions.compileSdk.get().toInt()

defaultConfig {
versionCode = 6
versionName = "1.1.3"
targetSdk = 35
minSdk = libs.versions.minSdk.get().toInt()
targetSdk = libs.versions.targetSdk.get().toInt()

versionCode = libs.versions.versionCode.get().toInt()
versionName = libs.versions.versionName.get()
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginE
internal fun Project.configureComposeAndroid() {
with(plugins) {
apply("org.jetbrains.kotlin.plugin.compose")
apply("com.github.skydoves.compose.stability.analyzer")
}

val libs = extensions.libs
androidExtension.apply {
dependencies {
val bom = libs.findLibrary("compose.bom").get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ internal fun Project.configureCoroutine() {
}

private fun Project.addImplementation(libraryKey: String) {
val libs = extensions.libs
dependencies {
"implementation"(libs.findLibrary(libraryKey).get())
}
Expand Down
5 changes: 2 additions & 3 deletions build-logic/src/main/java/com/yapp/convention/Extension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import com.android.build.api.dsl.LibraryExtension
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalog
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.api.plugins.ExtensionContainer
import org.gradle.kotlin.dsl.getByType
import org.jetbrains.kotlin.konan.properties.Properties

Expand All @@ -22,8 +21,8 @@ internal val Project.androidExtension: CommonExtension<*, *, *, *, *, *>
.onFailure { println("Could not find Library or Application extension from this project") }
.getOrThrow()

internal val ExtensionContainer.libs: VersionCatalog
get() = getByType<VersionCatalogsExtension>().named("libs")
internal val Project.libs: VersionCatalog
get() = extensions.getByType<VersionCatalogsExtension>().named("libs")

internal fun CommonExtension<*, *, *, *, *, *>.addBuildConfigFields(project: Project) {
val baseUrl = project.getLocalProperty("baseUrl", "https://default.example.com")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ internal fun Project.configureHiltAndroid() {
apply("com.google.devtools.ksp")
}

val libs = extensions.libs
dependencies {
"implementation"(libs.findLibrary("hilt.android").get())
"ksp"(libs.findLibrary("hilt.android.compiler").get())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ internal fun Project.configureHiltKotlin() {
apply("com.google.devtools.ksp")
}

val libs = extensions.libs
dependencies {
"implementation"(libs.findLibrary("hilt.core").get())
"ksp"(libs.findLibrary("hilt.compiler").get())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ internal fun Project.configureKotlinAndroid() {
pluginManager.apply("org.jetbrains.kotlin.plugin.serialization")

androidExtension.apply {
compileSdk = 34
compileSdk = libs.findVersion("compileSdk").get().requiredVersion.toInt()

defaultConfig {
minSdk = 28
minSdk = libs.findVersion("minSdk").get().requiredVersion.toInt()
}

buildFeatures {
Expand Down
2 changes: 0 additions & 2 deletions build-logic/src/main/java/com/yapp/convention/TestAndroid.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ internal fun Project.configureTestAndroid() {
}

internal fun Project.configureComposeUiTest() {
val libs = extensions.libs
dependencies {
"androidTestImplementation"(libs.findLibrary("compose-ui-test-junit4").get())
"debugImplementation"(libs.findLibrary("compose-ui-test-manifest").get())
Expand All @@ -24,7 +23,6 @@ internal fun Project.configureJUnitAndroid() {
androidExtension.apply {
defaultConfig { testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" }

val libs = extensions.libs
dependencies {
"androidTestImplementation"(libs.findLibrary("androidx-test-ext-junit").get())
"androidTestImplementation"(libs.findLibrary("androidx-test-runner").get())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import org.gradle.testing.jacoco.tasks.JacocoReport
internal fun Project.configureTestCoverage() {
pluginManager.apply("jacoco")

val libs = extensions.libs
extensions.configure<JacocoPluginExtension> {
toolVersion = libs.findVersion("jacoco").get().toString()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import org.gradle.api.Project
import org.gradle.kotlin.dsl.dependencies

internal fun Project.configureTestKotlin() {
val libs = extensions.libs
dependencies {
// JUnit4 단위 테스트 프레임워크
"testImplementation"(libs.findLibrary("junit4").get())
Expand Down
1 change: 0 additions & 1 deletion build-logic/src/main/java/orbit.android.feature.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ dependencies {
implementation(project(":core:designsystem"))
implementation(project(":core:ui"))

val libs = project.extensions.libs
implementation(libs.findLibrary("compose-navigation").get())
implementation(libs.findLibrary("lifecycle-viewmodel").get())
implementation(libs.findLibrary("lifecycle-runtime").get())
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ plugins {
alias(libs.plugins.google.service) apply false
alias(libs.plugins.firebase.app.distribution) apply false
alias(libs.plugins.firebase.crashlytics) apply false
alias(libs.plugins.stability.analyzer) apply false
}

apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.yapp.common.navigation

import android.util.Log
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Stable
import androidx.compose.runtime.remember
import androidx.navigation.NavHostController
import androidx.navigation.NavOptions
Expand All @@ -20,6 +21,7 @@ import com.yapp.common.navigation.route.SplashRoute
import com.yapp.common.navigation.route.WebViewRoute
import com.yapp.domain.model.Alarm

@Stable
class OrbitNavigator(
val navController: NavHostController,
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.yapp.designsystem.theme

import androidx.compose.runtime.Stable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.graphics.Color

@Stable
class OrbitColors(
main: Color = Color(0xFFFEFF65),
sub_main: Color = Color(0xFFFDFE90),
Expand Down
1 change: 0 additions & 1 deletion core/network/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ dependencies {
implementation(libs.retrofit.kotlin.serialization)
implementation(libs.okhttp.logging)
implementation(libs.kotlinx.serialization.json)
implementation(libs.process.phoenix)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import androidx.compose.material.ModalBottomSheetState
import androidx.compose.material.ModalBottomSheetValue
import androidx.compose.material.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Stable
import androidx.compose.runtime.State
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
Expand Down Expand Up @@ -32,6 +33,7 @@ fun rememberOrbitBottomSheetState(): OrbitBottomSheetState {
}
}

@Stable
class OrbitBottomSheetState(
val state: ModalBottomSheetState,
val contentState: State<BottomSheetContent?>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.Stable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.remember
Expand All @@ -27,11 +27,11 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.yapp.designsystem.theme.OrbitTheme
import com.yapp.ui.utils.toPx
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.map
import kotlin.math.abs

@Stable
@Composable
fun <T> OrbitPickerItem(
modifier: Modifier = Modifier,
Expand Down Expand Up @@ -113,25 +113,6 @@ fun <T> OrbitPickerItem(
.pointerInput(Unit) { detectVerticalDragGestures { change, _ -> change.consume() } },
) {
items(listScrollCount, key = { index -> index }) { index ->
val layoutInfo by remember { derivedStateOf { listState.layoutInfo } }

val viewportCenterOffset = layoutInfo.viewportStartOffset +
(layoutInfo.viewportEndOffset - layoutInfo.viewportStartOffset) / 2

val itemInfo = layoutInfo.visibleItemsInfo.find { it.index == index }
val itemCenterOffset = itemInfo?.offset?.let { it + (itemInfo.size / 2) } ?: 0

val distanceFromCenter = abs(viewportCenterOffset - itemCenterOffset)
val maxDistance = totalItemHeight.toPx() * visibleItemsMiddle

val alpha = if (distanceFromCenter <= maxDistance) {
((maxDistance - distanceFromCenter) / maxDistance).coerceIn(0.2f, 1f)
} else {
0.2f
}

val scaleY = 1f - (0.2f * (distanceFromCenter / maxDistance)).coerceIn(0f, 0.4f)

val item = getItemForIndex(
index = index,
items = items,
Expand All @@ -143,10 +124,35 @@ fun <T> OrbitPickerItem(
text = item?.let { itemFormatter(it) } ?: "",
maxLines = 1,
style = textStyle,
color = OrbitTheme.colors.white.copy(alpha = alpha),
color = OrbitTheme.colors.white,
modifier = Modifier
.padding(vertical = itemSpacing / 2)
.graphicsLayer(scaleY = scaleY)
.graphicsLayer {
val layoutInfo = listState.layoutInfo

val viewportCenterOffset = layoutInfo.viewportStartOffset +
(layoutInfo.viewportEndOffset - layoutInfo.viewportStartOffset) / 2

val itemInfo = layoutInfo.visibleItemsInfo.find { it.index == index }
val itemCenterOffset = itemInfo?.offset?.let { it + (itemInfo.size / 2) } ?: 0

val distanceFromCenter = abs(viewportCenterOffset - itemCenterOffset)
val maxDistance = totalItemHeight.toPx() * visibleItemsMiddle

if (maxDistance <= 0f) {
alpha = 1f
scaleY = 1f
return@graphicsLayer
}

alpha = if (distanceFromCenter <= maxDistance) {
((maxDistance - distanceFromCenter) / maxDistance).coerceIn(0.2f, 1f)
} else {
0.2f
}

scaleY = 1f - (0.2f * (distanceFromCenter / maxDistance)).coerceIn(0f, 0.4f)
}
.onSizeChanged { size -> itemHeightPixels = size.height }
.then(textModifier),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ package com.yapp.ui.component.timepicker
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Stable
import androidx.compose.runtime.remember
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow

@Stable
class PickerState<T>(
val lazyListState: LazyListState,
val initialIndex: Int,
Expand Down
25 changes: 12 additions & 13 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
[versions]
# SDK Versions
compileSdk = "34"
compileSdk = "35"
minSdk = "28"
targetSdk = "34"
jdkVersion = "17"
targetSdk = "35"

# App Versioning
versionName = "1.0.0"
versionCode = "1"
versionName = "1.1.3"
versionCode = "6"

## Android Gradle Plugin
android-gradle-plugin = "8.7.2"

## Kotlin Symbol Processing
ksp = "2.0.0-1.0.22"
ksp = "2.2.21-2.0.4"

## Formatting Plugins
ktlint = "11.5.1"

## Kotlin Versions
kotlin = "2.0.0"
kotlin = "2.2.21"
kotlinx-serialization-json = "1.7.0"
kotlinx-coroutines = "1.9.0-RC"
kotlinx-collections = "0.3.7"
Expand All @@ -43,9 +42,9 @@ compose-ui = "1.7.6"
activity-compose = "1.9.3"

## Hilt
hilt = "2.51.1"
hilt-navigation-compose = "1.2.0"
hilt-work = "1.2.0"
hilt = "2.57.2"
hilt-navigation-compose = "1.3.0"
hilt-work = "1.3.0"

## Third Party
okhttp = "4.12.0"
Expand Down Expand Up @@ -74,11 +73,11 @@ timber = "5.0.1"
orbit = "6.1.0"
espressoCore = "3.6.1"
material = "1.12.0"
process-pheonix = "3.0.0"
lottie = "6.1.0"
lottie = "6.7.1"
accompanist = "0.37.0"
materialAndroid = "1.7.5"
amplitude = "1.20.3"
stability-analyzer = "0.5.0"

[libraries]

Expand Down Expand Up @@ -170,7 +169,6 @@ androidx-test-core = { group = "androidx.test", name = "core", version.ref = "an
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }

process-phoenix = { module = "com.jakewharton:process-phoenix", version.ref = "process-pheonix" }
lottie-compose = { group = "com.airbnb.android", name = "lottie-compose", version.ref= "lottie" }
accompanist-permission = { module = "com.google.accompanist:accompanist-permissions", version.ref = "accompanist" }
androidx-material-android = { group = "androidx.compose.material", name = "material-android", version.ref = "materialAndroid" }
Expand All @@ -196,3 +194,4 @@ compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "
google-service = { id = "com.google.gms.google-services", version.ref = "google-service" }
firebase-app-distribution = { id = "com.google.firebase.appdistribution", version.ref = "firebase-app-distribution" }
firebase-crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "firebase-crashlytics" }
stability-analyzer = { id = "com.github.skydoves.compose.stability.analyzer", version.ref = "stability-analyzer" }