Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d245aeb7d5 | ||
|
|
f5b2f72a0b | ||
|
|
80eb086a59 | ||
|
|
2aa3ff15b2 | ||
|
|
2cc6a6e487 |
@@ -20,8 +20,8 @@ android {
|
|||||||
applicationId = "com.example.shiftalarm"
|
applicationId = "com.example.shiftalarm"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 100
|
versionCode = 104
|
||||||
versionName = "1.0.0"
|
versionName = "1.0.4"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,8 +12,6 @@
|
|||||||
<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_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" />
|
||||||
|
|||||||
@@ -175,7 +175,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 +188,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 +217,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
|
||||||
|
|||||||
@@ -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,6 +32,7 @@ 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 memoIndicator: ImageView = view.findViewById(R.id.memoIndicator)
|
||||||
@@ -71,6 +72,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 +104,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 +126,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 +139,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,47 +209,32 @@ 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
|
||||||
|
holder.memoIndicator.visibility = View.VISIBLE
|
||||||
} else {
|
} else {
|
||||||
holder.memoContent.visibility = View.GONE
|
holder.memoContent.visibility = View.GONE
|
||||||
|
holder.memoIndicator.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
// Today Border or Highlight
|
// Today Border or Highlight
|
||||||
|
|||||||
@@ -247,16 +247,31 @@ class FragmentSettingsAlarm : Fragment(), SharedPreferences.OnSharedPreferenceCh
|
|||||||
visibility = if (isCollapsed) View.GONE else View.VISIBLE
|
visibility = if (isCollapsed) View.GONE else View.VISIBLE
|
||||||
}
|
}
|
||||||
|
|
||||||
// Click header to collapse/expand
|
// Click header to collapse/expand with smooth accordion animation
|
||||||
headerView.setOnClickListener {
|
headerView.setOnClickListener {
|
||||||
if (collapsedGroups.contains(category)) {
|
val willExpand = collapsedGroups.contains(category)
|
||||||
|
|
||||||
|
// 1. Smooth accordion expand/collapse transition
|
||||||
|
val transition = android.transition.AutoTransition().apply {
|
||||||
|
duration = 250
|
||||||
|
interpolator = android.view.animation.AccelerateDecelerateInterpolator()
|
||||||
|
}
|
||||||
|
android.transition.TransitionManager.beginDelayedTransition(container, transition)
|
||||||
|
|
||||||
|
// 2. Smooth rotation between '+' (0 deg) and 'x' (45 deg)
|
||||||
|
val targetRotation = if (willExpand) 45f else 0f
|
||||||
|
ivExpand.animate()
|
||||||
|
.rotation(targetRotation)
|
||||||
|
.setDuration(250)
|
||||||
|
.setInterpolator(androidx.core.view.animation.PathInterpolatorCompat.create(0.22f, 1.0f, 0.36f, 1.0f))
|
||||||
|
.start()
|
||||||
|
|
||||||
|
if (willExpand) {
|
||||||
collapsedGroups.remove(category)
|
collapsedGroups.remove(category)
|
||||||
childrenContainer.visibility = View.VISIBLE
|
childrenContainer.visibility = View.VISIBLE
|
||||||
ivExpand.rotation = 45f
|
|
||||||
} else {
|
} else {
|
||||||
collapsedGroups.add(category)
|
collapsedGroups.add(category)
|
||||||
childrenContainer.visibility = View.GONE
|
childrenContainer.visibility = View.GONE
|
||||||
ivExpand.rotation = 0f
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -461,7 +476,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") {
|
||||||
@@ -511,6 +537,13 @@ class FragmentSettingsAlarm : Fragment(), SharedPreferences.OnSharedPreferenceCh
|
|||||||
btn.setTextColor(if (isSelected) ContextCompat.getColor(requireContext(), R.color.white) else ContextCompat.getColor(requireContext(), R.color.text_secondary))
|
btn.setTextColor(if (isSelected) ContextCompat.getColor(requireContext(), R.color.white) else ContextCompat.getColor(requireContext(), R.color.text_secondary))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
updateRepeatUI()
|
||||||
|
repeatButtons.forEachIndexed { i, btn ->
|
||||||
|
btn.setOnClickListener {
|
||||||
|
selectedRepeat = repeatValues[i]
|
||||||
|
updateRepeatUI()
|
||||||
|
}
|
||||||
|
}
|
||||||
// Pre-Alarm Buttons
|
// Pre-Alarm Buttons
|
||||||
var selectedPreAlarm = 15
|
var selectedPreAlarm = 15
|
||||||
val preAlarmButtons = listOf(
|
val preAlarmButtons = listOf(
|
||||||
|
|||||||
@@ -214,10 +214,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) {
|
||||||
|
|||||||
@@ -68,7 +68,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"
|
||||||
@@ -717,11 +716,6 @@ 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) {
|
||||||
val card = binding.calendarCard
|
val card = binding.calendarCard
|
||||||
val width = card.width.toFloat()
|
val width = card.width.toFloat()
|
||||||
|
|||||||
@@ -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()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
<solid android:color="#20FF3B30" />
|
<solid android:color="#205856D6" />
|
||||||
<corners android:radius="12dp" />
|
<corners android:radius="12dp" />
|
||||||
<stroke
|
<stroke
|
||||||
android:width="0.5dp"
|
android:width="0.5dp"
|
||||||
android:color="#40FF3B30" />
|
android:color="#405856D6" />
|
||||||
</shape>
|
</shape>
|
||||||
|
|||||||
Executable
+9
@@ -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>
|
||||||
+12
@@ -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>
|
||||||
@@ -269,7 +269,7 @@
|
|||||||
android:textSize="10.5sp"
|
android:textSize="10.5sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textColor="@color/shift_red"
|
android:textColor="#5856D6"
|
||||||
android:background="@drawable/bg_chip_soft_overtime"/>
|
android:background="@drawable/bg_chip_soft_overtime"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -175,8 +175,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 +232,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
|
||||||
@@ -344,8 +344,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 +401,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
|
||||||
|
|||||||
@@ -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,26 @@
|
|||||||
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:textColor="@color/secondary"
|
||||||
android:maxLines="3"
|
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,19 +102,19 @@
|
|||||||
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) -->
|
<!-- Memo Indicator (bottom-right) -->
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/memoIndicator"
|
android:id="@+id/memoIndicator"
|
||||||
android:layout_width="12dp"
|
android:layout_width="10dp"
|
||||||
android:layout_height="12dp"
|
android:layout_height="10dp"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="2dp"
|
||||||
android:layout_marginBottom="4dp"
|
android:layout_marginBottom="2dp"
|
||||||
android:src="@drawable/ic_memo"
|
android:src="@drawable/ic_memo"
|
||||||
app:tint="@color/secondary"
|
app:tint="@color/secondary"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
|
|||||||
+44
-57
@@ -6,33 +6,21 @@ import shutil
|
|||||||
|
|
||||||
token = "e3b515eaa0a6683c921ca3bf718e281ed30a6075"
|
token = "e3b515eaa0a6683c921ca3bf718e281ed30a6075"
|
||||||
owner_repo = "sanjeok77/ShiftRing"
|
owner_repo = "sanjeok77/ShiftRing"
|
||||||
tag = "v2.3.0"
|
tag = "v1.0.4"
|
||||||
title = "v2.3.0 - One UI 8.5 전면 통일 & 법정 대체공휴일 수식 & 복합 연장근무 & 알람 그룹 순서 자동 정렬 대규모 완성 릴리즈"
|
title = "v1.0.4 - 날짜 옆 근무 뱃지 완벽한 원형/글자 크기 정밀 보정 & 설정 권한 아이콘/색상 시각화 개선"
|
||||||
body = """## 🚀 Shiftring v2.3.0 대규모 마이너 릴리즈
|
body = """## 🚀 ShiftRing v1.0.4 릴리즈
|
||||||
|
|
||||||
### 🌟 전면 통합 및 주요 개선 완료 사항
|
### 🌟 주요 변경 및 개선 사항
|
||||||
1. **설정 화면 4개 탭 One UI 8.5 전면 통일**:
|
1. **날짜 옆 근무 뱃지 원형 왜곡 방지 및 글자 가독성 정밀 보정**:
|
||||||
- 기본설정, 알람설정, 부가기능, 근무관리 전체 탭에 24dp 라운드 카드(`bg_oneui_settings_card`) 및 36dp 스퀘어클 Soft-tint 아이콘(`bg_oneui_icon_container`) 시스템 완벽 적용
|
- 메모가 있는 날짜의 상단 근무 뱃지(`tvShiftSmall`)를 정원(18dp × 18dp)으로 고정하여 찌그러짐 현상 완벽 방지
|
||||||
- 모든 드롭다운(Spinner)을 One UI 20dp 라운드 팝업(`bg_spinner_popup_oneui`), 12dp 알약 선택자 및 6dp 수직 오프셋으로 전면 통일
|
- 폰트 패딩 제거(`includeFontPadding=false`) 및 텍스트 크기 정밀 조정으로 '주/석/야/휴/월/연/교' 및 '주맞/야맞/반월' 텍스트가 잘림 없이 100% 선명하게 표시
|
||||||
2. **대한민국 법정 대체공휴일 수식 100% 정밀화**:
|
2. **앱 안정성 설정 (필수) 항목별 아이콘 및 테마 색상 개편**:
|
||||||
- 대통령령 관공서 공휴일 개정안을 반영하여 현충일(6/6), 신정(1/1) 제외 및 설날/추석 일요일 겹침, 단일 공휴일 토/일 겹침 수식 완벽 적용
|
- 배터리 최적화 제외: 배터리 전용 아이콘(`ic_battery`) + 에메랄드 그린(`#34C759`)
|
||||||
3. **이달의 누적 연장근무 복합 가산 수식**:
|
- 정확한 알람 허용: 정밀 시계 아이콘(`ic_alarm`) + One UI 블루(`#007AFF`)
|
||||||
- 토요일 기본 특근(1일당 2h) + 달력 지정 '주맞'(+4h), '야맞'(+4h), '교육'(+2h) 자동 누적 정산
|
- 전체화면 알림 허용: 전체화면 인텐트 전용 아이콘(`ic_fullscreen_intent`) + 비비드 퍼플(`#AF52DE`)
|
||||||
4. **알람 그룹 순서 자동 정렬 & 6개 근무 지원**:
|
- 시스템 전체 권한 설정: 시스템 톱니바퀴 아이콘(`ic_settings`) + 앰버 오렌지(`#FF9500`)
|
||||||
- 알람 목록 그룹 순서를 `주간(주) -> 석간(석) -> 야간(야) -> 주간 맞교대(주맞) -> 야간 맞교대(야맞) -> 기타`로 고정 정렬
|
- 각 권한의 성격과 상태를 한눈에 직관적으로 구분할 수 있도록 시각 계층 대폭 강화
|
||||||
- 그룹 마스터 스위치 및 아코디언 접기/펼치기 유지
|
3. **Android 14/15 호환 및 정식 서명키(release.jks) 적용**"""
|
||||||
- 알람 추가/수정 시 6개 근무타입(주/석/야/주맞/야맞/기타) 비율 맞춤 선택 지원
|
|
||||||
5. **메인 달력 유체 모션 & 요약 칩 바**:
|
|
||||||
- 삼성 캘린더 `PathInterpolator(0.22, 1, 0.36, 1)` 기반 부드러운 수평 슬라이드 + 미세 페이드 + 미세 스케일 모션
|
|
||||||
- 상단 `주간 N일 | 석간 N일 | 야간 N일 | 연장 N시간` 실시간 요약 칩 바
|
|
||||||
- 하루 메모 3줄 직관 표시 및 달력 5줄 고정 / 6줄 스크롤 최적화
|
|
||||||
- 날짜 이동 모달 팝업 내부 취소/이동 버튼 및 근무 글자 20sp 대형화
|
|
||||||
6. **배터리 최적화 4-Tier 다중 폴백**:
|
|
||||||
- Samsung Device Care (`com.samsung.android.lool`) 연동으로 100% 이동 보장
|
|
||||||
7. **One UI 8.5 앱 업데이트 다이얼로그**:
|
|
||||||
- 32dp 라운드 카드, #007AFF 선명 블루 버튼, `bg_oneui_progressbar.xml` 실시간 퍼센트 채움 애니메이션
|
|
||||||
8. **Android 14/15 호환 및 정식 서명키(release.jks) 유지**:
|
|
||||||
- `need to declare` 오류 완전 방지 및 덮어쓰기 업데이트 100% 지원"""
|
|
||||||
|
|
||||||
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):
|
||||||
@@ -41,26 +29,11 @@ if not os.path.exists(apk_path):
|
|||||||
|
|
||||||
print(f"Using APK at: {apk_path}")
|
print(f"Using APK at: {apk_path}")
|
||||||
|
|
||||||
# Check if release already exists
|
# Create Gitea Release
|
||||||
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"}
|
||||||
|
|
||||||
try:
|
data = json.dumps({"tag_name": tag, "name": title, "body": body, "draft": False, "prerelease": False}).encode('utf-8')
|
||||||
req = urllib.request.Request(f"{url}/tags/{tag}", headers=headers)
|
|
||||||
with urllib.request.urlopen(req) as resp:
|
|
||||||
existing = json.loads(resp.read())
|
|
||||||
release_id = existing["id"]
|
|
||||||
print(f"Existing release found with ID: {release_id}. Updating...")
|
|
||||||
# Update existing release
|
|
||||||
edit_url = f"{url}/{release_id}"
|
|
||||||
edit_data = json.dumps({"name": title, "body": body}).encode()
|
|
||||||
edit_req = urllib.request.Request(edit_url, data=edit_data, headers=headers, method="PATCH")
|
|
||||||
with urllib.request.urlopen(edit_req) as edit_resp:
|
|
||||||
print("Release details updated successfully.")
|
|
||||||
except Exception as e:
|
|
||||||
# Create new release
|
|
||||||
print("Creating new release...")
|
|
||||||
data = json.dumps({"tag_name": tag, "name": title, "body": body, "draft": False, "prerelease": False}).encode()
|
|
||||||
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())
|
||||||
@@ -71,25 +44,39 @@ except Exception as e:
|
|||||||
upload_url = f"https://git.webpluss.net/api/v1/repos/{owner_repo}/releases/{release_id}/assets"
|
upload_url = f"https://git.webpluss.net/api/v1/repos/{owner_repo}/releases/{release_id}/assets"
|
||||||
print(f"Uploading APK to {upload_url}...")
|
print(f"Uploading APK to {upload_url}...")
|
||||||
|
|
||||||
# Check existing assets and delete if present
|
|
||||||
try:
|
|
||||||
assets_req = urllib.request.Request(upload_url, headers=headers)
|
|
||||||
with urllib.request.urlopen(assets_req) as resp:
|
|
||||||
assets = json.loads(resp.read())
|
|
||||||
for asset in assets:
|
|
||||||
if asset["name"] == "app.apk":
|
|
||||||
del_url = f"https://git.webpluss.net/api/v1/repos/{owner_repo}/releases/{release_id}/assets/{asset['id']}"
|
|
||||||
del_req = urllib.request.Request(del_url, headers=headers, method="DELETE")
|
|
||||||
urllib.request.urlopen(del_req)
|
|
||||||
print(f"Deleted old asset {asset['id']}.")
|
|
||||||
except Exception as e:
|
|
||||||
print(f"Error checking assets: {e}")
|
|
||||||
|
|
||||||
curl_cmd = f'curl -s -X POST "{upload_url}?name=app.apk" -H "Authorization: token {token}" -F "attachment=@{apk_path}"'
|
curl_cmd = f'curl -s -X POST "{upload_url}?name=app.apk" -H "Authorization: token {token}" -F "attachment=@{apk_path}"'
|
||||||
upload_result = subprocess.run(curl_cmd, shell=True, capture_output=True, text=True)
|
upload_result = subprocess.run(curl_cmd, shell=True, capture_output=True, text=True)
|
||||||
print(f"Upload output: {upload_result.stdout}")
|
print(f"Upload output: {upload_result.stdout}")
|
||||||
|
|
||||||
|
upload_json = json.loads(upload_result.stdout)
|
||||||
|
apk_uuid = upload_json.get("uuid")
|
||||||
|
direct_url = upload_json.get("browser_download_url", f"https://git.webpluss.net/attachments/{apk_uuid}")
|
||||||
|
|
||||||
# Copy APK to project root
|
# Copy APK to project root
|
||||||
shutil.copy2(apk_path, "app.apk")
|
shutil.copy2(apk_path, "app.apk")
|
||||||
print("Updated app.apk at project root.")
|
print("Updated app.apk at project root.")
|
||||||
|
|
||||||
|
# Update version.json
|
||||||
|
v_info = {
|
||||||
|
"versionCode": 104,
|
||||||
|
"versionName": "1.0.4",
|
||||||
|
"apkUrl": direct_url,
|
||||||
|
"changelog": "v1.0.4: 날짜 옆 근무 뱃지 원형 정밀 보정 & 글자 가독성 개선, 앱 안정성 설정 아이콘 및 색상 시각화",
|
||||||
|
"forceUpdate": False
|
||||||
|
}
|
||||||
|
with open("version.json", "w", encoding="utf-8") as f:
|
||||||
|
json.dump(v_info, f, ensure_ascii=False, indent=2)
|
||||||
|
|
||||||
|
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.0.4 - 날짜 옆 근무 뱃지 원형 정밀 보정, 앱 안정성 설정 아이콘 및 색상 개편"
|
||||||
|
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
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"versionCode": 100,
|
"versionCode": 104,
|
||||||
"versionName": "1.0.0",
|
"versionName": "1.0.4",
|
||||||
"apkUrl": "",
|
"apkUrl": "https://git.webpluss.net/attachments/017b75f6-07a5-468f-8694-83345c9692e3",
|
||||||
"changelog": "v1.0.0: ShiftRing 정식 첫 릴리즈 - One UI 8.5 디자인 시스템, 교대근무 캘린더, 맞춤 알람 및 법정 공휴일/연장근무 자동 계산",
|
"changelog": "v1.0.4: 날짜 옆 근무 뱃지 원형 정밀 보정 & 글자 가독성 개선, 앱 안정성 설정 아이콘 및 색상 시각화",
|
||||||
"forceUpdate": false
|
"forceUpdate": false
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user