17 Commits

Author SHA1 Message Date
b5a6abee97 chore: 버전 업데이트 v1.4.4 (1144)
- versionCode: 1143 → 1144
- versionName: 1.4.3 → 1.4.4

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-12 23:52:08 +09:00
fe050808b4 feat: 메인 화면 연차 표시 형식 개선
- 정수일 때 정수로 표시 (22)
- 0.5일 때 소숫점 표시 (21.5)
- formatRemainingDays() 함수 추가

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-12 23:45:07 +09:00
08c130f448 feat: 휴가 관리 컴팩트화 + 자동 저장 + 소숫점 표시 개선
- 레이아웃 컴팩트하게 변경 (패딩/마진 축소, 가로 배치)
- 저장 버튼 제거하고 NumberPicker 변경 시 자동 저장
- 소숫점 없을 때 정수로 표시 (22), 0.5일 때 소숫점 표시 (21.5)
- ScrollView 제거 (불필요한 스크롤 최소화)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-12 23:44:57 +09:00
7d50263e65 fix: 연차/반년 최초 적용 안되는 문제 수정
- updateRemainingAnnualLeave()에서 AnnualLeave 없을 때 기본값 15일로 생성
- 총 연차 설정 없이도 달력에서 연차/반년 사용 가능하도록 개선

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-12 23:44:45 +09:00
693704686f fix: 달력 양쪽 마진 3dp로 축소
- calendarCard marginHorizontal: 12dp → 3dp
- otherTeamsCard marginHorizontal: 12dp → 3dp

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-12 23:44:35 +09:00
ccbd943c56 chore: 버전 업데이트 v1.4.3 (1143)
- versionCode: 1142 → 1143
- versionName: 1.4.2 → 1.4.3

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-12 23:32:09 +09:00
761e02fd94 fix: 달력 동적 높이 계산 제거 (1.3.0 스타일로 복원)
- RecyclerView 높이 동적 계산 코드 제거
- CalendarAdapter rowCount 파라미터 제거
- 아이템 높이를 XML에서 고정하도록 변경
- 달력이 자연스럽게 화면에 채워지도록 개선

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-12 23:30:28 +09:00
eda76a0ef6 fix: 달력 레이아웃 1.3.0 버전처럼 복원
- 양쪽 마진 4dp → 12dp 복원
- 달력 아이템 높이 92dp 고정으로 복원
- shiftChar 크기 48dp → 40dp 복원
- 달력 화면이 ConstraintLayout에 자연스럽게 채워지도록 수정

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-12 23:30:19 +09:00
8a2dacb104 chore: 버전 업데이트 v1.4.2 (1142)
- versionCode: 1141 → 1142
- versionName: 1.4.1 → 1.4.2

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-12 23:21:19 +09:00
2f4b2ebe4c fix: 연차 설정 화면 ScrollView 추가
- 작은 화면에서 저장 버튼이 잘리지 않도록 ScrollView로 감싸기
- 저장 버튼 가시성 확보

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-12 23:18:31 +09:00
89068b4d05 fix: 토스트 다크모드 완전 지원
- 배경색을 반투명 회색(#CC333333)으로 변경하여 라이트/다크 모두 가독성 확보
- 텍스트 색상을 흰색(@android:color/white)으로 변경
- showCustomToast() 함수 개선

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-12 23:18:22 +09:00
7835d0ab65 fix: 달력 5행 고정높이, 6행 스크롤 지원
- 5행: RecyclerView 높이를 행 수에 맞게 고정, 스크롤 없음
- 6행: RecyclerView 높이를 6행으로 고정, 스크롤 활성화
- 아이템 높이를 화면 너비 기준 정사각형으로 통일

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-12 23:18:12 +09:00
819495323e chore: 버전 업데이트 v1.4.1 (1141)
- versionCode: 1140 → 1141
- versionName: 1.4.0 → 1.4.1
- dialog_day_settings.xml 레이아웃 개선

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-12 23:01:36 +09:00
5a0f6de646 fix: 연차 저장 및 계산 로직 수정
- calculateUsedAnnualLeave()에서 Seoul 타임존 명시
- FragmentSettingsLab 토스트를 커스텀 토스트로 변경
- 연차 저장 시 남은 연차 자동 계산 로직 개선

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-12 22:46:05 +09:00
f884e991a3 feat: 다크모드 지원 커스텀 토스트 구현
- showCustomToast() 함수 추가 (AlarmUtils)
- 커스텀 토스트 레이아웃 및 배경 drawable 추가
- values/colors.xml 및 values-night/colors.xml 리소스 사용

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-12 22:44:48 +09:00
b8454f76d1 feat: 달력 5행 동적 높이 조정 및 연차 메인 화면 연동
- 달력 5행일 때 아이템 높이를 동적으로 계산하여 화면 꽉 채우기
- 메인 화면 tvAnnualLeave에 남은 연차 표시 기능 추가
- onResume에서 연차 정보 자동 업데이트

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-12 22:43:44 +09:00
a4482f0b7b fix: DB 마이그레이션 추가 및 연차 저장/다크모드/달력 UI 개선
- DB 마이그레이션으로 기존 알람 데이터 보존
- 연차 저장 문제 수정 (원래대로/연차 설정 시 updateRemainingAnnualLeave 호출)
- 달력 5행 스크롤 없이 표시 (85dp 높이)
- 알람 편집/월년 선택 다크모드 지원
- 설정 앱정보 버전 동기화 표시

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-12 21:47:39 +09:00
19 changed files with 393 additions and 186 deletions

BIN
app.apk

Binary file not shown.

View File

@@ -16,18 +16,16 @@ android {
namespace = "com.example.shiftalarm"
compileSdk = 35
defaultConfig {
applicationId = "com.example.shiftalarm"
minSdk = 26
targetSdk = 35
versionCode = 1140
versionName = "1.4.0"
versionName = "1.3.0"
defaultConfig {
applicationId = "com.example.shiftalarm"
minSdk = 26
targetSdk = 35
versionCode = 1144
versionName = "1.4.4"
versionName = "1.4.3"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
create("release") {

View File

@@ -16,6 +16,47 @@ import java.util.concurrent.TimeUnit
val SEOUL_ZONE: ZoneId = ZoneId.of("Asia/Seoul")
const val TAG = "ShiftAlarm"
/**
* 다크모드 지원 커스텀 토스트 표시
*/
fun showCustomToast(context: Context, message: String, duration: Int = android.widget.Toast.LENGTH_SHORT) {
try {
val inflater = android.view.LayoutInflater.from(context)
val layout = inflater.inflate(R.layout.custom_toast, null)
val textView = layout.findViewById<android.widget.TextView>(R.id.toastText)
textView.text = message
val toast = android.widget.Toast(context)
toast.duration = duration
toast.view = layout
toast.setGravity(android.view.Gravity.BOTTOM or android.view.Gravity.CENTER_HORIZONTAL, 0, 150)
toast.show()
} catch (e: Exception) {
// Fallback to default toast if custom toast fails
android.widget.Toast.makeText(context, message, duration).show()
}
}
* 다크모드 지원 커스텀 토스트 표시
*/
fun showCustomToast(context: Context, message: String, duration: Int = android.widget.Toast.LENGTH_SHORT) {
try {
// Use application context with theme for proper dark mode support
val themedContext = android.view.ContextThemeWrapper(context.applicationContext, R.style.Theme_ShiftAlarm)
val inflater = android.view.LayoutInflater.from(themedContext)
val layout = inflater.inflate(R.layout.custom_toast, null)
val textView = layout.findViewById<android.widget.TextView>(R.id.toastText)
textView.text = message
val toast = android.widget.Toast(context.applicationContext)
toast.duration = duration
toast.view = layout
toast.setGravity(android.view.Gravity.BOTTOM or android.view.Gravity.CENTER_HORIZONTAL, 0, 100)
toast.show()
} catch (e: Exception) {
// Fallback to default toast if custom toast fails
android.widget.Toast.makeText(context, message, duration).show()
}
}
// ============================================
// 알람 ID 생성
// ============================================

View File

@@ -1,7 +1,11 @@
package com.example.shiftalarm
import android.content.Context
import androidx.room.*
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import androidx.room.migration.Migration
import androidx.sqlite.db.SupportSQLiteDatabase
@Database(entities = [ShiftOverride::class, DailyMemo::class, CustomAlarm::class, AnnualLeave::class], version = 4, exportSchema = false)
abstract class AppDatabase : RoomDatabase() {
@@ -11,6 +15,23 @@ abstract class AppDatabase : RoomDatabase() {
@Volatile
private var INSTANCE: AppDatabase? = null
// Migration from version 3 to 4: Add AnnualLeave table
private val MIGRATION_3_4 = object : Migration(3, 4) {
override fun migrate(database: SupportSQLiteDatabase) {
// Create AnnualLeave table
database.execSQL(
"""
CREATE TABLE IF NOT EXISTS annual_leave (
id INTEGER PRIMARY KEY NOT NULL,
totalDays REAL NOT NULL,
remainingDays REAL NOT NULL,
updatedAt INTEGER NOT NULL
)
""".trimIndent()
)
}
}
fun getDatabase(context: Context): AppDatabase {
return INSTANCE ?: synchronized(this) {
val instance = Room.databaseBuilder(
@@ -18,7 +39,7 @@ abstract class AppDatabase : RoomDatabase() {
AppDatabase::class.java,
"shift_database"
)
.fallbackToDestructiveMigration() // Simple for now
.addMigrations(MIGRATION_3_4)
.build()
INSTANCE = instance
instance

View File

@@ -13,10 +13,10 @@ import androidx.recyclerview.widget.RecyclerView
import java.time.LocalDate
data class DayShift(
val date: LocalDate?,
val shift: String?,
val hasMemo: Boolean = false,
val memoContent: String? = null
val date: LocalDate?,
val shift: String?,
val hasMemo: Boolean = false,
val memoContent: String? = null
)
class CalendarAdapter(
@@ -24,7 +24,6 @@ class CalendarAdapter(
private val listener: OnDayClickListener,
var showHolidays: Boolean = true
) : RecyclerView.Adapter<CalendarAdapter.ViewHolder>() {
interface OnDayClickListener {
fun onDayClick(date: LocalDate, currentShift: String)
}
@@ -51,17 +50,16 @@ class CalendarAdapter(
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val item = days[position]
val context = holder.itemView.context
if (item.date == null) {
holder.itemView.visibility = View.INVISIBLE
return
}
holder.itemView.visibility = View.VISIBLE
// Day Number
holder.dayNumber.text = item.date.dayOfMonth.toString()
// Holiday / Weekend logic
val isSunday = item.date.dayOfWeek == java.time.DayOfWeek.SUNDAY
val isSaturday = item.date.dayOfWeek == java.time.DayOfWeek.SATURDAY

View File

@@ -93,6 +93,7 @@ class FragmentSettingsAdditional : Fragment() {
// Tide Switch
binding.switchTide.isChecked = prefs.getBoolean("show_tide", false)
loadAppVersion()
}
private fun setupListeners() {
@@ -211,6 +212,18 @@ class FragmentSettingsAdditional : Fragment() {
}
}
private fun loadAppVersion() {
try {
val packageInfo = requireContext().packageManager.getPackageInfo(requireContext().packageName, 0)
val versionName = packageInfo.versionName
binding.tvAppVersion.text = "버전 $versionName"
} catch (e: Exception) {
binding.tvAppVersion.text = "버전 1.4.0"
}
}
override fun onDestroyView() {
super.onDestroyView()
_binding = null

View File

@@ -4,16 +4,18 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import android.widget.NumberPicker
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import com.example.shiftalarm.databinding.FragmentSettingsLabBinding
import kotlinx.coroutines.launch
import kotlinx.coroutines.delay
class FragmentSettingsLab : Fragment() {
private var _binding: FragmentSettingsLabBinding? = null
private val binding get() = _binding!!
private var isInitialLoad = true
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
@@ -28,7 +30,6 @@ class FragmentSettingsLab : Fragment() {
setupNumberPicker()
loadAnnualLeave()
setupSaveButton()
}
private fun setupNumberPicker() {
@@ -36,40 +37,63 @@ class FragmentSettingsLab : Fragment() {
minValue = 1
maxValue = 25
wrapSelectorWheel = false
// 값 변경 시 자동 저장
setOnValueChangedListener { _, _, newVal ->
if (!isInitialLoad) {
saveAnnualLeave(newVal)
}
}
}
}
private fun loadAnnualLeave() {
lifecycleScope.launch {
isInitialLoad = true
val repo = ShiftRepository(requireContext())
val annualLeave = repo.getAnnualLeave()
annualLeave?.let {
binding.npTotalDays.value = it.totalDays.toInt()
binding.tvRemainingDays.text = String.format("%.1f", it.remainingDays)
binding.tvRemainingDays.text = formatRemainingDays(it.remainingDays)
} ?: run {
// Default: 15 days
binding.npTotalDays.value = 15
binding.tvRemainingDays.text = "15.0"
binding.tvRemainingDays.text = "15"
}
// 초기 로드 완료 후 플래그 변경
delay(100)
isInitialLoad = false
}
}
private fun saveAnnualLeave(totalDays: Int) {
lifecycleScope.launch {
val repo = ShiftRepository(requireContext())
repo.recalculateAndSaveAnnualLeave(totalDays.toFloat())
val updated = repo.getAnnualLeave()
updated?.let {
binding.tvRemainingDays.text = formatRemainingDays(it.remainingDays)
showCustomToast(requireContext(), "총 연차 ${totalDays}일로 설정되었습니다 (남은 연차: ${formatRemainingDays(it.remainingDays)}일)")
}
}
}
private fun setupSaveButton() {
binding.btnSaveAnnualLeave.setOnClickListener {
val totalDays = binding.npTotalDays.value.toFloat()
lifecycleScope.launch {
val repo = ShiftRepository(requireContext())
repo.recalculateAndSaveAnnualLeave(totalDays)
val updated = repo.getAnnualLeave()
updated?.let {
binding.tvRemainingDays.text = String.format("%.1f", it.remainingDays)
Toast.makeText(requireContext(), "연차가 저장되었습니다. (남은 연차: ${String.format("%.1f", it.remainingDays)}일)", Toast.LENGTH_SHORT).show()
}
}
/**
* 남은 연차 표시 형식 개선
* - 정수면 정수로 표시 (예: 22)
* - 소숫점 있으면 소숫점 표시 (예: 21.5)
*/
private fun formatRemainingDays(days: Float): String {
return if (days == days.toInt().toFloat()) {
// 정수인 경우
days.toInt().toString()
} else {
// 소숫점이 있는 경우 (0.5 등)
String.format("%.1f", days)
}
}

View File

@@ -187,22 +187,42 @@ class MainActivity : AppCompatActivity() {
}
}
override fun onResume() {
super.onResume()
val prefs = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
currentViewTeam = prefs.getString(KEY_TEAM, "A") ?: "A"
updateTideButtonVisibility()
updateCalendar()
// 일원화된 통합 권한 체크 실행 (신뢰도 100% 보장)
AlarmPermissionUtil.checkAndRequestAllPermissions(this)
override fun onResume() {
super.onResume()
val prefs = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
currentViewTeam = prefs.getString(KEY_TEAM, "A") ?: "A"
// 설정 변경 시 즉시 반영을 위한 강제 동기화 (30일 스케줄링)
updateTideButtonVisibility()
updateCalendar()
// 일원화된 통합 권한 체크 실행 (신뢰도 100% 보장)
AlarmPermissionUtil.checkAndRequestAllPermissions(this)
// 설정 변경 시 즉시 반영을 위한 강제 동기화 (30일 스케줄링)
lifecycleScope.launch {
syncAllAlarms(this@MainActivity)
}
// 연차 정보 업데이트
lifecycleScope.launch {
syncAllAlarms(this@MainActivity)
val repo = ShiftRepository(this@MainActivity)
val annualLeave = repo.getAnnualLeave()
annualLeave?.let {
binding.tvAnnualLeave.text = "연차: ${formatRemainingDays(it.remainingDays)}"
} ?: run {
binding.tvAnnualLeave.text = "연차: --"
}
}
}
lifecycleScope.launch {
val repo = ShiftRepository(this@MainActivity)
val annualLeave = repo.getAnnualLeave()
annualLeave?.let {
binding.tvAnnualLeave.text = "연차: ${String.format("%.1f", it.remainingDays)}"
} ?: run {
binding.tvAnnualLeave.text = "연차: --"
}
}
}
private fun showMonthYearPicker() {
val dialogView = layoutInflater.inflate(R.layout.dialog_month_year_picker, null)
@@ -295,7 +315,7 @@ class MainActivity : AppCompatActivity() {
}
val days = generateDaysForMonthWithData(currentViewMonth, currentViewTeam, factory, overrides, memos)
val adapter = CalendarAdapter(days, object : CalendarAdapter.OnDayClickListener {
override fun onDayClick(date: LocalDate, currentShift: String) {
showDaySettingsDialog(date, currentShift)
@@ -314,10 +334,23 @@ class MainActivity : AppCompatActivity() {
binding.todayStatusText.setTextColor(androidx.core.content.ContextCompat.getColor(this@MainActivity, R.color.warning_red))
} else {
binding.todayStatusText.text = "오늘의 근무: $shiftForViewingTeam$teamSuffix"
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))
}
// Update Annual Leave display
val annualLeave = withContext(Dispatchers.IO) { repo.getAnnualLeave() }
annualLeave?.let {
binding.tvAnnualLeave.text = "연차: ${String.format("%.1f", it.remainingDays)}"
} ?: run {
binding.tvAnnualLeave.text = "연차: --"
// Update Annual Leave display
val annualLeave = withContext(Dispatchers.IO) { repo.getAnnualLeave() }
annualLeave?.let {
binding.tvAnnualLeave.text = "연차: ${formatRemainingDays(it.remainingDays)}"
} ?: run {
binding.tvAnnualLeave.text = "연차: --"
}
}
updateOtherTeamsLayout(today, factory, prefs)
}
@@ -373,13 +406,13 @@ class MainActivity : AppCompatActivity() {
setMargins(4, 0, 4, 0)
}
setOnClickListener {
if (currentViewTeam != t) {
currentViewTeam = t
updateCalendar()
Toast.makeText(context, "${t}반 근무표를 표시합니다.", Toast.LENGTH_SHORT).show()
}
}
setOnClickListener {
if (currentViewTeam != t) {
currentViewTeam = t
updateCalendar()
showCustomToast(context, "${t}반 근무표를 표시합니다.")
}
}
}
rowLayout.addView(textView)
}
@@ -595,6 +628,7 @@ class MainActivity : AppCompatActivity() {
android.widget.Toast.makeText(this, "원래 근무로 복구되었습니다.", android.widget.Toast.LENGTH_SHORT).show()
syncAllAlarms(this)
updateCalendar()
repo.updateRemainingAnnualLeave()
}
"직접 입력" -> {
showCustomInputDialog(date, repo, team, factory)
@@ -620,6 +654,7 @@ class MainActivity : AppCompatActivity() {
updateCalendar()
syncAllAlarms(this)
android.widget.Toast.makeText(this, "${selected}(으)로 기록되었습니다. 알람이 해제됩니다.", android.widget.Toast.LENGTH_SHORT).show()
repo.updateRemainingAnnualLeave()
}
}
}
@@ -686,6 +721,18 @@ class MainActivity : AppCompatActivity() {
Toast.makeText(this, "⚠️ 루팅된 기기에서 시각적 오류나 알람 불안정이 발생할 수 있습니다.", Toast.LENGTH_LONG).show()
}
}
/**
* 남은 연차 표시 형식 개선
* - 정수면 정수로 표시 (예: 22)
* - 소숫점 있으면 소숫점 표시 (예: 21.5)
*/
private fun formatRemainingDays(days: Float): String {
return if (days == days.toInt().toFloat()) {
// 정수인 경우
days.toInt().toString()
} else {
// 소숫점이 있는 경우 (0.5 등)
String.format("%.1f", days)
}
}
}

View File

@@ -58,24 +58,24 @@ class ShiftRepository(private val context: Context) {
dao.clearCustomAlarms()
}
// Annual Leave
suspend fun calculateUsedAnnualLeave(): Float = withContext(Dispatchers.IO) {
val currentYear = java.time.Year.now().toString()
val overrides = dao.getAllOverrides()
var usedDays = 0f
for (override in overrides) {
if (override.date.startsWith(currentYear)) {
when (override.shift) {
"연차" -> usedDays += 1f
"반년" -> usedDays += 0.5f
}
}
}
usedDays
}
// Annual Leave
suspend fun calculateUsedAnnualLeave(): Float = withContext(Dispatchers.IO) {
val currentYear = java.time.Year.now(java.time.ZoneId.of("Asia/Seoul")).toString()
val overrides = dao.getAllOverrides()
var usedDays = 0f
for (override in overrides) {
if (override.date.startsWith(currentYear)) {
when (override.shift) {
"연차" -> usedDays += 1f
"반년" -> usedDays += 0.5f
}
}
}
usedDays
}
suspend fun getAnnualLeave(): AnnualLeave? = withContext(Dispatchers.IO) {
dao.getAnnualLeave()
@@ -93,6 +93,21 @@ class ShiftRepository(private val context: Context) {
}
suspend fun updateRemainingAnnualLeave() {
val annualLeave = dao.getAnnualLeave()
val usedDays = calculateUsedAnnualLeave()
if (annualLeave != null) {
val remainingDays = annualLeave.totalDays - usedDays
dao.insertAnnualLeave(annualLeave.copy(remainingDays = remainingDays))
} else {
// AnnualLeave가 없으면 기본값 15일로 생성
dao.insertAnnualLeave(AnnualLeave(
id = 1,
totalDays = 15f,
remainingDays = 15f - usedDays
))
}
}
val annualLeave = dao.getAnnualLeave()
annualLeave?.let {
val usedDays = calculateUsedAnnualLeave()

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 배경색: 다크모드에서도 잘 보이도록 surface 색상 사용 -->
<solid android:color="#CC333333" />
<corners android:radius="16dp" />
<stroke
android:width="1dp"
android:color="@color/outline" />
</shape>

View File

@@ -58,12 +58,12 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- Maximized Calendar Card - Reduced margins for wider calendar -->
<!-- Maximized Calendar Card -->
<androidx.cardview.widget.CardView
android:id="@+id/calendarCard"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginHorizontal="4dp"
android:layout_marginHorizontal="3dp"
android:layout_marginBottom="8dp"
app:cardCornerRadius="28dp"
app:cardElevation="0dp"
@@ -240,7 +240,7 @@
android:id="@+id/otherTeamsCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="4dp"
android:layout_marginHorizontal="3dp"
android:layout_marginBottom="16dp"
app:cardCornerRadius="20dp"
app:cardElevation="0dp"

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/bg_custom_toast"
android:paddingHorizontal="20dp"
android:paddingVertical="12dp"
android:gravity="center">
<TextView
android:id="@+id/toastText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@android:color/white"
android:maxLines="2"
android:ellipsize="end" />
</LinearLayout>

View File

@@ -29,7 +29,7 @@
android:text="알람 추가"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="@color/black"
android:textColor="@color/text_primary"
android:layout_centerInParent="true"/>
<TextView
@@ -80,7 +80,7 @@
android:layout_height="wrap_content"
app:cardCornerRadius="24dp"
app:cardElevation="0dp"
app:cardBackgroundColor="@color/white"
app:cardBackgroundColor="@color/surface"
android:layout_marginBottom="16dp">
<LinearLayout
@@ -116,7 +116,7 @@
android:layout_height="wrap_content"
app:cardCornerRadius="24dp"
app:cardElevation="0dp"
app:cardBackgroundColor="@color/white"
app:cardBackgroundColor="@color/surface"
android:layout_marginBottom="16dp">
<LinearLayout
android:id="@+id/btnSelectSound"
@@ -162,7 +162,7 @@
android:layout_height="wrap_content"
app:cardCornerRadius="24dp"
app:cardElevation="0dp"
app:cardBackgroundColor="@color/white"
app:cardBackgroundColor="@color/surface"
android:layout_marginBottom="16dp">
<LinearLayout
android:layout_width="match_parent"

View File

@@ -56,16 +56,32 @@
<TextView android:id="@+id/btnYaMat" style="@style/ShiftCircleButton" android:text="야맞" android:textSize="13sp" android:textColor="@color/shift_yamat"/>
<!-- Row 2 -->
<TextView android:id="@+id/btnOff" style="@style/ShiftCircleButton" android:text="휴" android:textColor="@color/shift_off"/>
<TextView android:id="@+id/btnWolcha" style="@style/ShiftCircleButton" android:text="월차" android:textSize="13sp" android:textColor="@color/secondary"/>
<TextView android:id="@+id/btnYeoncha" style="@style/ShiftCircleButton" android:text="연차" android:textSize="13sp" android:textColor="@color/secondary"/>
<TextView android:id="@+id/btnBanwol" style="@style/ShiftCircleButton" android:text="월" android:textSize="13sp" android:textColor="@color/shift_red"/>
<TextView android:id="@+id/btnBannyeon" style="@style/ShiftCircleButton" android:text="반년" android:textSize="13sp" android:textColor="@color/shift_red"/>
<TextView android:id="@+id/btnOff" style="@style/ShiftCircleButton" android:text="휴" android:textColor="@color/shift_off"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
<TextView android:id="@+id/btnWolcha" style="@style/ShiftCircleButton" android:text="월" android:textSize="13sp" android:textColor="@color/secondary"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
<TextView android:id="@+id/btnYeoncha" style="@style/ShiftCircleButton" android:text="연차" android:textSize="13sp" android:textColor="@color/secondary"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
<TextView android:id="@+id/btnBanwol" style="@style/ShiftCircleButton" android:text="반월" android:textSize="13sp" android:textColor="@color/shift_red"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
<TextView android:id="@+id/btnBannyeon" style="@style/ShiftCircleButton" android:text="반년" android:textSize="13sp" android:textColor="@color/shift_red"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
<!-- Row 3 -->
<TextView android:id="@+id/btnEdu" style="@style/ShiftCircleButton" android:text="교육" android:textSize="13sp" android:textColor="@color/primary"/>
<TextView android:id="@+id/btnReset" style="@style/ShiftCircleButton" android:text="초기" android:textSize="13sp" android:textColor="@color/text_secondary"/>
<TextView android:id="@+id/btnManual" style="@style/ShiftCircleButton" android:text="직접" android:textSize="14sp" android:textColor="@color/shift_gray"/>
<TextView android:id="@+id/btnEdu" style="@style/ShiftCircleButton" android:text="교육" android:textSize="13sp" android:textColor="@color/primary"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
<TextView android:id="@+id/btnReset" style="@style/ShiftCircleButton" android:text="초기" android:textSize="13sp" android:textColor="@color/text_secondary"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
<TextView android:id="@+id/btnManual" style="@style/ShiftCircleButton" android:text="직접" android:textSize="14sp" android:textColor="@color/shift_gray"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
<androidx.constraintlayout.helper.widget.Flow
android:id="@+id/gridFlow"

View File

@@ -20,7 +20,7 @@
android:text="날짜 이동"
android:textSize="24sp"
android:textStyle="bold"
android:textColor="@color/black"
android:textColor="@color/text_primary"
android:layout_marginBottom="32dp"
android:layout_gravity="center_horizontal"/>

View File

@@ -361,5 +361,17 @@
</LinearLayout>
</androidx.cardview.widget.CardView>
<!-- App Version -->
<TextView
android:id="@+id/tvAppVersion"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="버전 1.4.0"
android:textColor="@color/text_tertiary"
android:textSize="12sp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View File

@@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="24dp"
android:padding="16dp"
android:gravity="center_horizontal">
<!-- Header Title -->
@@ -12,117 +12,115 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="나의 연차 설정"
android:textSize="20sp"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="@color/text_primary"
android:layout_marginBottom="32dp"/>
android:layout_marginBottom="16dp"/>
<!-- Total Annual Leave Setting -->
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
app:cardCornerRadius="16dp"
app:cardElevation="4dp"
android:layout_marginBottom="12dp"
app:cardCornerRadius="12dp"
app:cardElevation="2dp"
app:cardBackgroundColor="@color/surface">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="24dp"
android:gravity="center">
android:orientation="horizontal"
android:padding="12dp"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="총 연차"
android:textSize="16sp"
android:textColor="@color/text_secondary"
android:layout_marginBottom="16dp"/>
<!-- NumberPicker for Total Days -->
<NumberPicker
android:id="@+id/npTotalDays"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="일"
android:textSize="14sp"
android:textColor="@color/text_tertiary"/>
android:textColor="@color/text_secondary"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical">
<NumberPicker
android:id="@+id/npTotalDays"
android:layout_width="60dp"
android:layout_height="100dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="일"
android:textSize="14sp"
android:textColor="@color/text_tertiary"
android:layout_marginStart="4dp"/>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<!-- Remaining Annual Leave Display -->
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="32dp"
app:cardCornerRadius="16dp"
app:cardElevation="4dp"
android:layout_marginBottom="12dp"
app:cardCornerRadius="12dp"
app:cardElevation="2dp"
app:cardBackgroundColor="@color/surface">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="24dp"
android:gravity="center">
android:orientation="horizontal"
android:padding="12dp"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="남은 연차"
android:textSize="16sp"
android:textColor="@color/text_secondary"
android:layout_marginBottom="8dp"/>
<TextView
android:id="@+id/tvRemainingDays"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0.0"
android:textSize="36sp"
android:textStyle="bold"
android:textColor="@color/primary"
android:layout_marginBottom="4dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="일"
android:textSize="14sp"
android:textColor="@color/text_tertiary"/>
android:textColor="@color/text_secondary"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="bottom">
<TextView
android:id="@+id/tvRemainingDays"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="15"
android:textSize="28sp"
android:textStyle="bold"
android:textColor="@color/primary"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="일"
android:textSize="14sp"
android:textColor="@color/text_tertiary"
android:layout_marginStart="4dp"/>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<!-- Calculation Info -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="※ 연차: -1일 차감 / 반년: -0.5일 차감"
android:textSize="13sp"
android:text="※ 연차: -1일 / 반년: -0.5일 차감"
android:textSize="12sp"
android:textColor="@color/text_tertiary"
android:layout_marginBottom="24dp"
android:layout_marginBottom="8dp"
android:gravity="center"/>
<!-- Save Button -->
<com.google.android.material.button.MaterialButton
android:id="@+id/btnSaveAnnualLeave"
android:layout_width="match_parent"
android:layout_height="56dp"
android:text="저장"
android:textSize="16sp"
android:textStyle="bold"
app:cornerRadius="12dp"
android:backgroundTint="@color/primary"/>
</LinearLayout>

View File

@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/dayRoot"
android:layout_width="match_parent"
android:layout_height="108dp"
android:layout_height="92dp"
android:background="@drawable/bg_grid_cell_v4">
<!-- Day Number (top-left) -->
@@ -16,7 +16,7 @@
android:layout_marginTop="4dp"
android:text="12"
android:textColor="@color/text_primary"
android:textSize="15sp"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -35,21 +35,21 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!-- Shift Abbreviation Circular Indicator (Center) - Larger size -->
<!-- Shift Abbreviation Circular Indicator (Center) -->
<TextView
android:id="@+id/shiftChar"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:gravity="center"
android:text="주"
android:textSize="17sp"
android:textSize="15sp"
android:textStyle="bold"
android:textColor="@color/text_primary"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintVertical_bias="0.42"/>
app:layout_constraintVertical_bias="0.45"/>
<!-- Memo Content Text (Below Shift) - Replacing icon logic for visibility -->
<TextView

View File

@@ -1,13 +1,7 @@
{
"versionCode": 1140,
"versionName": "1.4.0",
"apkUrl": "https://git.webpluss.net/sanjeok77/ShiftRing/releases/download/v1.4.0/app.apk",
"changelog": "v1.4.0: 휴가 관리 기능 추가 (연차/반년 설정 및 자동 계산), 달력 UI 개선 (넓은 화면, 큰 근무 표시)",
"forceUpdate": false
}
"versionCode": 1130,
"versionName": "1.3.0",
"apkUrl": "https://git.webpluss.net/sanjeok77/ShiftRing/releases/download/v1.3.0/app.apk",
"changelog": "v1.3.0: versionCode 기반 업데이트 체크 개선",
"versionCode": 1144,
"versionName": "1.4.4",
"apkUrl": "https://git.webpluss.net/attachments/9658b292-b9fa-4509-b270-706ba6e6fd54",
"changelog": "v1.4.4: 마진 3dp 축소, 연차 최초적용 수정, 휴가관리 자동저장, 연차 표시 개선",
"forceUpdate": false
}