fix: 애니메이션 개선 및 APK 업데이트
- ViewPropertyAnimator 사용으로 더 부드러운 전환 - alpha 애니메이션 추가로 시각적 효과 개선 - APK URL 업데이트 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -706,37 +706,39 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
private fun animateMonthTransition(direction: Int) {
|
||||
val slideOut = if (direction > 0) {
|
||||
android.view.animation.TranslateAnimation(0f, -binding.calendarCard.width.toFloat(), 0f, 0f)
|
||||
} else {
|
||||
android.view.animation.TranslateAnimation(0f, binding.calendarCard.width.toFloat(), 0f, 0f)
|
||||
}
|
||||
slideOut.duration = 150
|
||||
slideOut.fillAfter = false
|
||||
|
||||
val slideIn = if (direction > 0) {
|
||||
android.view.animation.TranslateAnimation(binding.calendarCard.width.toFloat(), 0f, 0f, 0f)
|
||||
} else {
|
||||
android.view.animation.TranslateAnimation(-binding.calendarCard.width.toFloat(), 0f, 0f, 0f)
|
||||
}
|
||||
slideIn.duration = 150
|
||||
slideIn.fillAfter = true
|
||||
|
||||
binding.calendarCard.startAnimation(slideOut)
|
||||
val card = binding.calendarCard
|
||||
val width = card.width.toFloat()
|
||||
|
||||
slideOut.setAnimationListener(object : android.view.animation.Animation.AnimationListener {
|
||||
override fun onAnimationStart(animation: android.view.animation.Animation?) {}
|
||||
override fun onAnimationRepeat(animation: android.view.animation.Animation?) {}
|
||||
override fun onAnimationEnd(animation: android.view.animation.Animation?) {
|
||||
if (width == 0f) {
|
||||
currentViewMonth = if (direction > 0) {
|
||||
currentViewMonth.plusMonths(1)
|
||||
} else {
|
||||
currentViewMonth.minusMonths(1)
|
||||
}
|
||||
updateCalendar()
|
||||
return
|
||||
}
|
||||
|
||||
card.animate()
|
||||
.translationX(if (direction > 0) -width else width)
|
||||
.alpha(0.5f)
|
||||
.setDuration(200)
|
||||
.withEndAction {
|
||||
currentViewMonth = if (direction > 0) {
|
||||
currentViewMonth.plusMonths(1)
|
||||
} else {
|
||||
currentViewMonth.minusMonths(1)
|
||||
}
|
||||
updateCalendar()
|
||||
binding.calendarCard.startAnimation(slideIn)
|
||||
|
||||
card.translationX = if (direction > 0) width else -width
|
||||
card.animate()
|
||||
.translationX(0f)
|
||||
.alpha(1f)
|
||||
.setDuration(200)
|
||||
.start()
|
||||
}
|
||||
})
|
||||
.start()
|
||||
}
|
||||
|
||||
private fun formatRemainingDays(days: Float): String {
|
||||
|
||||
Reference in New Issue
Block a user