Skip to content

Commit

Permalink
[YDS-#234] YdsEasing public으로 변경 (#235)
Browse files Browse the repository at this point in the history
* feat: YdsInAndOutEasing -> YdsEasing & public

* [YDS-#228] Component - Toast 구현 (#233)

* MyScaffold, Toast 초기 후구현

* 구현 완료

* 리뷰 반영

- 기존 YdsScaffold 대체
- preview 맨 아래로, private 변경
- 기존 다른 파일들도 preview function은 전부 private하게 변경
- 인터페이스, enum 맨 위로
- YdsEasing 사용
- Toast Animation 파일 분리
- 기타 코드 정리

* 리뷰 반영

- 코드수정
- 네이밍 변경
- 주석 작성중.
- 이해완료

* 리뷰 반영

- 패키지 변경
- 최소높이 제거
- 네이밍 변경
- 주석 작성

* 디버그 용 함수 제거

* rememberToastHostState 생성

* ToastDuration Enum애 시간 정의

* 텍스트 가운데 정렬 로직 추가

* rememberToastHost -> ToastHost.kt로 이동

* 오타 수정

* refactor: ToastAnimation의 YdsInAndOutEasing -> YdsEasing

* Resolve conflict

---------

Co-authored-by: Gael-Android <[email protected]>
  • Loading branch information
cometj03 and Gael-Android authored Jan 15, 2024
1 parent c676bcb commit cb30c8d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.yourssu.design.system.compose.YdsTheme
import com.yourssu.design.system.compose.rule.Duration
import com.yourssu.design.system.compose.rule.YdsInAndOutEasing
import com.yourssu.design.system.compose.rule.YdsEasing
import kotlinx.coroutines.launch

@OptIn(ExperimentalMaterialApi::class)
Expand All @@ -23,7 +23,7 @@ fun rememberYdsBottomSheetState(): ModalBottomSheetState {
initialValue = ModalBottomSheetValue.Hidden,
animationSpec = tween(
durationMillis = Duration.Medium.millis,
easing = YdsInAndOutEasing
easing = YdsEasing
),
skipHalfExpanded = true
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.yourssu.design.system.compose.YdsTheme
import com.yourssu.design.system.compose.base.noRippleClickable
import com.yourssu.design.system.compose.rule.YdsInAndOutEasing
import com.yourssu.design.system.compose.rule.YdsEasing
import com.yourssu.design.system.compose.rule.YdsBorder

@Composable
Expand All @@ -49,7 +49,7 @@ fun Toggle(
transitionSpec = {
tween(
durationMillis = 100,
easing = YdsInAndOutEasing
easing = YdsEasing
)
}
) { selected ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import com.yourssu.design.system.compose.base.Surface
import com.yourssu.design.system.compose.base.YdsScaffold
import com.yourssu.design.system.compose.base.YdsText
import com.yourssu.design.system.compose.component.topbar.TopBar
import com.yourssu.design.system.compose.rule.YdsInAndOutEasing
import com.yourssu.design.system.compose.rule.YdsEasing

/**
* 하단 네비게이션 바
Expand Down Expand Up @@ -126,7 +126,7 @@ fun RowScope.BottomBarItem(
targetValue = if (isAnimating) 1.2f else 1f, // isAnimating 에 따라 scale 기본값(1f) ~ 1.2배 까지 변화
animationSpec = tween(
durationMillis = 25,
easing = YdsInAndOutEasing,
easing = YdsEasing,
),
finishedListener = {// animating 끝나면 false로 변경. scale 1.2f -> 1f로 변화
if (isAnimating) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.graphicsLayer
import com.yourssu.design.system.compose.rule.Duration
import com.yourssu.design.system.compose.rule.YdsInAndOutEasing
import com.yourssu.design.system.compose.rule.YdsEasing

data class ToastTransitionItem(
val toastData: ToastData?,
Expand Down Expand Up @@ -62,7 +62,7 @@ fun FadeInFadeOut(
val isVisible = appearedToastData == newToastData
val opacity = animatedOpacity(
animation = tween(
easing = YdsInAndOutEasing,
easing = YdsEasing,
delayMillis = 0,
durationMillis = Duration.Medium.millis
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.yourssu.design.system.compose.rule

import androidx.compose.animation.core.CubicBezierEasing

internal val YdsInAndOutEasing = CubicBezierEasing(0.25f, 0.1f, 0.25f, 1f)
val YdsEasing = CubicBezierEasing(0.25f, 0.1f, 0.25f, 1f)

enum class Duration(val millis: Int) {
Short(100),
Expand Down

0 comments on commit cb30c8d

Please sign in to comment.