feat: 달력 월 이동 시 부드러운 화면 전환 애니메이션 추가
- 월 이동 버튼 클릭 시 슬라이드 애니메이션 적용 - 설정 화면 탭 전환처럼 부드러운 전환 효과 - 버전 업데이트 v1.4.8 (1148) Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -20,8 +20,8 @@ android {
|
|||||||
applicationId = "com.example.shiftalarm"
|
applicationId = "com.example.shiftalarm"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 1147
|
versionCode = 1148
|
||||||
versionName = "1.4.7"
|
versionName = "1.4.8"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,8 +80,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
binding.prevMonth.setOnClickListener {
|
binding.prevMonth.setOnClickListener {
|
||||||
currentViewMonth = currentViewMonth.minusMonths(1)
|
animateMonthTransition(-1)
|
||||||
updateCalendar()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.monthTitle.setOnClickListener {
|
binding.monthTitle.setOnClickListener {
|
||||||
@@ -89,8 +88,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
binding.nextMonth.setOnClickListener {
|
binding.nextMonth.setOnClickListener {
|
||||||
currentViewMonth = currentViewMonth.plusMonths(1)
|
animateMonthTransition(1)
|
||||||
updateCalendar()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.btnToday.setOnClickListener {
|
binding.btnToday.setOnClickListener {
|
||||||
@@ -707,11 +705,40 @@ class MainActivity : AppCompatActivity() {
|
|||||||
Toast.makeText(this, "⚠️ 루팅된 기기에서 시각적 오류나 알람 불안정이 발생할 수 있습니다.", Toast.LENGTH_LONG).show()
|
Toast.makeText(this, "⚠️ 루팅된 기기에서 시각적 오류나 알람 불안정이 발생할 수 있습니다.", Toast.LENGTH_LONG).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
private fun animateMonthTransition(direction: Int) {
|
||||||
* 남은 연차 표시 형식 개선
|
val slideOut = if (direction > 0) {
|
||||||
* - 정수면 정수로 표시 (예: 22)
|
android.view.animation.TranslateAnimation(0f, -binding.calendarCard.width.toFloat(), 0f, 0f)
|
||||||
* - 소숫점 있으면 소숫점 표시 (예: 21.5)
|
} 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)
|
||||||
|
|
||||||
|
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?) {
|
||||||
|
currentViewMonth = if (direction > 0) {
|
||||||
|
currentViewMonth.plusMonths(1)
|
||||||
|
} else {
|
||||||
|
currentViewMonth.minusMonths(1)
|
||||||
|
}
|
||||||
|
updateCalendar()
|
||||||
|
binding.calendarCard.startAnimation(slideIn)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
private fun formatRemainingDays(days: Float): String {
|
private fun formatRemainingDays(days: Float): String {
|
||||||
return if (days == days.toInt().toFloat()) {
|
return if (days == days.toInt().toFloat()) {
|
||||||
// 정수인 경우
|
// 정수인 경우
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"versionCode": 1147,
|
"versionCode": 1148,
|
||||||
"versionName": "1.4.7",
|
"versionName": "1.4.8",
|
||||||
"apkUrl": "https://git.webpluss.net/attachments/eb7f2a8d-3243-4c23-a833-f9864a4686a3",
|
"apkUrl": "https://git.webpluss.net/attachments/731ca456-b7f3-4634-8b8d-05dbf21e3895",
|
||||||
"changelog": "v1.4.7: 버전업 오류 수정, 휴가관리→근무관리 명칭 변경, 기능추가중 표시",
|
"changelog": "v1.4.8: 달력 월 이동 시 부드러운 화면 전환 애니메이션 추가",
|
||||||
"forceUpdate": false
|
"forceUpdate": false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user