11 Commits
Author SHA1 Message Date
sanjeok77 d993619ff8 v1.1.2 - 하루 메모 키보드 가림 완벽 개선 (상단 즉시 저장 버튼, 뒤로가기 시 자동 저장 및 스크롤 지원) 2026-08-14 10:39:13 +09:00
sanjeok77 d012b178b7 v1.1.1 - 전체 알람 온오프 스위치 및 해제 시 경고 팝업 적용, 앱 정보 화면 바운스 수정, 데이터 초기화 4단계 세분화 2026-08-14 10:31:56 +09:00
sanjeok77 a356b3c581 v1.1.0 - 오늘의 근무 폰트 확대, 설정 드롭박스 텍스트 중앙 정렬 및 전체 알람 켜짐 타이포 크기 일원화 2026-08-14 10:20:24 +09:00
sanjeok77 2f7361bbc9 v1.0.9 - 메인 및 설정 화면 상단 빈 여백 완전 제거 및 인앱 APK 원클릭 업데이트 복원 2026-08-14 10:14:36 +09:00
sanjeok77 aa63d86a10 v1.0.8 - 시스템 권한 설정 토글 시 앱 자동 즉시 복귀, 달력 상단 근무 텍스트 컬러화 및 최신 버전 확인 아이콘 개편 2026-08-14 10:10:09 +09:00
sanjeok77 eb6aad8527 v1.0.7 - 구글 플레이 프로텍트 유해앱 경고 원인 완벽 제거, 사용 중 전체화면 알람 즉시 표시 보장 및 설정 복귀 처리 개선 2026-08-14 10:03:47 +09:00
sanjeok77 975413a2d6 v1.0.6 - 달력 월간 이동 깜빡임 완전 제거, 하루 메모 고가독성 색상 적용, 부가기능 및 근무 관리 아이콘/색상 개편 2026-08-14 09:54:17 +09:00
sanjeok77 696083060d v1.0.5 - 메모 아이콘 정리, 삼성 One UI 최신 알람 화면 개편, 달력 깜빡임 해소 및 카드 스택 전환 애니메이션 적용 2026-08-14 09:48:22 +09:00
sanjeok77 d245aeb7d5 v1.0.4 - 날짜 옆 근무 뱃지 원형 정밀 보정, 앱 안정성 설정 아이콘 및 색상 개편 2026-08-14 09:39:43 +09:00
sanjeok77 f5b2f72a0b \ v1.0.3 - \ud558\ub8e8 \uba54\ubaa8 4\uc904 \ud655\uc7a5 \ubc0f \ub0a0\uc9dc \uc606 \uadfc\ubb34 \ubc43\uc9c0 \ubc30\uce58 \uc54c\ub78c \ucd94\uac00 \uc2dc \ubcfc\ub968 \ucd5c\ub300\uce58 ubcf4uc815\ 2026-08-14 09:33:01 +09:00
sanjeok77 80eb086a59 \ v1.0.2 - Play Protect \uc720\ud574\uc571 \ucc28\ub2e8 \uc624\uc9c4 \uc6d0\uc778 \uc644\ubcbd \uc81c\uac70 \ubc0f \uc804\uccb4\ud654\uba74 \uc54c\ub9bc \uc124\uc815 \ud6c4 \uc571 \ubcf5\uadc0 uac1cuc120\ 2026-08-14 09:25:52 +09:00
37 changed files with 1318 additions and 696 deletions
BIN
View File
Binary file not shown.
+2 -2
View File
@@ -20,8 +20,8 @@ android {
applicationId = "com.example.shiftalarm" applicationId = "com.example.shiftalarm"
minSdk = 26 minSdk = 26
targetSdk = 35 targetSdk = 35
versionCode = 101 versionCode = 112
versionName = "1.0.1" versionName = "1.1.2"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
} }
+5 -13
View File
@@ -6,19 +6,15 @@
<uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<!-- Alarm & Full Screen --> <!-- Alarm & Full Screen -->
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" /> <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" /> <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<!-- Service & Notification --> <!-- Service & Notification -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
<application <application
android:allowBackup="true" android:allowBackup="true"
@@ -44,12 +40,11 @@
android:name=".AlarmActivity" android:name=".AlarmActivity"
android:exported="false" android:exported="false"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:taskAffinity=""
android:theme="@style/Theme.AppCompat.NoActionBar" android:theme="@style/Theme.AppCompat.NoActionBar"
android:showWhenLocked="true" android:showWhenLocked="true"
android:turnScreenOn="true" android:turnScreenOn="true"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:launchMode="singleTask" android:launchMode="singleInstance"
android:documentLaunchMode="never" android:documentLaunchMode="never"
android:configChanges="orientation|screenSize|keyboardHidden" android:configChanges="orientation|screenSize|keyboardHidden"
android:allowEmbedded="false" android:allowEmbedded="false"
@@ -96,12 +91,8 @@
<service <service
android:name=".AlarmForegroundService" android:name=".AlarmForegroundService"
android:foregroundServiceType="specialUse" android:foregroundServiceType="mediaPlayback"
android:exported="false"> android:exported="false" />
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="Alarm playback and ringing notification" />
</service>
<provider <provider
android:name="androidx.core.content.FileProvider" android:name="androidx.core.content.FileProvider"
@@ -112,6 +103,7 @@
android:name="android.support.FILE_PROVIDER_PATHS" android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" /> android:resource="@xml/provider_paths" />
</provider> </provider>
</application> </application>
</manifest> </manifest>
@@ -185,50 +185,68 @@ class AlarmActivity : AppCompatActivity() {
} }
private fun setupControls() { private fun setupControls() {
val snoozeInterval = intent.getIntExtra("EXTRA_SNOOZE_INTERVAL", 5)
binding.tvSnoozeText.text = "다시 울림 (${snoozeInterval}분)"
binding.btnSnooze.setOnClickListener { binding.btnSnooze.setOnClickListener {
handleSnooze() handleSnooze()
} }
// Swipe-to-dismiss for Stop Button // Omni-directional Swipe & Tap to Dismiss (Samsung One UI Clock Style)
var startX = 0f var startX = 0f
var startY = 0f
var isMoved = false
val dismissBtn = binding.btnDismiss val dismissBtn = binding.btnDismiss
val maxSwipe = dpToPx(100f).toFloat() val maxSwipe = dpToPx(80f).toFloat()
dismissBtn.setOnTouchListener { v, event -> dismissBtn.setOnTouchListener { v, event ->
when (event.action) { when (event.action) {
MotionEvent.ACTION_DOWN -> { MotionEvent.ACTION_DOWN -> {
startX = event.rawX startX = event.rawX
startY = event.rawY
isMoved = false
v.animate().cancel() v.animate().cancel()
v.scaleX = 0.96f
v.scaleY = 0.96f
true true
} }
MotionEvent.ACTION_MOVE -> { MotionEvent.ACTION_MOVE -> {
val dx = event.rawX - startX val dx = event.rawX - startX
val clampedDx = if (dx > 0) dx.coerceAtMost(maxSwipe) else dx.coerceAtLeast(-maxSwipe) val dy = event.rawY - startY
v.translationX = clampedDx val distance = Math.hypot(dx.toDouble(), dy.toDouble()).toFloat()
// Visual feedback: scale up when near trigger if (distance > 10f) {
val ratio = abs(clampedDx) / maxSwipe isMoved = true
v.scaleX = 1f + (ratio * 0.15f) }
v.scaleY = 1f + (ratio * 0.15f)
v.alpha = 1f - (ratio * 0.3f) val clampedDx = dx.coerceIn(-maxSwipe, maxSwipe)
val clampedDy = dy.coerceIn(-maxSwipe, maxSwipe)
v.translationX = clampedDx
v.translationY = clampedDy
val ratio = (distance / maxSwipe).coerceAtMost(1f)
v.scaleX = 0.96f + (ratio * 0.18f)
v.scaleY = 0.96f + (ratio * 0.18f)
binding.pulseCircle.alpha = 0.4f + (ratio * 0.6f)
true true
} }
MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> { MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> {
val dx = event.rawX - startX val dx = event.rawX - startX
if (abs(dx) > maxSwipe * 0.8f) { val dy = event.rawY - startY
// Trigger Dismiss val distance = Math.hypot(dx.toDouble(), dy.toDouble()).toFloat()
@Suppress("DEPRECATION")
(getSystemService(Context.VIBRATOR_SERVICE) as? Vibrator)?.vibrate(50) // Trigger dismiss if swiped past threshold or tapped
Toast.makeText(this, "알람 해제 완료", Toast.LENGTH_SHORT).show() if (!isMoved || distance > maxSwipe * 0.5f) {
stopAlarm(); finish() triggerDismiss()
} else { } else {
// Reset // Spring back reset
v.animate() v.animate()
.translationX(0f) .translationX(0f)
.translationY(0f)
.scaleX(1f) .scaleX(1f)
.scaleY(1f) .scaleY(1f)
.alpha(1f) .setDuration(250)
.setDuration(300) .setInterpolator(android.view.animation.OvershootInterpolator(1.5f))
.start() .start()
} }
true true
@@ -237,31 +255,71 @@ class AlarmActivity : AppCompatActivity() {
} }
} }
// Pulse logic with enhanced glow // Dual Wave Breathing Animation (Samsung Ambient Glow)
fun startPulse() { fun startPulse() {
binding.pulseCircle.scaleX = 0.85f; binding.pulseCircle.scaleY = 0.85f; binding.pulseCircle.alpha = 0.5f binding.pulseCircle.scaleX = 0.8f
binding.pulseCircle.scaleY = 0.8f
binding.pulseCircle.alpha = 0.3f
binding.ambientRing.scaleX = 0.9f
binding.ambientRing.scaleY = 0.9f
binding.ambientRing.alpha = 0.5f
binding.pulseCircle.animate() binding.pulseCircle.animate()
.scaleX(1.3f).scaleY(1.3f).alpha(1.0f) .scaleX(1.35f).scaleY(1.35f).alpha(0.8f)
.setDuration(1500) .setDuration(1600)
.withEndAction { .withEndAction {
binding.pulseCircle.animate() binding.pulseCircle.animate()
.scaleX(0.85f).scaleY(0.85f).alpha(0.5f) .scaleX(0.8f).scaleY(0.8f).alpha(0.3f)
.setDuration(1500) .setDuration(1600)
.withEndAction { if (!isFinishing) startPulse() } .withEndAction { if (!isFinishing) startPulse() }
.start() .start()
} }
.start() .start()
binding.ambientRing.animate()
.scaleX(1.15f).scaleY(1.15f).alpha(0.85f)
.setDuration(1600)
.withEndAction {
binding.ambientRing.animate()
.scaleX(0.9f).scaleY(0.9f).alpha(0.5f)
.setDuration(1600)
.start()
}
.start()
} }
startPulse() startPulse()
} }
private fun handleSnooze() { private fun triggerDismiss() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
(getSystemService(Context.VIBRATOR_SERVICE) as? Vibrator)?.vibrate(
VibrationEffect.createOneShot(50, VibrationEffect.DEFAULT_AMPLITUDE)
)
} else {
@Suppress("DEPRECATION") @Suppress("DEPRECATION")
(getSystemService(Context.VIBRATOR_SERVICE) as? Vibrator)?.vibrate(50) (getSystemService(Context.VIBRATOR_SERVICE) as? Vibrator)?.vibrate(50)
}
Toast.makeText(this, "알람이 해제되었습니다.", Toast.LENGTH_SHORT).show()
stopAlarm()
finish()
}
private fun handleSnooze() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
(getSystemService(Context.VIBRATOR_SERVICE) as? Vibrator)?.vibrate(
VibrationEffect.createOneShot(50, VibrationEffect.DEFAULT_AMPLITUDE)
)
} else {
@Suppress("DEPRECATION")
(getSystemService(Context.VIBRATOR_SERVICE) as? Vibrator)?.vibrate(50)
}
val snoozeRepeat = intent.getIntExtra("EXTRA_SNOOZE_REPEAT", 3) val snoozeRepeat = intent.getIntExtra("EXTRA_SNOOZE_REPEAT", 3)
val text = if (snoozeRepeat == 99) "다시 울림 설정됨" else "다시 울림 (${snoozeRepeat}회 남음)" val text = if (snoozeRepeat == 99) "다시 울림 설정됨" else "다시 울림 (${snoozeRepeat}회 남음)"
Toast.makeText(this, text, Toast.LENGTH_SHORT).show() Toast.makeText(this, text, Toast.LENGTH_SHORT).show()
snoozeAlarm(); stopAlarm(); finish() snoozeAlarm()
stopAlarm()
finish()
} }
private fun dpToPx(dp: Float): Int { private fun dpToPx(dp: Float): Int {
@@ -71,11 +71,18 @@ class AlarmForegroundService : Service() {
// 4. Foreground 시작 // 4. Foreground 시작
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { // Android 14+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { // Android 14+
startForeground(NOTIFICATION_ID, notification, android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE) startForeground(NOTIFICATION_ID, notification, android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK)
} else { } else {
startForeground(NOTIFICATION_ID, notification) startForeground(NOTIFICATION_ID, notification)
} }
// 5. 사용 중일 때도 즉시 전체화면 AlarmActivity 화면 띄우기
try {
startActivity(fullScreenIntent)
} catch (e: Exception) {
e.printStackTrace()
}
return START_NOT_STICKY return START_NOT_STICKY
} }
@@ -17,9 +17,43 @@ import androidx.activity.ComponentActivity
import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.result.contract.ActivityResultContracts
import androidx.core.app.ActivityCompat import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import kotlinx.coroutines.*
object AlarmPermissionUtil { object AlarmPermissionUtil {
private var monitorJob: Job? = null
/**
* 시스템 설정 화면에서 사용자가 권한을 허용했을 때 뒤로가기를 누르지 않아도 앱으로 즉시 자동 복귀시킵니다.
*/
fun monitorAndAutoReturn(activity: Activity, isGrantedCheck: () -> Boolean) {
monitorJob?.cancel()
monitorJob = CoroutineScope(Dispatchers.Main).launch {
delay(1000) // 설정 화면 전환 시간 대기
var count = 0
while (count < 150 && isActive) { // 최대 60초간 500ms 주기로 체크
delay(500)
count++
if (isGrantedCheck()) {
try {
val returnIntent = Intent(activity, SettingsActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_REORDER_TO_FRONT or Intent.FLAG_ACTIVITY_SINGLE_TOP
}
activity.startActivity(returnIntent)
} catch (e: Exception) {
e.printStackTrace()
}
break
}
}
}
}
fun cancelAutoReturn() {
monitorJob?.cancel()
monitorJob = null
}
/** /**
* 전체 권한 상태를 확인하고 필요한 경우 통합 안내 다이얼로그를 표시합니다. * 전체 권한 상태를 확인하고 필요한 경우 통합 안내 다이얼로그를 표시합니다.
*/ */
@@ -175,7 +209,9 @@ object AlarmPermissionUtil {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
val intent = Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION).apply { val intent = Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION).apply {
data = Uri.parse("package:${context.packageName}") data = Uri.parse("package:${context.packageName}")
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) }
if (context !is Activity) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
} }
context.startActivity(intent) context.startActivity(intent)
} }
@@ -186,13 +222,17 @@ object AlarmPermissionUtil {
try { try {
val intent = Intent("android.settings.MANAGE_APP_USE_FULL_SCREEN_INTENT").apply { val intent = Intent("android.settings.MANAGE_APP_USE_FULL_SCREEN_INTENT").apply {
data = Uri.parse("package:${context.packageName}") data = Uri.parse("package:${context.packageName}")
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) }
if (context !is Activity) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
} }
context.startActivity(intent) context.startActivity(intent)
} catch (e: Exception) { } catch (e: Exception) {
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply { val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply {
data = Uri.parse("package:${context.packageName}") data = Uri.parse("package:${context.packageName}")
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) }
if (context !is Activity) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
} }
context.startActivity(intent) context.startActivity(intent)
} }
@@ -211,7 +251,6 @@ object AlarmPermissionUtil {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
val pm = context.getSystemService(Context.POWER_SERVICE) as PowerManager val pm = context.getSystemService(Context.POWER_SERVICE) as PowerManager
allGranted = allGranted && pm.isIgnoringBatteryOptimizations(context.packageName) allGranted = allGranted && pm.isIgnoringBatteryOptimizations(context.packageName)
allGranted = allGranted && Settings.canDrawOverlays(context)
} }
if (Build.VERSION.SDK_INT >= 34) { if (Build.VERSION.SDK_INT >= 34) {
val nm = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager val nm = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
@@ -81,32 +81,20 @@ class AlarmReceiver : BroadcastReceiver() {
Log.d(TAG, "ForegroundService 시작 완료") Log.d(TAG, "ForegroundService 시작 완료")
// 2. AlarmActivity 직접 실행 (알람 화면 표시) // 2. AlarmActivity 직접 즉시 실행 (사용 중일 때도 전체화면 알람 창 띄우기)
val activityIntent = Intent(context, AlarmActivity::class.java).apply { val activityIntent = Intent(context, AlarmActivity::class.java).apply {
putExtra("EXTRA_SHIFT", intent?.getStringExtra("EXTRA_SHIFT") ?: "근무") putExtra("EXTRA_SHIFT", intent?.getStringExtra("EXTRA_SHIFT") ?: "근무")
putExtra("EXTRA_SOUND", intent?.getStringExtra("EXTRA_SOUND")) putExtra("EXTRA_SOUND", intent?.getStringExtra("EXTRA_SOUND"))
putExtra("EXTRA_SNOOZE", intent?.getIntExtra("EXTRA_SNOOZE", 5) ?: 5) putExtra("EXTRA_SNOOZE", intent?.getIntExtra("EXTRA_SNOOZE", 5) ?: 5)
putExtra("EXTRA_SNOOZE_REPEAT", intent?.getIntExtra("EXTRA_SNOOZE_REPEAT", 3) ?: 3) putExtra("EXTRA_SNOOZE_REPEAT", intent?.getIntExtra("EXTRA_SNOOZE_REPEAT", 3) ?: 3)
// 중요: 새 태스크로 실행 (FLAG_ACTIVITY_NEW_TASK) addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_REORDER_TO_FRONT or Intent.FLAG_ACTIVITY_NO_USER_ACTION)
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
// 기존 인스턴스 재사용 및 최상위로 가져오기
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)
// 잠금 화면 위에 표시
addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT)
// 화면 켜기
addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
} }
// 지연 후 Activity 시작 (ForegroundService가 알림을 먼저 표시하도록)
android.os.Handler(android.os.Looper.getMainLooper()).postDelayed({
try { try {
context.startActivity(activityIntent) context.startActivity(activityIntent)
Log.d(TAG, "AlarmActivity 실행 완료") Log.d(TAG, "AlarmActivity 즉시 실행 완료")
} catch (e: Exception) { } catch (e: Exception) {
Log.e(TAG, "AlarmActivity 실행 실패", e) Log.e(TAG, "AlarmActivity 실행 실패", e)
} }
}, 500)
} catch (e: Exception) { } catch (e: Exception) {
Log.e(TAG, "알람 실행 실패", e) Log.e(TAG, "알람 실행 실패", e)
@@ -32,6 +32,19 @@ object AlarmSyncManager {
val alarmId = repo.addCustomAlarm(alarm) val alarmId = repo.addCustomAlarm(alarm)
Log.d(TAG, "알람 DB 추가 완료: ID=$alarmId") Log.d(TAG, "알람 DB 추가 완료: ID=$alarmId")
// 시스템 알람 볼륨이 0인 경우 최대치로 자동 보정
try {
val audioManager = context.getSystemService(Context.AUDIO_SERVICE) as android.media.AudioManager
val maxVol = audioManager.getStreamMaxVolume(android.media.AudioManager.STREAM_ALARM)
val currVol = audioManager.getStreamVolume(android.media.AudioManager.STREAM_ALARM)
if (currVol == 0) {
audioManager.setStreamVolume(android.media.AudioManager.STREAM_ALARM, maxVol, 0)
Log.d(TAG, "알람 볼륨이 0이어서 최대($maxVol)로 자동 설정")
}
} catch (e: Exception) {
Log.w(TAG, "볼륨 자동 보정 실패", e)
}
// 2. AlarmManager에 예약 // 2. AlarmManager에 예약
val today = LocalDate.now(SEOUL_ZONE) val today = LocalDate.now(SEOUL_ZONE)
val customAlarms = repo.getAllCustomAlarms() val customAlarms = repo.getAllCustomAlarms()
@@ -32,9 +32,9 @@ class CalendarAdapter(
class ViewHolder(view: View) : RecyclerView.ViewHolder(view) { class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val root: View = view.findViewById(R.id.dayRoot) val root: View = view.findViewById(R.id.dayRoot)
val dayNumber: TextView = view.findViewById(R.id.dayNumber) val dayNumber: TextView = view.findViewById(R.id.dayNumber)
val tvShiftSmall: TextView = view.findViewById(R.id.tvShiftSmall)
val shiftChar: TextView = view.findViewById(R.id.shiftChar) val shiftChar: TextView = view.findViewById(R.id.shiftChar)
val holidayNameSmall: TextView = view.findViewById(R.id.holidayNameSmall) val holidayNameSmall: TextView = view.findViewById(R.id.holidayNameSmall)
val memoIndicator: ImageView = view.findViewById(R.id.memoIndicator)
val tvTide: TextView = view.findViewById(R.id.tvTide) val tvTide: TextView = view.findViewById(R.id.tvTide)
val memoContent: TextView = view.findViewById(R.id.memoContent) val memoContent: TextView = view.findViewById(R.id.memoContent)
} }
@@ -71,6 +71,7 @@ class CalendarAdapter(
val isSaturday = item.date.dayOfWeek == java.time.DayOfWeek.SATURDAY val isSaturday = item.date.dayOfWeek == java.time.DayOfWeek.SATURDAY
val fullHolidayName = HolidayManager.getHolidayName(item.date) val fullHolidayName = HolidayManager.getHolidayName(item.date)
val isToday = item.date == LocalDate.now() val isToday = item.date == LocalDate.now()
val hasMemo = item.hasMemo && !item.memoContent.isNullOrEmpty()
// Day Number Color // Day Number Color
if (fullHolidayName != null || isSunday) { if (fullHolidayName != null || isSunday) {
@@ -102,32 +103,19 @@ class CalendarAdapter(
// --- Shift & Holiday Display Logic --- // --- Shift & Holiday Display Logic ---
holder.shiftChar.background = null holder.shiftChar.background = null
holder.shiftChar.text = "" holder.shiftChar.text = ""
holder.tvShiftSmall.visibility = View.GONE
holder.holidayNameSmall.visibility = View.GONE holder.holidayNameSmall.visibility = View.GONE
holder.shiftChar.textSize = 18f holder.shiftChar.textSize = 18f
// "반월", "반년" (Half-Monthly, Half-Yearly) Special Logic
// These are overrides or specific shifts that user sets.
// User requested: "월", "년" text. Half-filled background (Red + Transparent).
// Check exact string or "startswith" if logic changed?
// Logic in adapter `getShift` might return "반월", "반년".
if (showHolidays && fullHolidayName != null) { if (showHolidays && fullHolidayName != null) {
// Holiday Mode (Priority): Show full holiday name, no circle // Holiday Mode (Priority): Show full holiday name, no circle
holder.shiftChar.text = fullHolidayName holder.shiftChar.text = fullHolidayName
holder.shiftChar.setTextColor(Color.parseColor("#FF5252")) holder.shiftChar.setTextColor(Color.parseColor("#FF5252"))
holder.shiftChar.textSize = 13f holder.shiftChar.textSize = 13f
holder.shiftChar.background = null holder.shiftChar.background = null
holder.shiftChar.visibility = View.VISIBLE
} else if (item.shift != null && item.shift != "비번") { } else if (item.shift != null && item.shift != "비번") {
// Shift Mode // Shift Mode
// Handle specific "Half" cases first
if (item.shift == "반월" || item.shift == "반년") {
holder.shiftChar.text = if (item.shift == "반월") "" else ""
holder.shiftChar.setTextColor(ContextCompat.getColor(context, R.color.black)) // Black for contrast on Half Red/Transparent
holder.shiftChar.textSize = 18f
holder.shiftChar.background = ContextCompat.getDrawable(context, R.drawable.bg_shift_half_red)
} else {
// Standard Logic
val shiftAbbreviation = when (item.shift) { val shiftAbbreviation = when (item.shift) {
"주간" -> "" "주간" -> ""
"석간" -> "" "석간" -> ""
@@ -137,12 +125,11 @@ class CalendarAdapter(
"휴무", "휴가" -> "" "휴무", "휴가" -> ""
"월차" -> "" "월차" -> ""
"연차" -> "" "연차" -> ""
"반월" -> ""
"반년" -> ""
"교육" -> "" "교육" -> ""
else -> item.shift.take(1) else -> item.shift.take(2)
} }
holder.shiftChar.text = shiftAbbreviation
holder.shiftChar.textSize = 20f
holder.shiftChar.setTypeface(null, android.graphics.Typeface.BOLD)
val shiftColorRes = when (item.shift) { val shiftColorRes = when (item.shift) {
"주간" -> R.color.shift_lemon "주간" -> R.color.shift_lemon
@@ -151,11 +138,51 @@ class CalendarAdapter(
"주간 맞교대" -> R.color.shift_jumat "주간 맞교대" -> R.color.shift_jumat
"야간 맞교대" -> R.color.shift_yamat "야간 맞교대" -> R.color.shift_yamat
"휴무", "휴가", "월차", "연차" -> R.color.shift_red "휴무", "휴가", "월차", "연차" -> R.color.shift_red
"반월", "반년" -> R.color.shift_red
"교육" -> R.color.primary "교육" -> R.color.primary
else -> R.color.text_secondary else -> R.color.text_secondary
} }
val shiftColor = ContextCompat.getColor(context, shiftColorRes) val shiftColor = ContextCompat.getColor(context, shiftColorRes)
if (hasMemo) {
// When day has a memo: show small shift badge next to day number, hide large center shift circle
holder.shiftChar.visibility = View.GONE
holder.tvShiftSmall.visibility = View.VISIBLE
holder.tvShiftSmall.text = shiftAbbreviation
holder.tvShiftSmall.textSize = if (shiftAbbreviation.length > 1) 7.5f else 9.5f
holder.tvShiftSmall.setTypeface(null, android.graphics.Typeface.BOLD)
if (item.shift == "반월" || item.shift == "반년") {
holder.tvShiftSmall.text = if (item.shift == "반월") "" else ""
holder.tvShiftSmall.setTextColor(ContextCompat.getColor(context, R.color.black))
holder.tvShiftSmall.background = ContextCompat.getDrawable(context, R.drawable.bg_shift_half_red)
} else if (isToday) {
val smallBg = ContextCompat.getDrawable(context, R.drawable.bg_shift_solid_v4)?.constantState?.newDrawable()?.mutate() as? android.graphics.drawable.GradientDrawable
smallBg?.setColor(shiftColor)
holder.tvShiftSmall.background = smallBg
holder.tvShiftSmall.setTextColor(if (item.shift == "주간" || item.shift == "석간") ContextCompat.getColor(context, R.color.black) else Color.WHITE)
} else {
val smallBg = ContextCompat.getDrawable(context, R.drawable.bg_shift_stroke_v4)?.constantState?.newDrawable()?.mutate() as? android.graphics.drawable.GradientDrawable
smallBg?.setStroke(dpToPx(context, 1.2f), shiftColor)
smallBg?.setColor(Color.TRANSPARENT)
holder.tvShiftSmall.background = smallBg
holder.tvShiftSmall.setTextColor(shiftColor)
}
} else {
// When day has NO memo: standard large centered shift circle
holder.shiftChar.visibility = View.VISIBLE
holder.tvShiftSmall.visibility = View.GONE
if (item.shift == "반월" || item.shift == "반년") {
holder.shiftChar.text = if (item.shift == "반월") "" else ""
holder.shiftChar.setTextColor(ContextCompat.getColor(context, R.color.black))
holder.shiftChar.textSize = 18f
holder.shiftChar.background = ContextCompat.getDrawable(context, R.drawable.bg_shift_half_red)
} else {
holder.shiftChar.text = shiftAbbreviation
holder.shiftChar.textSize = 20f
holder.shiftChar.setTypeface(null, android.graphics.Typeface.BOLD)
if (isToday) { if (isToday) {
// Today: Solid Circle // Today: Solid Circle
val background = ContextCompat.getDrawable(context, R.drawable.bg_shift_solid_v4) as? android.graphics.drawable.GradientDrawable val background = ContextCompat.getDrawable(context, R.drawable.bg_shift_solid_v4) as? android.graphics.drawable.GradientDrawable
@@ -181,43 +208,26 @@ class CalendarAdapter(
} }
} }
} }
}
// Lunar date small display if requested or just default // Lunar date small display if requested or just default
if (!showHolidays && fullHolidayName != null) { if (!showHolidays && fullHolidayName != null) {
holder.holidayNameSmall.visibility = View.VISIBLE holder.holidayNameSmall.visibility = View.VISIBLE
holder.holidayNameSmall.text = fullHolidayName holder.holidayNameSmall.text = fullHolidayName
} else { } else {
// Ensure visibility GONE if not needed (e.g. standard day)
holder.holidayNameSmall.visibility = View.GONE holder.holidayNameSmall.visibility = View.GONE
} }
// Double check: if showHolidays=true (Holiday mode), we handled it at top block.
// But if showHolidays=true and NO holiday, we show lunar date?
// User asked: "Overlap date and holiday text".
// My item_day.xml has holidayNameSmall at bottom now.
// If showHolidays=true, CalendarAdapter usually HIDES shiftChar and shows Holiday Name?
// Wait, standard logic (lines 84-91 above):
// If showHolidays && fullHolidayName != null -> shiftChar shows Name.
// If showHolidays && fullHolidayName == null -> shiftChar shows LUNAR DATE? (Old logic had this).
if (showHolidays && fullHolidayName == null) { if (showHolidays && fullHolidayName == null) {
// Show Lunar Date in shiftChar instead of empty?
// Or shiftChar is empty, show small text?
// Previous code:
// holder.shiftChar.text = ""
// holder.holidayNameSmall.visibility = View.VISIBLE
// holder.holidayNameSmall.text = HolidayManager.getLunarDateString(item.date)
holder.shiftChar.text = HolidayManager.getLunarDateString(item.date) holder.shiftChar.text = HolidayManager.getLunarDateString(item.date)
holder.shiftChar.textSize = 13f holder.shiftChar.textSize = 13f
holder.shiftChar.setTextColor(ContextCompat.getColor(context, R.color.text_tertiary)) holder.shiftChar.setTextColor(ContextCompat.getColor(context, R.color.text_tertiary))
holder.shiftChar.background = null holder.shiftChar.background = null
holder.shiftChar.visibility = View.VISIBLE
} }
// Memo Content Text (Up to 4 lines in center of day cell)
// Memo Indicator if (hasMemo) {
holder.memoIndicator.visibility = View.GONE // Hide indicator, showing text instead
if (item.hasMemo && !item.memoContent.isNullOrEmpty()) {
holder.memoContent.visibility = View.VISIBLE holder.memoContent.visibility = View.VISIBLE
holder.memoContent.text = item.memoContent holder.memoContent.text = item.memoContent
} else { } else {
@@ -187,21 +187,19 @@ class FragmentSettingsAdditional : Fragment() {
} }
} }
// 1. 개별 근무/알람 설정 전체 삭제
binding.btnResetOverrides.setOnClickListener { binding.btnResetOverrides.setOnClickListener {
androidx.appcompat.app.AlertDialog.Builder(requireContext()) androidx.appcompat.app.AlertDialog.Builder(requireContext())
.setTitle("데이터 초기화") .setTitle("개별 근무/알람 설정 전체 삭제")
.setMessage("달력에서 개별적으로 바꾼 모든 근무와 알람 정이 삭제됩니다. 계속하시겠습니까?") .setMessage("달력에서 개별 변경한 모든 근무와 알람 정이 삭제되고 기본값으로 복원됩니다. 계속하시겠습니까?")
.setPositiveButton("초기화") { _, _ -> .setPositiveButton("삭제") { _, _ ->
lifecycleScope.launch { lifecycleScope.launch {
try { try {
val db = AppDatabase.getDatabase(requireContext()) val db = AppDatabase.getDatabase(requireContext())
val dao = db.shiftDao() val dao = db.shiftDao()
dao.clearOverrides() dao.clearOverrides()
// Immediately re-sync all alarms
syncAllAlarms(requireContext()) syncAllAlarms(requireContext())
Toast.makeText(requireContext(), "개별 근무 및 알람 설정이 초기화되었습니다.", Toast.LENGTH_SHORT).show()
Toast.makeText(requireContext(), "모든 개별 설정이 삭제되고 알람이 재설정되었습니다.", Toast.LENGTH_SHORT).show()
} catch (e: Exception) { } catch (e: Exception) {
Toast.makeText(requireContext(), "초기화 실패: ${e.message}", Toast.LENGTH_LONG).show() Toast.makeText(requireContext(), "초기화 실패: ${e.message}", Toast.LENGTH_LONG).show()
} }
@@ -210,6 +208,75 @@ class FragmentSettingsAdditional : Fragment() {
.setNegativeButton("취소", null) .setNegativeButton("취소", null)
.show() .show()
} }
// 2. 개별 근무 삭제
binding.btnResetShifts.setOnClickListener {
androidx.appcompat.app.AlertDialog.Builder(requireContext())
.setTitle("개별 근무 삭제")
.setMessage("달력에서 개별 변경한 교대근무 일정만 삭제되고 기본 근무표로 복원됩니다. 계속하시겠습니까?")
.setPositiveButton("삭제") { _, _ ->
lifecycleScope.launch {
try {
val db = AppDatabase.getDatabase(requireContext())
val dao = db.shiftDao()
dao.clearOverrides()
syncAllAlarms(requireContext())
Toast.makeText(requireContext(), "개별 근무 변경 내역이 초기화되었습니다.", Toast.LENGTH_SHORT).show()
} catch (e: Exception) {
Toast.makeText(requireContext(), "초기화 실패: ${e.message}", Toast.LENGTH_LONG).show()
}
}
}
.setNegativeButton("취소", null)
.show()
}
// 3. 알람 삭제
binding.btnResetAlarms.setOnClickListener {
androidx.appcompat.app.AlertDialog.Builder(requireContext())
.setTitle("알람 삭제")
.setMessage("등록된 모든 사용자 지정 알람이 삭제되고 기본 알람으로 초기화됩니다. 계속하시겠습니까?")
.setPositiveButton("삭제") { _, _ ->
lifecycleScope.launch {
try {
val db = AppDatabase.getDatabase(requireContext())
val dao = db.shiftDao()
dao.clearCustomAlarms()
syncAllAlarms(requireContext())
Toast.makeText(requireContext(), "등록된 알람이 모두 삭제되었습니다.", Toast.LENGTH_SHORT).show()
} catch (e: Exception) {
Toast.makeText(requireContext(), "삭제 실패: ${e.message}", Toast.LENGTH_LONG).show()
}
}
}
.setNegativeButton("취소", null)
.show()
}
// 4. 전체 삭제 (완전 초기화)
binding.btnResetAll.setOnClickListener {
androidx.appcompat.app.AlertDialog.Builder(requireContext())
.setTitle("전체 데이터 초기화")
.setMessage("⚠️ 주의: 메모, 연차, 개별 근무, 알람을 포함한 모든 앱 데이터가 완전히 초기화됩니다.\n\n정말 전체 데이터를 초기화하시겠습니까?")
.setPositiveButton("전체 초기화") { _, _ ->
lifecycleScope.launch {
try {
val db = AppDatabase.getDatabase(requireContext())
val dao = db.shiftDao()
dao.clearOverrides()
dao.clearMemos()
dao.clearCustomAlarms()
dao.clearAnnualLeave()
syncAllAlarms(requireContext())
Toast.makeText(requireContext(), "모든 데이터가 완전히 초기화되었습니다.", Toast.LENGTH_LONG).show()
} catch (e: Exception) {
Toast.makeText(requireContext(), "전체 초기화 실패: ${e.message}", Toast.LENGTH_LONG).show()
}
}
}
.setNegativeButton("취소", null)
.show()
}
} }
@@ -134,32 +134,72 @@ class FragmentSettingsAlarm : Fragment(), SharedPreferences.OnSharedPreferenceCh
} }
private val soundTitleCache = mutableMapOf<String?, String>() private val soundTitleCache = mutableMapOf<String?, String>()
private var isUpdatingMasterSwitch = false
private fun updateMasterToggleUI(isEnabled: Boolean) { private fun updateMasterToggleUI(isEnabled: Boolean) {
if (_binding == null) return
isUpdatingMasterSwitch = true
binding.masterSwitch.isChecked = isEnabled
isUpdatingMasterSwitch = false
if (isEnabled) { if (isEnabled) {
binding.tvMasterStatus.text = "전체 알람 켜짐" binding.tvMasterStatus.text = "전체 알람 켜짐"
binding.tvMasterStatus.setTextColor(ContextCompat.getColor(requireContext(), R.color.primary)) binding.tvMasterStatus.setTextColor(ContextCompat.getColor(requireContext(), R.color.text_primary))
binding.tvMasterStatus.backgroundTintList = android.content.res.ColorStateList.valueOf(Color.parseColor("#E3F2FD")) binding.ivMasterBell.imageTintList = android.content.res.ColorStateList.valueOf(ContextCompat.getColor(requireContext(), R.color.primary))
} else { } else {
binding.tvMasterStatus.text = "전체 알람 꺼짐" binding.tvMasterStatus.text = "전체 알람 꺼짐"
binding.tvMasterStatus.setTextColor(ContextCompat.getColor(requireContext(), R.color.shift_red)) binding.tvMasterStatus.setTextColor(ContextCompat.getColor(requireContext(), R.color.text_secondary))
binding.tvMasterStatus.backgroundTintList = android.content.res.ColorStateList.valueOf(Color.parseColor("#FFEBEE")) binding.ivMasterBell.imageTintList = android.content.res.ColorStateList.valueOf(ContextCompat.getColor(requireContext(), R.color.text_secondary))
} }
} }
private fun showMasterAlarmOffConfirmationDialog() {
val prefs = requireContext().getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
androidx.appcompat.app.AlertDialog.Builder(requireContext())
.setTitle("전체 알람 끄기")
.setMessage("전체 알람을 끄시겠습니까?\n모든 교대근무 알람 및 개별 알람이 정시에 울리지 않게 됩니다.")
.setPositiveButton("끄기") { _, _ ->
prefs.edit().putBoolean("master_alarm_enabled", false).apply()
updateMasterToggleUI(false)
Toast.makeText(requireContext(), "전체 알람이 꺼졌습니다.", Toast.LENGTH_SHORT).show()
lifecycleScope.launch { syncAllAlarms(requireContext()) }
}
.setNegativeButton("취소") { dialog, _ ->
// 스위치 원래대로 ON 복귀
isUpdatingMasterSwitch = true
binding.masterSwitch.isChecked = true
isUpdatingMasterSwitch = false
dialog.dismiss()
}
.setOnCancelListener {
// 바깥 터치 시에도 원래대로 ON 복귀
isUpdatingMasterSwitch = true
binding.masterSwitch.isChecked = true
isUpdatingMasterSwitch = false
}
.show()
}
private fun setupListeners() { private fun setupListeners() {
val prefs = requireContext().getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE) val prefs = requireContext().getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
binding.tvMasterStatus.setOnClickListener { binding.masterAlarmCard.setOnClickListener {
val isEnabled = !ShiftAlarmDefaults.isMasterAlarmEnabled(prefs) binding.masterSwitch.performClick()
prefs.edit().putBoolean("master_alarm_enabled", isEnabled).apply() }
updateMasterToggleUI(isEnabled)
val message = if (isEnabled) "전체 알람이 켜졌습니다." else "전체 알람이 꺼졌습니다." binding.masterSwitch.setOnCheckedChangeListener { _, isChecked ->
Toast.makeText(requireContext(), message, Toast.LENGTH_SHORT).show() if (isUpdatingMasterSwitch) return@setOnCheckedChangeListener
// Resync immediately if (isChecked) {
// 바로 켜기
prefs.edit().putBoolean("master_alarm_enabled", true).apply()
updateMasterToggleUI(true)
Toast.makeText(requireContext(), "전체 알람이 켜졌습니다.", Toast.LENGTH_SHORT).show()
lifecycleScope.launch { syncAllAlarms(requireContext()) } lifecycleScope.launch { syncAllAlarms(requireContext()) }
} else {
// 끌 때는 모달 확인 팝업
showMasterAlarmOffConfirmationDialog()
}
} }
binding.btnAddCustomAlarm.setOnClickListener { binding.btnAddCustomAlarm.setOnClickListener {
@@ -476,7 +516,18 @@ class FragmentSettingsAlarm : Fragment(), SharedPreferences.OnSharedPreferenceCh
Log.w("ShiftAlarm", "soundUri가 비어있어 기본값으로 재설정: $currentDialogSoundUri") Log.w("ShiftAlarm", "soundUri가 비어있어 기본값으로 재설정: $currentDialogSoundUri")
} }
Log.d("ShiftAlarm", "알람 ${if (isNew) "생성" else "수정"} - 최종 soundUri: $currentDialogSoundUri") // 새 알람 추가 시 또는 볼륨이 0인 경우 시스템 알람 스트림 볼륨을 최대치로 설정
try {
val audioManager = requireContext().getSystemService(Context.AUDIO_SERVICE) as android.media.AudioManager
val maxVol = audioManager.getStreamMaxVolume(android.media.AudioManager.STREAM_ALARM)
val currVol = audioManager.getStreamVolume(android.media.AudioManager.STREAM_ALARM)
if (isNew || currVol == 0) {
audioManager.setStreamVolume(android.media.AudioManager.STREAM_ALARM, maxVol, 0)
Log.d("ShiftAlarm", "알람 스트림 볼륨 최대치($maxVol)로 초기화 완료")
}
} catch (e: Exception) {
Log.w("ShiftAlarm", "알람 볼륨 설정 실패", e)
}
fun updateSoundName(uriStr: String?) { fun updateSoundName(uriStr: String?) {
if (uriStr.isNullOrEmpty() || uriStr == "null") { if (uriStr.isNullOrEmpty() || uriStr == "null") {
@@ -193,6 +193,7 @@ class FragmentSettingsBasic : Fragment() {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
AlarmPermissionUtil.cancelAutoReturn()
updatePermissionStatuses() updatePermissionStatuses()
} }
@@ -214,10 +215,8 @@ class FragmentSettingsBasic : Fragment() {
binding.dividerExact.visibility = View.GONE binding.dividerExact.visibility = View.GONE
} }
// 3. 다른 앱 위에 표시 (Overlay) // 3. 다른 앱 위에 표시 (Overlay - 레거시)
val isOverlayGranted = AlarmPermissionUtil.getOverlayStatus(context) binding.btnOverlayPermission.visibility = View.GONE
binding.tvOverlayStatus.text = if (isOverlayGranted) "[설정 완료: 화면 우위]" else "필수: 알람창 노출을 위해 허용하세요"
binding.tvOverlayStatus.setTextColor(ContextCompat.getColor(context, if (isOverlayGranted) R.color.primary else R.color.shift_red))
// 4. 전체화면 알림 (Full Screen Intent) - Android 14+ // 4. 전체화면 알림 (Full Screen Intent) - Android 14+
if (Build.VERSION.SDK_INT >= 34) { if (Build.VERSION.SDK_INT >= 34) {
@@ -234,31 +233,56 @@ class FragmentSettingsBasic : Fragment() {
val prefs = requireContext().getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE) val prefs = requireContext().getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
binding.btnBatteryOptimize.setOnClickListener { binding.btnBatteryOptimize.setOnClickListener {
AlarmPermissionUtil.requestBatteryOptimization(requireContext()) val isAlreadyGranted = AlarmPermissionUtil.getBatteryOptimizationStatus(requireContext())
AlarmPermissionUtil.requestBatteryOptimization(requireActivity())
if (!isAlreadyGranted) {
AlarmPermissionUtil.monitorAndAutoReturn(requireActivity()) {
AlarmPermissionUtil.getBatteryOptimizationStatus(requireContext())
}
}
} }
binding.btnExactAlarm.setOnClickListener { binding.btnExactAlarm.setOnClickListener {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
val isAlreadyGranted = AlarmPermissionUtil.getExactAlarmStatus(requireContext())
val intent = Intent(Settings.ACTION_REQUEST_SCHEDULE_EXACT_ALARM).apply { val intent = Intent(Settings.ACTION_REQUEST_SCHEDULE_EXACT_ALARM).apply {
data = Uri.parse("package:${requireContext().packageName}") data = Uri.parse("package:${requireContext().packageName}")
} }
startActivity(intent) requireActivity().startActivity(intent)
if (!isAlreadyGranted) {
AlarmPermissionUtil.monitorAndAutoReturn(requireActivity()) {
AlarmPermissionUtil.getExactAlarmStatus(requireContext())
}
}
} }
} }
binding.btnOverlayPermission.setOnClickListener { binding.btnOverlayPermission.setOnClickListener {
AlarmPermissionUtil.requestOverlayPermission(requireContext()) val isAlreadyGranted = AlarmPermissionUtil.getOverlayStatus(requireContext())
AlarmPermissionUtil.requestOverlayPermission(requireActivity())
if (!isAlreadyGranted) {
AlarmPermissionUtil.monitorAndAutoReturn(requireActivity()) {
AlarmPermissionUtil.getOverlayStatus(requireContext())
}
}
} }
binding.btnFullScreenIntent.setOnClickListener { binding.btnFullScreenIntent.setOnClickListener {
AlarmPermissionUtil.requestFullScreenIntentPermission(requireContext()) val isAlreadyGranted = AlarmPermissionUtil.getFullScreenIntentStatus(requireContext())
AlarmPermissionUtil.requestFullScreenIntentPermission(requireActivity())
if (!isAlreadyGranted) {
AlarmPermissionUtil.monitorAndAutoReturn(requireActivity()) {
AlarmPermissionUtil.getFullScreenIntentStatus(requireContext())
}
}
} }
binding.btnPermissionSettings.setOnClickListener { binding.btnPermissionSettings.setOnClickListener {
// 앱 정보 상세 설정 화면은 일반 열람용이므로 자동 복귀를 걸지 않음
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply { val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply {
data = Uri.parse("package:${requireContext().packageName}") data = Uri.parse("package:${requireContext().packageName}")
} }
startActivity(intent) requireActivity().startActivity(intent)
} }
binding.btnCheckUpdate.setOnClickListener { binding.btnCheckUpdate.setOnClickListener {
@@ -31,6 +31,9 @@ import java.time.YearMonth
import java.time.format.DateTimeFormatter import java.time.format.DateTimeFormatter
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import android.graphics.Bitmap
import android.graphics.Canvas
import android.util.Log
import kotlin.math.abs import kotlin.math.abs
class MainActivity : AppCompatActivity() { class MainActivity : AppCompatActivity() {
@@ -41,6 +44,8 @@ class MainActivity : AppCompatActivity() {
private var currentViewMonth: YearMonth = YearMonth.now(ShiftCalculator.SEOUL_ZONE) private var currentViewMonth: YearMonth = YearMonth.now(ShiftCalculator.SEOUL_ZONE)
private var currentViewTeam: String = "A" private var currentViewTeam: String = "A"
private lateinit var gestureDetector: GestureDetector private lateinit var gestureDetector: GestureDetector
private var calendarAdapter: CalendarAdapter? = null
private var isAnimatingMonth = false
override fun onConfigurationChanged(newConfig: android.content.res.Configuration) { override fun onConfigurationChanged(newConfig: android.content.res.Configuration) {
super.onConfigurationChanged(newConfig) super.onConfigurationChanged(newConfig)
@@ -58,9 +63,7 @@ class MainActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(binding.root) { v, insets -> ViewCompat.setOnApplyWindowInsetsListener(binding.root) { v, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
val density = resources.displayMetrics.density v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
val p = (8 * density).toInt()
v.setPadding(systemBars.left + p, systemBars.top + p, systemBars.right + p, systemBars.bottom + p)
insets insets
} }
@@ -68,7 +71,6 @@ class MainActivity : AppCompatActivity() {
setupWorker() setupWorker()
setupSwipeGesture() setupSwipeGesture()
AppUpdateManager.checkUpdate(this, silent = true) AppUpdateManager.checkUpdate(this, silent = true)
checkRoot()
val prefs = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE) val prefs = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
currentViewTeam = prefs.getString(KEY_TEAM, "A") ?: "A" currentViewTeam = prefs.getString(KEY_TEAM, "A") ?: "A"
@@ -262,18 +264,16 @@ class MainActivity : AppCompatActivity() {
private fun setupCalendar() { private fun setupCalendar() {
binding.calendarGrid.layoutManager = GridLayoutManager(this, 7) binding.calendarGrid.layoutManager = GridLayoutManager(this, 7)
binding.calendarGrid.itemAnimator = null
updateCalendar() updateCalendar()
} }
private fun updateCalendar() { private suspend fun loadCalendarDataForMonth(targetMonth: YearMonth) {
val prefs = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE) val prefs = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
val selectedTeam = prefs.getString(KEY_TEAM, "A") ?: "A" val selectedTeam = prefs.getString(KEY_TEAM, "A") ?: "A"
val factory = prefs.getString("selected_factory", "Jeonju") ?: "Jeonju" val factory = prefs.getString("selected_factory", "Jeonju") ?: "Jeonju"
// Today's Shift
val today = LocalDate.now(ShiftCalculator.SEOUL_ZONE) val today = LocalDate.now(ShiftCalculator.SEOUL_ZONE)
lifecycleScope.launch {
val db = AppDatabase.getDatabase(this@MainActivity) val db = AppDatabase.getDatabase(this@MainActivity)
val dao = db.shiftDao() val dao = db.shiftDao()
val repo = ShiftRepository(this@MainActivity) val repo = ShiftRepository(this@MainActivity)
@@ -291,7 +291,7 @@ class MainActivity : AppCompatActivity() {
} }
// Load overrides and memos for the month // Load overrides and memos for the month
val monthStr = currentViewMonth.toString() val monthStr = targetMonth.toString()
val overrides = withContext(Dispatchers.IO) { val overrides = withContext(Dispatchers.IO) {
dao.getOverridesForMonth(factory, currentViewTeam, monthStr).associateBy { overrideItem -> overrideItem.date } dao.getOverridesForMonth(factory, currentViewTeam, monthStr).associateBy { overrideItem -> overrideItem.date }
} }
@@ -299,36 +299,92 @@ class MainActivity : AppCompatActivity() {
dao.getMemosForMonth(monthStr).associateBy { memoItem -> memoItem.date } dao.getMemosForMonth(monthStr).associateBy { memoItem -> memoItem.date }
} }
val days = generateDaysForMonthWithData(currentViewMonth, currentViewTeam, factory, overrides, memos) val days = generateDaysForMonthWithData(targetMonth, currentViewTeam, factory, overrides, memos)
val adapter = CalendarAdapter(days, object : CalendarAdapter.OnDayClickListener { val availableHeight = binding.calendarGrid.height
val calcRowHeight = if (availableHeight > 0) availableHeight / 5 else 0
if (calendarAdapter == null || binding.calendarGrid.adapter == null) {
val newAdapter = CalendarAdapter(days, object : CalendarAdapter.OnDayClickListener {
override fun onDayClick(date: LocalDate, currentShift: String) { override fun onDayClick(date: LocalDate, currentShift: String) {
showDaySettingsDialog(date, currentShift) showDaySettingsDialog(date, currentShift)
} }
}, binding.cbShowHolidays.isChecked) }, binding.cbShowHolidays.isChecked)
if (calcRowHeight > 0) {
newAdapter.rowHeight = calcRowHeight
}
calendarAdapter = newAdapter
binding.calendarGrid.adapter = newAdapter
} else {
calendarAdapter?.let { ad ->
ad.days = days
ad.showHolidays = binding.cbShowHolidays.isChecked
if (calcRowHeight > 0) {
ad.rowHeight = calcRowHeight
}
ad.notifyDataSetChanged()
}
}
binding.calendarGrid.adapter = adapter binding.monthTitle.text = targetMonth.format(DateTimeFormatter.ofPattern("yyyy년 MM월"))
binding.monthTitle.text = currentViewMonth.format(DateTimeFormatter.ofPattern("yyyy년 MM월"))
// Dynamic row height: exactly 5 rows visible, 6-row months scroll if (calcRowHeight == 0) {
binding.calendarGrid.post { binding.calendarGrid.post {
val availableHeight = binding.calendarGrid.height val h = binding.calendarGrid.height
if (availableHeight > 0) { if (h > 0) {
val calcRowHeight = availableHeight / 5 val rH = h / 5
adapter.rowHeight = calcRowHeight calendarAdapter?.let {
adapter.notifyDataSetChanged() if (it.rowHeight != rH) {
it.rowHeight = rH
it.notifyDataSetChanged()
}
}
}
} }
} }
// Update Header Status Text with Permission Warning if needed // Update Header Status Text with Permission Warning if needed
val shiftForViewingTeam = withContext(Dispatchers.IO) { repo.getShift(today, currentViewTeam, factory) } val shiftForViewingTeam = withContext(Dispatchers.IO) { repo.getShift(today, currentViewTeam, factory) }
val teamSuffix = if (currentViewTeam == selectedTeam) " (내 반)" else " (${currentViewTeam}반)" val teamSuffix = if (currentViewTeam == selectedTeam) "" else " (${currentViewTeam}반)"
if (currentViewTeam == selectedTeam && !AlarmPermissionUtil.getExactAlarmStatus(this@MainActivity)) { if (currentViewTeam == selectedTeam && !AlarmPermissionUtil.getExactAlarmStatus(this@MainActivity)) {
binding.todayStatusText.text = "⚠️ 정확한 알람 권한이 필요합니다 (설정 필요)" binding.todayStatusText.text = "⚠️ 정확한 알람 권한이 필요합니다 (설정 필요)"
binding.todayStatusText.setTextColor(androidx.core.content.ContextCompat.getColor(this@MainActivity, R.color.warning_red)) binding.todayStatusText.setTextColor(androidx.core.content.ContextCompat.getColor(this@MainActivity, R.color.warning_red))
} else { } else {
binding.todayStatusText.text = "오늘의 근무: $shiftForViewingTeam$teamSuffix" val prefix = "오늘의 근무: "
val fullText = "$prefix$shiftForViewingTeam$teamSuffix"
val spannable = android.text.SpannableStringBuilder(fullText)
val shiftColorRes = when (shiftForViewingTeam) {
"주간", "" -> R.color.shift_ju
"석간", "" -> R.color.shift_seok
"야간", "" -> R.color.shift_ya
"주간 맞교대" -> R.color.shift_jumat
"야간 맞교대" -> R.color.shift_yamat
"휴무", "휴가" -> R.color.shift_off
"월차", "연차" -> R.color.secondary
"반월", "반년" -> R.color.shift_red
"교육" -> R.color.primary
else -> R.color.text_primary
}
val shiftColor = androidx.core.content.ContextCompat.getColor(this@MainActivity, shiftColorRes)
val startIndex = prefix.length
val endIndex = startIndex + shiftForViewingTeam.length
spannable.setSpan(
android.text.style.ForegroundColorSpan(shiftColor),
startIndex,
endIndex,
android.text.Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
)
spannable.setSpan(
android.text.style.StyleSpan(android.graphics.Typeface.BOLD),
startIndex,
endIndex,
android.text.Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
)
binding.todayStatusText.text = spannable
binding.todayStatusText.setTextColor(androidx.core.content.ContextCompat.getColor(this@MainActivity, R.color.text_secondary)) binding.todayStatusText.setTextColor(androidx.core.content.ContextCompat.getColor(this@MainActivity, R.color.text_secondary))
} }
@@ -344,16 +400,22 @@ class MainActivity : AppCompatActivity() {
val juCount = days.count { it.date != null && (it.shift == "주간" || it.shift == "") } val juCount = days.count { it.date != null && (it.shift == "주간" || it.shift == "") }
val seokCount = days.count { it.date != null && (it.shift == "석간" || it.shift == "") } val seokCount = days.count { it.date != null && (it.shift == "석간" || it.shift == "") }
val yaCount = days.count { it.date != null && (it.shift == "야간" || it.shift == "") } val yaCount = days.count { it.date != null && (it.shift == "야간" || it.shift == "") }
val monthlyOvertime = withContext(Dispatchers.IO) { repo.getMonthlyOvertimeHours(currentViewMonth) } val monthlyOvertime = withContext(Dispatchers.IO) { repo.getMonthlyOvertimeHours(targetMonth) }
binding.chipJu.text = "주간 ${juCount}" binding.chipJu.text = "주간 ${juCount}"
binding.chipSeok.text = "석간 ${seokCount}" binding.chipSeok.text = "석간 ${seokCount}"
binding.chipYa.text = "야간 ${yaCount}" binding.chipYa.text = "야간 ${yaCount}"
binding.chipOvertime.text = "연장 ${monthlyOvertime}h" binding.chipOvertime.text = "연장 ${monthlyOvertime}h"
}
updateOtherTeamsLayout(today, factory, prefs) updateOtherTeamsLayout(today, factory, prefs)
} }
private fun updateCalendar() {
lifecycleScope.launch {
loadCalendarDataForMonth(currentViewMonth)
}
}
private fun updateOtherTeamsLayout(today: LocalDate, factory: String, prefs: android.content.SharedPreferences) { private fun updateOtherTeamsLayout(today: LocalDate, factory: String, prefs: android.content.SharedPreferences) {
val teamColors = mapOf( val teamColors = mapOf(
"A" to R.color.team_a_color, "A" to R.color.team_a_color,
@@ -595,6 +657,20 @@ class MainActivity : AppCompatActivity() {
} }
} }
val saveAndCloseMemo = {
val content = etMemo.text.toString().trim()
lifecycleScope.launch {
repo.setMemo(date, content)
updateCalendar()
}
dialog.dismiss()
}
dialogView.findViewById<android.view.View>(R.id.btnQuickSaveMemo).setOnClickListener {
saveAndCloseMemo()
Toast.makeText(this@MainActivity, "메모가 저장되었습니다.", Toast.LENGTH_SHORT).show()
}
dialogView.findViewById<android.view.View>(R.id.btnClearMemo).setOnClickListener { dialogView.findViewById<android.view.View>(R.id.btnClearMemo).setOnClickListener {
etMemo.setText("") etMemo.setText("")
lifecycleScope.launch { lifecycleScope.launch {
@@ -605,15 +681,22 @@ class MainActivity : AppCompatActivity() {
} }
dialogView.findViewById<android.view.View>(R.id.btnClose).setOnClickListener { dialogView.findViewById<android.view.View>(R.id.btnClose).setOnClickListener {
lifecycleScope.launch { saveAndCloseMemo()
}
// Auto-save when dialog is dismissed (e.g., Back key or touching outside)
dialog.setOnDismissListener {
val content = etMemo.text.toString().trim() val content = etMemo.text.toString().trim()
lifecycleScope.launch {
repo.setMemo(date, content) repo.setMemo(date, content)
updateCalendar() updateCalendar()
dialog.dismiss()
} }
} }
dialog.show() dialog.show()
// Keyboard adjust resize
dialog.window?.setSoftInputMode(android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
} }
private suspend fun handleDaySettingAction(date: LocalDate, selected: String, team: String, factory: String) { private suspend fun handleDaySettingAction(date: LocalDate, selected: String, team: String, factory: String) {
@@ -717,52 +800,72 @@ class MainActivity : AppCompatActivity() {
return java.time.Duration.between(now, midnight).toMillis() return java.time.Duration.between(now, midnight).toMillis()
} }
private fun checkRoot() {
if (RootUtil.isDeviceRooted()) {
Toast.makeText(this, "⚠️ 루팅된 기기에서 시각적 오류나 알람 불안정이 발생할 수 있습니다.", Toast.LENGTH_LONG).show()
}
}
private fun animateMonthTransition(direction: Int) { private fun animateMonthTransition(direction: Int) {
if (isAnimatingMonth) return
val card = binding.calendarCard val card = binding.calendarCard
val snapshot = binding.calendarOverlaySnapshot
val width = card.width.toFloat() val width = card.width.toFloat()
if (width == 0f) { val nextMonth = if (direction > 0) {
currentViewMonth = if (direction > 0) {
currentViewMonth.plusMonths(1) currentViewMonth.plusMonths(1)
} else { } else {
currentViewMonth.minusMonths(1) currentViewMonth.minusMonths(1)
} }
if (width == 0f) {
currentViewMonth = nextMonth
updateCalendar() updateCalendar()
return return
} }
val fluidInterpolator = androidx.core.view.animation.PathInterpolatorCompat.create(0.22f, 1.0f, 0.36f, 1.0f) isAnimatingMonth = true
card.animate() // 1. Capture bitmap snapshot of current calendar card
.translationX(if (direction > 0) -width else width) try {
.alpha(0.8f) val bitmap = Bitmap.createBitmap(card.width, card.height, Bitmap.Config.ARGB_8888)
.setDuration(160) val canvas = Canvas(bitmap)
.setInterpolator(fluidInterpolator) card.draw(canvas)
.withEndAction { snapshot.setImageBitmap(bitmap)
currentViewMonth = if (direction > 0) { snapshot.visibility = android.view.View.VISIBLE
currentViewMonth.plusMonths(1) snapshot.alpha = 1.0f
} else { snapshot.scaleX = 1.0f
currentViewMonth.minusMonths(1) snapshot.scaleY = 1.0f
snapshot.translationX = 0f
} catch (e: Exception) {
Log.w("MainActivity", "Failed to capture snapshot for month transition", e)
} }
updateCalendar()
// Incoming slide animation from opposite side // 2. Position top card offscreen before loading
card.translationX = if (direction > 0) width else -width card.translationX = if (direction > 0) width else -width
card.alpha = 0.8f currentViewMonth = nextMonth
// 3. Load next month's data BEFORE starting slide animation to eliminate any flicker
lifecycleScope.launch {
loadCalendarDataForMonth(currentViewMonth)
val fluidInterpolator = androidx.core.view.animation.PathInterpolatorCompat.create(0.22f, 1.0f, 0.36f, 1.0f)
val duration = 280L
card.animate() card.animate()
.translationX(0f) .translationX(0f)
.alpha(1f) .setDuration(duration)
.setDuration(220) .setInterpolator(fluidInterpolator)
.withEndAction {
snapshot.visibility = android.view.View.GONE
snapshot.setImageDrawable(null)
isAnimatingMonth = false
}
.start()
snapshot.animate()
.scaleX(0.94f)
.scaleY(0.94f)
.alpha(0.35f)
.translationX(if (direction > 0) -width * 0.22f else width * 0.22f)
.setDuration(duration)
.setInterpolator(fluidInterpolator) .setInterpolator(fluidInterpolator)
.start() .start()
} }
.start()
} }
private fun formatRemainingDays(days: Float): String { private fun formatRemainingDays(days: Float): String {
@@ -1,46 +1,5 @@
package com.example.shiftalarm package com.example.shiftalarm
import java.io.File
object RootUtil { object RootUtil {
fun isDeviceRooted(): Boolean { fun isDeviceRooted(): Boolean = false
return checkRootMethod1() || checkRootMethod2() || checkRootMethod3()
}
private fun checkRootMethod1(): Boolean {
val buildTags = android.os.Build.TAGS
return buildTags != null && buildTags.contains("test-keys")
}
private fun checkRootMethod2(): Boolean {
val paths = arrayOf(
"/system/app/Superuser.apk",
"/sbin/su",
"/system/bin/su",
"/system/xbin/su",
"/data/local/xbin/su",
"/data/local/bin/su",
"/system/sd/xbin/su",
"/system/bin/failsafe/su",
"/data/local/su",
"/su/bin/su"
)
for (path in paths) {
if (File(path).exists()) return true
}
return false
}
private fun checkRootMethod3(): Boolean {
var process: Process? = null
return try {
process = Runtime.getRuntime().exec(arrayOf("/system/xbin/which", "su"))
val reader = process.inputStream.bufferedReader()
reader.readLine() != null
} catch (t: Throwable) {
false
} finally {
process?.destroy()
}
}
} }
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<gradient
android:type="radial"
android:gradientRadius="70dp"
android:startColor="#FF3B30"
android:endColor="#D70015" />
<stroke
android:width="2dp"
android:color="#80FFFFFF" />
</shape>
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<gradient
android:type="radial"
android:gradientRadius="120dp"
android:startColor="#40FF3B30"
android:endColor="#00FF3B30" />
</shape>
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="28dp" />
<solid android:color="#26FFFFFF" />
<stroke
android:width="1dp"
android:color="#4DFFFFFF" />
</shape>
+9
View File
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M16.67,4H15V2H9v2H7.33C6.6,4 6,4.6 6,5.33v15.33C6,21.4 6.6,22 7.33,22h9.33c0.74,0 1.34,-0.6 1.34,-1.33V5.33C18,4.6 17.4,4 16.67,4zM11,20v-5.5H9L13,7v5.5h2L11,20z"/>
</vector>
+9
View File
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M12,7V3H2v18h20V7H12zM6,19H4v-2h2v2zm0,-4H4v-2h2v2zm0,-4H4V9h2v2zm0,-4H4V5h2v2zm4,12H8v-2h2v2zm0,-4H8v-2h2v2zm0,-4H8V9h2v2zm0,-4H8V5h2v2zm10,12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8v10zm-2,-8h-2v2h2V11zm0,4h-2v2h2v-2z"/>
</vector>
+12
View File
@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M7,14H5v5h5v-2H7v-3zm-2,-4h2V7h3V5H5v5zm12,7h-3v2h5v-5h-2v3zM14,5v2h3v3h2V5h-5z"/>
<path
android:fillColor="#FF000000"
android:pathData="M12,8.5c-1.93,0 -3.5,1.57 -3.5,3.5s1.57,3.5 3.5,3.5 3.5,-1.57 3.5,-3.5 -1.57,-3.5 -3.5,-3.5zm0,5.5c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2z"/>
</vector>
+9
View File
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M11.99,18.54l-7.37,-5.73L3,14.07l9,7 9,-7 -1.63,-1.27 -7.38,5.74zM12,16l7.36,-5.73L21,9.07l-9,-7 -9,7 1.63,1.2L12,16z"/>
</vector>
+9
View File
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M12,3c-4.97,0 -9,4.03 -9,9 0,2.12 0.74,4.07 1.97,5.61L4.35,18.4c-0.39,0.39 -0.39,1.02 0,1.41 0.39,0.39 1.02,0.39 1.41,0l0.79,-0.79C8.07,20.26 10.02,21 12,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zm-5.5,9c-0.83,0 -1.5,-0.67 -1.5,-1.5S5.67,9 6.5,9 8,9.67 8,10.5 7.33,12 6.5,12zm3,-4C8.67,8 8,7.33 8,6.5S8.67,5 9.5,5s1.5,0.67 1.5,1.5S10.33,8 9.5,8zm5,0c-0.83,0 -1.5,-0.67 -1.5,-1.5S13.67,5 14.5,5s1.5,0.67 1.5,1.5S15.33,8 14.5,8zm3,4c-0.83,0 -1.5,-0.67 -1.5,-1.5S16.67,9 17.5,9s1.5,0.67 1.5,1.5 -0.67,1.5 -1.5,1.5z"/>
</vector>
+9
View File
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92s2.92,-1.31 2.92,-2.92c0,-1.61 -1.31,-2.92 -2.92,-2.92z"/>
</vector>
+9
View File
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M12,2c-5.33,4.55 -8,8.48 -8,11.8c0,4.98 3.8,8.2 8,8.2s8,-3.22 8,-8.2c0,-3.32 -2.67,-7.25 -8,-11.8zM12,20c-3.31,0 -6,-2.63 -6,-6.2c0,-2.36 1.83,-5.3 6,-9.05c4.17,3.75 6,6.69 6,9.05c0,3.57 -2.69,6.2 -6,6.2z"/>
</vector>
+9
View File
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M21,10.12h-6.78l2.74,-2.82c-2.73,-2.7 -7.15,-2.8 -9.88,-0.1 -2.73,2.71 -2.73,7.08 0,9.79s7.15,2.71 9.88,0C18.32,15.65 19,14.08 19,12.1h2c0,2.49 -0.95,4.83 -2.73,6.6 -3.76,3.73 -9.85,3.73 -13.6,0 -3.76,-3.73 -3.76,-9.78 0,-13.51 3.76,-3.73 9.84,-3.73 13.6,0L21,2.42v7.7z"/>
</vector>
+126 -72
View File
@@ -1,110 +1,164 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/alarmRoot"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/bg_mesh_gradient" android:background="@drawable/bg_alarm_gradient"
android:clipChildren="false" android:clipChildren="false"
android:clipToPadding="false"> android:clipToPadding="false">
<!-- Header / Info Section --> <!-- Top Shift / Alarm Label Pill Badge -->
<LinearLayout <LinearLayout
android:id="@+id/headerContainer" android:id="@+id/shiftBadgeContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="40dp"
android:paddingHorizontal="32dp"
android:paddingVertical="16dp">
<TextView
android:id="@+id/tvCurrentTime"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="오후 2:59" android:orientation="horizontal"
android:textSize="88sp" android:gravity="center"
android:fontFamily="sans-serif-thin" android:background="@drawable/bg_snooze_hub_samsung"
android:textColor="@color/white" android:paddingHorizontal="16dp"
android:letterSpacing="0.02"/> android:paddingVertical="6dp"
android:layout_marginTop="64dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<TextView <ImageView
android:id="@+id/tvDate" android:layout_width="16dp"
android:layout_width="wrap_content" android:layout_height="16dp"
android:layout_height="wrap_content" android:src="@drawable/ic_alarm"
android:text="2월 14일 토요일" app:tint="#FFFFFF"
android:textSize="26sp" android:layout_marginEnd="6dp"/>
android:textColor="@color/white"
android:alpha="0.5"
android:layout_marginTop="16dp"/>
<TextView <TextView
android:id="@+id/tvShiftType" android:id="@+id/tvShiftType"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="[주간] 근무 알람" android:text="[주간] 07:00 근무 알람"
android:textSize="16sp" android:textSize="14sp"
android:textColor="@color/white" android:textStyle="bold"
android:alpha="0.4" android:textColor="#FFFFFF" />
android:layout_marginTop="8dp"/>
</LinearLayout> </LinearLayout>
<!-- Center Control Area --> <!-- Large Time Display (Samsung One UI Clock Typography) -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:layout_below="@id/headerContainer"
android:paddingBottom="80dp"
android:clipChildren="false"
android:clipToPadding="false">
<!-- Snooze Button (Glass style) -->
<TextView <TextView
android:id="@+id/tvCurrentTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="07:00"
android:textSize="80sp"
android:fontFamily="sans-serif-light"
android:textColor="#FFFFFF"
android:letterSpacing="0.01"
android:layout_marginTop="20dp"
app:layout_constraintTop_toBottomOf="@id/shiftBadgeContainer"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<!-- Date & Day Display -->
<TextView
android:id="@+id/tvDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2월 14일 토요일"
android:textSize="20sp"
android:textColor="#CCFFFFFF"
android:layout_marginTop="6dp"
app:layout_constraintTop_toBottomOf="@id/tvCurrentTime"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<!-- Middle: Snooze Hub / Capsule Button (Samsung One UI 8.5/9.0 Style) -->
<LinearLayout
android:id="@+id/btnSnooze" android:id="@+id/btnSnooze"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingHorizontal="48dp" android:orientation="horizontal"
android:paddingVertical="18dp" android:gravity="center"
android:text="다시 울림" android:background="@drawable/bg_snooze_hub_samsung"
android:textSize="22sp" android:paddingHorizontal="36dp"
android:textColor="@color/white" android:paddingVertical="16dp"
android:alpha="0.9"
android:background="@drawable/bg_glass_pill_v4"
android:clickable="true" android:clickable="true"
android:focusable="true"/> android:focusable="true"
android:layout_marginBottom="40dp"
app:layout_constraintBottom_toTopOf="@id/dismissContainer"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<!-- Stop Button Container with Pulse --> <ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_bell"
app:tint="#FFFFFF"
android:layout_marginEnd="10dp"/>
<TextView
android:id="@+id/tvSnoozeText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="다시 울림 (5분)"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="#FFFFFF" />
</LinearLayout>
<!-- Bottom: Dismiss (해제) Control with Expanding Breathing Wave -->
<FrameLayout <FrameLayout
android:layout_width="320dp" android:id="@+id/dismissContainer"
android:layout_height="320dp" android:layout_width="260dp"
android:layout_marginTop="20dp" android:layout_height="260dp"
android:layout_marginBottom="54dp"
android:clipChildren="false" android:clipChildren="false"
android:clipToPadding="false"> android:clipToPadding="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<!-- Glowing Pulse View --> <!-- Outer Glowing Pulse Wave -->
<View <View
android:id="@+id/pulseCircle" android:id="@+id/pulseCircle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/bg_pulse_gradient"/> android:background="@drawable/bg_pulse_wave_samsung" />
<!-- Dismiss Button --> <!-- Inner Ambient Ring -->
<TextView <View
android:id="@+id/btnDismiss" android:id="@+id/ambientRing"
android:layout_width="200dp" android:layout_width="160dp"
android:layout_height="200dp" android:layout_height="160dp"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/bg_pulse_wave_samsung" />
<!-- Samsung Style Dismiss Button (Tap or Swipe to dismiss) -->
<LinearLayout
android:id="@+id/btnDismiss"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:orientation="vertical"
android:gravity="center" android:gravity="center"
android:text="해제" android:background="@drawable/bg_dismiss_samsung"
android:textSize="34sp" android:elevation="8dp"
android:textColor="@color/white"
android:background="@drawable/bg_dismiss_circle_v4"
android:clickable="true" android:clickable="true"
android:focusable="true"/> android:focusable="true">
</FrameLayout>
<ImageView
android:layout_width="28dp"
android:layout_height="28dp"
android:src="@drawable/ic_delete"
app:tint="#FFFFFF" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="해제"
android:textSize="14sp"
android:textStyle="bold"
android:textColor="#FFFFFF"
android:layout_marginTop="2dp" />
</LinearLayout> </LinearLayout>
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>
+24 -9
View File
@@ -12,8 +12,8 @@
android:id="@+id/headerRoot" android:id="@+id/headerRoot"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="12dp" android:paddingTop="2dp"
android:paddingBottom="8dp" android:paddingBottom="4dp"
android:paddingHorizontal="20dp" android:paddingHorizontal="20dp"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
@@ -35,7 +35,8 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="오늘의 근무" android:text="오늘의 근무"
android:textSize="13sp" android:textSize="18sp"
android:textStyle="bold"
android:textColor="@color/text_secondary" android:textColor="@color/text_secondary"
android:fontFamily="sans-serif-medium" android:fontFamily="sans-serif-medium"
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
@@ -58,21 +59,34 @@
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<!-- Maximized Calendar Card --> <!-- Maximized Calendar Card with Layered Stack Wrapper -->
<androidx.cardview.widget.CardView <FrameLayout
android:id="@+id/calendarCard" android:id="@+id/calendarWrapper"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginHorizontal="3dp" android:layout_marginHorizontal="3dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
app:cardCornerRadius="28dp"
app:cardElevation="0dp"
app:cardBackgroundColor="@android:color/transparent"
app:layout_constraintTop_toBottomOf="@id/headerRoot" app:layout_constraintTop_toBottomOf="@id/headerRoot"
app:layout_constraintBottom_toTopOf="@id/otherTeamsCard" app:layout_constraintBottom_toTopOf="@id/otherTeamsCard"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"> app:layout_constraintEnd_toEndOf="parent">
<!-- Bottom Snapshot View (Underneath Card Stack) -->
<ImageView
android:id="@+id/calendarOverlaySnapshot"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:visibility="gone" />
<androidx.cardview.widget.CardView
android:id="@+id/calendarCard"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="28dp"
app:cardElevation="0dp"
app:cardBackgroundColor="@android:color/transparent">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/calendarContainer" android:id="@+id/calendarContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -301,6 +315,7 @@
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
</FrameLayout>
<!-- Other Teams Compact Section --> <!-- Other Teams Compact Section -->
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
@@ -13,8 +13,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingTop="32dp" android:paddingTop="4dp"
android:paddingBottom="16dp" android:paddingBottom="8dp"
android:paddingStart="24dp" android:paddingStart="24dp"
android:paddingEnd="24dp" android:paddingEnd="24dp"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
+41 -14
View File
@@ -7,6 +7,12 @@
app:cardElevation="8dp" app:cardElevation="8dp"
app:cardBackgroundColor="@android:color/transparent"> app:cardBackgroundColor="@android:color/transparent">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
android:overScrollMode="never">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -20,8 +26,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:gravity="center" android:gravity="center"
android:paddingTop="8dp" android:paddingTop="4dp"
android:paddingBottom="20dp"> android:paddingBottom="16dp">
<TextView <TextView
android:id="@+id/dialogSubtitle" android:id="@+id/dialogSubtitle"
@@ -105,23 +111,23 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:background="@color/grid_divider" android:background="@color/grid_divider"
android:layout_marginTop="20dp"/> android:layout_marginTop="16dp"/>
<!-- Memo Section --> <!-- Memo Section with Quick Save Bar -->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:layout_marginTop="16dp" android:layout_marginTop="12dp"
android:background="@drawable/bg_glass_button_light" android:background="@drawable/bg_glass_button_light"
android:padding="16dp"> android:padding="14dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="center_vertical" android:gravity="center_vertical"
android:layout_marginBottom="12dp"> android:layout_marginBottom="8dp">
<TextView <TextView
android:id="@+id/memoTitle" android:id="@+id/memoTitle"
@@ -139,15 +145,35 @@
android:layout_height="28dp" android:layout_height="28dp"
android:src="@drawable/ic_delete" android:src="@drawable/ic_delete"
app:tint="@color/shift_red" app:tint="@color/shift_red"
android:padding="6dp" android:padding="5dp"
android:background="?attr/selectableItemBackgroundBorderless"/> android:background="?attr/selectableItemBackgroundBorderless"
android:layout_marginEnd="8dp"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/btnQuickSaveMemo"
android:layout_width="wrap_content"
android:layout_height="32dp"
android:text="저장"
android:textSize="13sp"
android:textStyle="bold"
android:textColor="#FFFFFF"
app:cornerRadius="16dp"
android:backgroundTint="@color/primary"
android:paddingHorizontal="12dp"
android:paddingVertical="0dp"
android:minHeight="0dp"
android:minWidth="0dp"
app:icon="@drawable/ic_check"
app:iconSize="14dp"
app:iconTint="#FFFFFF"
app:iconPadding="4dp"/>
</LinearLayout> </LinearLayout>
<EditText <EditText
android:id="@+id/etMemo" android:id="@+id/etMemo"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="여기에 메모를 입력하세요" android:hint="여기에 메모를 입력하세요 (최대 4줄)"
android:inputType="textMultiLine|textNoSuggestions" android:inputType="textMultiLine|textNoSuggestions"
android:minLines="2" android:minLines="2"
android:maxLines="4" android:maxLines="4"
@@ -155,21 +181,22 @@
android:textSize="15sp" android:textSize="15sp"
android:textColor="@color/text_primary" android:textColor="@color/text_primary"
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:padding="0dp"/> android:padding="2dp"/>
</LinearLayout> </LinearLayout>
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/btnClose" android:id="@+id/btnClose"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="56dp" android:layout_height="52dp"
android:text="저장 및 닫기" android:text="저장 및 닫기"
android:layout_marginTop="24dp" android:layout_marginTop="16dp"
android:textSize="16sp" android:textSize="16sp"
android:textStyle="bold" android:textStyle="bold"
android:textColor="#FFFFFF" android:textColor="#FFFFFF"
app:cornerRadius="28dp" app:cornerRadius="26dp"
android:backgroundTint="@color/primary" android:backgroundTint="@color/primary"
android:elevation="2dp"/> android:elevation="2dp"/>
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
@@ -49,8 +49,8 @@
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@drawable/ic_plus_circle" android:src="@drawable/ic_tide"
app:tint="@color/primary"/> app:tint="#0EA5E9"/>
</FrameLayout> </FrameLayout>
<LinearLayout <LinearLayout
@@ -120,8 +120,8 @@
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@drawable/ic_settings" android:src="@drawable/ic_palette"
app:tint="@color/primary"/> app:tint="#AF52DE"/>
</FrameLayout> </FrameLayout>
<TextView <TextView
@@ -139,8 +139,7 @@
android:layout_height="40dp" android:layout_height="40dp"
android:background="@drawable/bg_spinner_oneui" android:background="@drawable/bg_spinner_oneui"
android:popupBackground="@drawable/bg_spinner_popup_oneui" android:popupBackground="@drawable/bg_spinner_popup_oneui"
android:dropDownVerticalOffset="6dp" android:dropDownVerticalOffset="6dp"/>
android:paddingStart="12dp"/>
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
@@ -260,7 +259,7 @@
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@drawable/ic_memo" android:src="@drawable/ic_memo"
app:tint="@color/primary"/> app:tint="#0284C7"/>
</FrameLayout> </FrameLayout>
<TextView <TextView
@@ -309,7 +308,7 @@
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@drawable/ic_bell" android:src="@drawable/ic_bell"
app:tint="@color/primary"/> app:tint="#FF9500"/>
</FrameLayout> </FrameLayout>
<TextView <TextView
@@ -357,8 +356,8 @@
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@drawable/ic_plus_circle" android:src="@drawable/ic_share"
app:tint="@color/primary"/> app:tint="#34C759"/>
</FrameLayout> </FrameLayout>
<TextView <TextView
@@ -398,32 +397,116 @@
app:cardCornerRadius="24dp" app:cardCornerRadius="24dp"
app:cardElevation="0dp" app:cardElevation="0dp"
app:cardBackgroundColor="@android:color/transparent" app:cardBackgroundColor="@android:color/transparent"
android:layout_marginBottom="40dp"> android:layout_marginBottom="32dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:background="@drawable/bg_oneui_settings_card" android:background="@drawable/bg_oneui_settings_card"
android:padding="20dp"> android:padding="16dp">
<!-- 1. 개별 근무/알람 설정 전체 삭제 -->
<androidx.appcompat.widget.AppCompatButton <androidx.appcompat.widget.AppCompatButton
android:id="@+id/btnResetOverrides" android:id="@+id/btnResetOverrides"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
android:text="개별 근무/알람 설정 전체 삭제" android:text="개별 근무/알람 설정 전체 삭제"
android:textColor="@color/shift_red" android:textColor="@color/text_primary"
android:textStyle="bold" android:textStyle="bold"
android:textSize="15sp" android:textSize="14sp"
android:background="@drawable/bg_glass_button_light"/> android:background="@drawable/bg_glass_button_light"/>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="달력에서 개별적으로 바꾼 근무와 알람 시간 모두 기본값으로 복구니다." android:text="달력에서 개별 변경한 근무와 알람 시간 모두 기본값으로 복구니다."
android:textSize="11sp" android:textSize="11sp"
android:textColor="@color/text_tertiary" android:textColor="@color/text_tertiary"
android:layout_marginTop="8dp"/> android:layout_marginTop="4dp"
android:layout_marginBottom="12dp"
android:layout_marginStart="4dp"/>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/divider_subtle"
android:layout_marginBottom="12dp"/>
<!-- 2. 개별 근무 삭제 -->
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btnResetShifts"
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="개별 근무 삭제"
android:textColor="@color/text_primary"
android:textStyle="bold"
android:textSize="14sp"
android:background="@drawable/bg_glass_button_light"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="달력에서 개별 변경한 교대근무 일정만 기본값으로 복구합니다."
android:textSize="11sp"
android:textColor="@color/text_tertiary"
android:layout_marginTop="4dp"
android:layout_marginBottom="12dp"
android:layout_marginStart="4dp"/>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/divider_subtle"
android:layout_marginBottom="12dp"/>
<!-- 3. 알람 삭제 -->
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btnResetAlarms"
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="알람 삭제"
android:textColor="@color/text_primary"
android:textStyle="bold"
android:textSize="14sp"
android:background="@drawable/bg_glass_button_light"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="추가된 사용자 지정 알람을 모두 삭제하고 기본 설정으로 복원합니다."
android:textSize="11sp"
android:textColor="@color/text_tertiary"
android:layout_marginTop="4dp"
android:layout_marginBottom="12dp"
android:layout_marginStart="4dp"/>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/divider_subtle"
android:layout_marginBottom="12dp"/>
<!-- 4. 전체 삭제 (완전 초기화) -->
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btnResetAll"
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="전체 삭제"
android:textColor="@color/shift_red"
android:textStyle="bold"
android:textSize="14sp"
android:background="@drawable/bg_glass_button_light"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="메모, 연차, 개별 근무, 알람 등 앱의 모든 데이터를 완전히 초기화합니다."
android:textSize="11sp"
android:textColor="@color/shift_red"
android:layout_marginTop="4dp"
android:layout_marginStart="4dp"/>
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
@@ -12,33 +12,44 @@
android:background="@color/surface" android:background="@color/surface"
android:padding="16dp"> android:padding="16dp">
<!-- Master Alarm Header with Switch -->
<LinearLayout <LinearLayout
android:id="@+id/masterAlarmCard"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingHorizontal="8dp" android:background="@drawable/bg_group_header"
android:layout_marginBottom="8dp"> android:paddingHorizontal="16dp"
android:paddingVertical="12dp"
android:layout_marginBottom="12dp"
android:clickable="true"
android:focusable="true">
<ImageView
android:id="@+id/ivMasterBell"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@drawable/ic_bell"
app:tint="@color/primary"
android:layout_marginEnd="10dp"/>
<TextView <TextView
android:id="@+id/tvMasterStatus" android:id="@+id/tvMasterStatus"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="전체 알람 켜짐"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="@color/text_primary"/>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/masterSwitch"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="전체 알람 켜짐" app:thumbTint="@color/white"
android:textSize="13sp" app:trackTint="@color/sl_switch_track"/>
android:textStyle="bold"
android:textColor="@color/primary"
android:background="@drawable/bg_glass_pill_v4"
android:backgroundTint="#F2F2F7"
android:paddingHorizontal="12dp"
android:paddingVertical="6dp"
android:clickable="true"
android:focusable="true"/>
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"/>
</LinearLayout> </LinearLayout>
<!-- Unified Alarm List Container (Background removed as items are now individual cards) --> <!-- Unified Alarm List Container (Background removed as items are now individual cards) -->
@@ -55,8 +55,8 @@
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@drawable/ic_settings" android:src="@drawable/ic_factory"
app:tint="@color/primary"/> app:tint="#007AFF"/>
</FrameLayout> </FrameLayout>
<TextView <TextView
@@ -75,8 +75,7 @@
android:entries="@array/factory_array" android:entries="@array/factory_array"
android:background="@drawable/bg_spinner_oneui" android:background="@drawable/bg_spinner_oneui"
android:popupBackground="@drawable/bg_spinner_popup_oneui" android:popupBackground="@drawable/bg_spinner_popup_oneui"
android:dropDownVerticalOffset="6dp" android:dropDownVerticalOffset="6dp"/>
android:paddingStart="12dp"/>
</LinearLayout> </LinearLayout>
<View <View
@@ -102,8 +101,8 @@
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@drawable/ic_check" android:src="@drawable/ic_user"
app:tint="@color/primary"/> app:tint="#34C759"/>
</FrameLayout> </FrameLayout>
<TextView <TextView
@@ -121,8 +120,7 @@
android:layout_height="40dp" android:layout_height="40dp"
android:background="@drawable/bg_spinner_oneui" android:background="@drawable/bg_spinner_oneui"
android:popupBackground="@drawable/bg_spinner_popup_oneui" android:popupBackground="@drawable/bg_spinner_popup_oneui"
android:dropDownVerticalOffset="6dp" android:dropDownVerticalOffset="6dp"/>
android:paddingStart="12dp"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
@@ -175,8 +173,8 @@
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@drawable/ic_alarm" android:src="@drawable/ic_battery"
app:tint="@color/shift_red"/> app:tint="#34C759"/>
</FrameLayout> </FrameLayout>
<LinearLayout <LinearLayout
@@ -232,7 +230,7 @@
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@drawable/ic_alarm" android:src="@drawable/ic_alarm"
app:tint="@color/primary"/> app:tint="#007AFF"/>
</FrameLayout> </FrameLayout>
<LinearLayout <LinearLayout
@@ -288,8 +286,8 @@
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@drawable/ic_plus_circle" android:src="@drawable/ic_layers"
app:tint="@color/primary"/> app:tint="#00C7BE"/>
</FrameLayout> </FrameLayout>
<LinearLayout <LinearLayout
@@ -344,8 +342,8 @@
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@drawable/ic_bell" android:src="@drawable/ic_fullscreen_intent"
app:tint="@color/primary"/> app:tint="#AF52DE"/>
</FrameLayout> </FrameLayout>
<LinearLayout <LinearLayout
@@ -401,7 +399,7 @@
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@drawable/ic_settings" android:src="@drawable/ic_settings"
app:tint="@color/text_tertiary"/> app:tint="#FF9500"/>
</FrameLayout> </FrameLayout>
<TextView <TextView
@@ -469,8 +467,8 @@
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@drawable/ic_bell" android:src="@drawable/ic_update"
app:tint="@color/primary"/> app:tint="#5856D6"/>
</FrameLayout> </FrameLayout>
<TextView <TextView
@@ -478,7 +476,7 @@
android:layout_weight="1" android:layout_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="최신 버전 확인" android:text="최신 버전 확인"
android:textColor="@color/primary" android:textColor="@color/text_primary"
android:textSize="16sp" android:textSize="16sp"
android:textStyle="bold"/> android:textStyle="bold"/>
@@ -86,8 +86,7 @@
android:layout_height="40dp" android:layout_height="40dp"
android:background="@drawable/bg_spinner_oneui" android:background="@drawable/bg_spinner_oneui"
android:popupBackground="@drawable/bg_spinner_popup_oneui" android:popupBackground="@drawable/bg_spinner_popup_oneui"
android:dropDownVerticalOffset="6dp" android:dropDownVerticalOffset="6dp"/>
android:paddingStart="12dp"/>
</LinearLayout> </LinearLayout>
<View <View
+44 -34
View File
@@ -7,19 +7,41 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_grid_cell_v4"> android:background="@drawable/bg_grid_cell_v4">
<!-- Day Number (top-left) --> <!-- Top Row: Day Number & Small Shift Badge (shown when memo exists) -->
<LinearLayout
android:id="@+id/topBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginStart="4dp"
android:layout_marginTop="2dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView <TextView
android:id="@+id/dayNumber" android:id="@+id/dayNumber"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:text="12" android:text="12"
android:textColor="@color/text_primary" android:textColor="@color/text_primary"
android:textSize="14sp" android:textSize="13sp"
android:textStyle="bold" />
<!-- Small Shift Badge next to Day Number (shown when day has memo) -->
<TextView
android:id="@+id/tvShiftSmall"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_marginStart="3dp"
android:gravity="center"
android:includeFontPadding="false"
android:text="주"
android:textSize="9.5sp"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent" android:textColor="@color/text_primary"
app:layout_constraintTop_toTopOf="parent" /> android:visibility="gone"/>
</LinearLayout>
<!-- Tide Text (top-right) --> <!-- Tide Text (top-right) -->
<TextView <TextView
@@ -27,7 +49,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:layout_marginTop="4dp" android:layout_marginTop="2dp"
android:text="08:20" android:text="08:20"
android:textColor="@color/text_tertiary" android:textColor="@color/text_tertiary"
android:textSize="9sp" android:textSize="9sp"
@@ -35,15 +57,14 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<!-- Shift Abbreviation Circular Indicator (Center) --> <!-- Standard Shift Abbreviation Circular Indicator (Center - shown when NO memo) -->
<TextView <TextView
android:id="@+id/shiftChar" android:id="@+id/shiftChar"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:gravity="center" android:gravity="center"
android:text="주" android:text="주"
android:textSize="15sp" android:textSize="20sp"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@color/text_primary" android:textColor="@color/text_primary"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
@@ -52,25 +73,27 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintVertical_bias="0.45"/> app:layout_constraintVertical_bias="0.45"/>
<!-- Memo Content Text (Below Shift) - Max 3 lines --> <!-- Memo Content Text (Center/Body) - Up to 4 lines when memo exists -->
<TextView <TextView
android:id="@+id/memoContent" android:id="@+id/memoContent"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="0dp"
android:gravity="center" android:gravity="center"
android:text="메모내용" android:text="메모내용\n2줄\n3줄\n4줄"
android:textSize="9.5sp" android:textSize="9.5sp"
android:textColor="@color/secondary" android:textStyle="bold"
android:maxLines="3" android:textColor="@color/text_primary"
android:lineSpacingMultiplier="1.05"
android:maxLines="4"
android:ellipsize="end" android:ellipsize="end"
android:visibility="gone" android:visibility="gone"
android:layout_marginHorizontal="2dp"
android:layout_marginTop="1dp" android:layout_marginTop="1dp"
android:layout_marginBottom="1dp" android:layout_marginBottom="1dp"
android:paddingHorizontal="2dp" app:layout_constraintTop_toBottomOf="@id/topBar"
app:layout_constraintTop_toBottomOf="@id/shiftChar" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"/>
app:layout_constraintBottom_toTopOf="@id/memoIndicator"/>
<!-- Holiday Name Small (Bottom) --> <!-- Holiday Name Small (Bottom) -->
<TextView <TextView
@@ -80,23 +103,10 @@
android:text="설날" android:text="설날"
android:textSize="9sp" android:textSize="9sp"
android:textColor="@color/shift_red" android:textColor="@color/shift_red"
android:layout_marginBottom="2dp" android:layout_marginBottom="1dp"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/memoIndicator" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" /> app:layout_constraintEnd_toEndOf="parent" />
<!-- Memo Indicator (bottom-right) -->
<ImageView
android:id="@+id/memoIndicator"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginEnd="4dp"
android:layout_marginBottom="4dp"
android:src="@drawable/ic_memo"
app:tint="@color/secondary"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
@@ -3,9 +3,9 @@
android:id="@android:id/text1" android:id="@android:id/text1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="40dp"
android:gravity="center_vertical|end" android:gravity="center"
android:paddingStart="12dp" android:textAlignment="center"
android:paddingEnd="16dp" android:paddingHorizontal="4dp"
android:textColor="@color/text_primary" android:textColor="@color/text_primary"
android:textSize="14sp" android:textSize="14sp"
android:textStyle="bold" android:textStyle="bold"
+25 -16
View File
@@ -6,19 +6,17 @@ import shutil
token = "e3b515eaa0a6683c921ca3bf718e281ed30a6075" token = "e3b515eaa0a6683c921ca3bf718e281ed30a6075"
owner_repo = "sanjeok77/ShiftRing" owner_repo = "sanjeok77/ShiftRing"
tag = "v1.0.1" tag = "v1.1.2"
title = "v1.0.1 - 알람 반복 횟수 선택 버그 수정, 달력 상단 연장근무 인디고 컬러 개편, 알람 그룹 아코디언 & +/x 부드러운 회전 애니메이션 적용" title = "v1.1.2 - 하루 메모 키보드 가림 완벽 개선 (상단 즉시 저장 버튼, 뒤로가기 시 자동 저장 및 스크롤 지원)"
body = """## 🚀 ShiftRing v1.0.1 릴리즈 body = """## 🚀 ShiftRing v1.1.2 릴리즈
### 🌟 주요 변경 및 버그 수정 사항 ### 🌟 주요 변경 및 개선 사항
1. **알람 수정 다이얼로그 반복 횟수 선택 버그 수정**: 1. **📝 하루 메모 입력창 상단 '즉시 저장' 버튼 탑재 (`dialog_day_settings.xml`, `MainActivity.kt`)**:
- 알람 수정 및 추가 화면에서 반복 횟수(3회 / 5회 / 계속) 선택이 즉시 반영되고 저장되도록 클릭 리스너 및 UI 갱신 로직 완벽 복구 - 가상 키보드가 올라와도 항상 키보드 바로 위에 노출되는 메모 섹션 상단에 파란색 [저장] 액션 버튼을 신설하여 키보드를 내리지 않고도 원터치로 즉시 저장 가능
2. **달력 메인 상단 연장근무 표시 컬러 인디고(#5856D6) 개편**: 2. **🔄 뒤로가기/바깥 터치 시 메모 자동 저장(Auto-Save) 기능 구현 (`MainActivity.kt`)**:
- 휴무/휴가 붉은색(`shift_red`)과 혼동되지 않도록 또렷하고 세련된 One UI 인디고(`bg_chip_soft_overtime.xml`) 칩 스타일로 변경 - 사용자가 백키(Back)를 누르거나 팝업 바깥을 터치하여 닫더라도 작성 중이던 메모 내용이 Room DB에 100% 자동 저장되어 내용 유실을 원천 방지
3. **알람 그룹 접기/펼치기 아코디언 & 회전 애니메이션 적용**: 3. **📜 다이얼로그 전체 스크롤 및 가상 키보드 동적 리사이징 지원 (`dialog_day_settings.xml`, `MainActivity.kt`)**:
- 알람 그룹 헤더 터치 시 `AutoTransition` 기반 부드러운 아코디언 높이/투명도 애니메이션 적용 - `NestedScrollView` 및 `SOFT_INPUT_ADJUST_RESIZE`를 적용하여 4줄 메모를 입력하더라도 화면이 잘리지 않고 부드럽게 스크롤되도록 개선"""
- 접힘/열림 상태에 따라 `+` (0도) ↔ `x` (45도) 아이콘이 유체 감속 곡선(`PathInterpolator(0.22, 1, 0.36, 1)`)으로 매끄럽게 회전 전환되도록 구현
4. **Android 14/15 호환 및 정식 서명키(release.jks) 적용**"""
apk_path = "app/build/outputs/apk/release/app-release.apk" apk_path = "app/build/outputs/apk/release/app-release.apk"
if not os.path.exists(apk_path): if not os.path.exists(apk_path):
@@ -31,7 +29,7 @@ print(f"Using APK at: {apk_path}")
url = f"https://git.webpluss.net/api/v1/repos/{owner_repo}/releases" url = f"https://git.webpluss.net/api/v1/repos/{owner_repo}/releases"
headers = {"Authorization": f"token {token}", "Content-Type": "application/json"} headers = {"Authorization": f"token {token}", "Content-Type": "application/json"}
data = json.dumps({"tag_name": tag, "name": title, "body": body, "draft": False, "prerelease": False}).encode() data = json.dumps({"tag_name": tag, "name": title, "body": body, "draft": False, "prerelease": False}).encode('utf-8')
req = urllib.request.Request(url, data=data, headers=headers, method="POST") req = urllib.request.Request(url, data=data, headers=headers, method="POST")
with urllib.request.urlopen(req) as response: with urllib.request.urlopen(req) as response:
result = json.loads(response.read()) result = json.loads(response.read())
@@ -56,14 +54,25 @@ print("Updated app.apk at project root.")
# Update version.json # Update version.json
v_info = { v_info = {
"versionCode": 101, "versionCode": 112,
"versionName": "1.0.1", "versionName": "1.1.2",
"apkUrl": direct_url, "apkUrl": direct_url,
"changelog": "v1.0.1: 알람 반복 횟수 선택 버그 수정, 달력 상단 연장근무 인디고 컬러 개편, 알람 그룹 아코디언 및 +/x 회전 애니메이션 적용", "changelog": "v1.1.2: 하루 메모 키보드 가림 완벽 개선 (상단 즉시 저장 버튼, 뒤로가기 자동 저장, 스크롤 지원)",
"forceUpdate": False "forceUpdate": False
} }
with open("version.json", "w", encoding="utf-8") as f: with open("version.json", "w", encoding="utf-8") as f:
json.dump(v_info, f, ensure_ascii=False, indent=2) json.dump(v_info, f, ensure_ascii=False, indent=2)
print(f"Updated version.json with apkUrl: {direct_url}") print(f"Updated version.json with apkUrl: {direct_url}")
# Git commit and push cleanly in UTF-8
git_path = r"C:\Users\work\AppData\Roaming\MobaXterm\slash\mx86_64b\bin"
os.environ["PATH"] = git_path + os.pathsep + os.environ.get("PATH", "")
commit_msg = "v1.1.2 - 하루 메모 키보드 가림 완벽 개선 (상단 즉시 저장 버튼, 뒤로가기 시 자동 저장 및 스크롤 지원)"
subprocess.run(["git", "add", "."], check=True)
subprocess.run(["git", "commit", "-m", commit_msg], check=True)
subprocess.run(["git", "push", "origin", "main"], check=True)
print("Git commit and push completed successfully!")
print(f"Release {tag} process finished!") print(f"Release {tag} process finished!")
+4 -4
View File
@@ -1,7 +1,7 @@
{ {
"versionCode": 101, "versionCode": 112,
"versionName": "1.0.1", "versionName": "1.1.2",
"apkUrl": "https://git.webpluss.net/attachments/36f93969-59ff-490d-b701-6d7f35382c28", "apkUrl": "https://git.webpluss.net/attachments/0232d016-9a38-413e-96a8-4bea1138b645",
"changelog": "v1.0.1: 알람 반복 횟수 선택 버그 수정, 달력 상단 연장근무 인디고 컬러 개편, 알람 그룹 아코디언 및 +/x 회전 애니메이션 적용", "changelog": "v1.1.2: 하루 메모 키보드 가림 완벽 개선 (상단 즉시 저장 버튼, 뒤로가기 자동 저장, 스크롤 지원)",
"forceUpdate": false "forceUpdate": false
} }