5 Commits

Author SHA1 Message Date
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
17 changed files with 273 additions and 130 deletions

BIN
app.apk

Binary file not shown.

View File

@@ -20,11 +20,8 @@ android {
applicationId = "com.example.shiftalarm"
minSdk = 26
targetSdk = 35
versionCode = 1140
versionName = "1.4.0"
versionName = "1.3.0"
versionCode = 1141
versionName = "1.4.1"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

View File

@@ -16,6 +16,26 @@ 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, 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

@@ -22,9 +22,9 @@ data class DayShift(
class CalendarAdapter(
var days: List<DayShift>,
private val listener: OnDayClickListener,
var showHolidays: Boolean = true
var showHolidays: Boolean = true,
private val rowCount: Int = 6 // Default to 6 rows
) : RecyclerView.Adapter<CalendarAdapter.ViewHolder>() {
interface OnDayClickListener {
fun onDayClick(date: LocalDate, currentShift: String)
}
@@ -52,6 +52,20 @@ class CalendarAdapter(
val item = days[position]
val context = holder.itemView.context
// Dynamically adjust item height based on row count (5 or 6 rows)
val displayMetrics = context.resources.displayMetrics
val screenWidth = displayMetrics.widthPixels
val itemWidth = screenWidth / 7 // Each cell width
val itemHeight = if (rowCount == 5) {
(itemWidth * 1.2).toInt() // Taller items for 5 rows to fill space
} else {
itemWidth // Square items for 6 rows
}
val layoutParams = holder.itemView.layoutParams
layoutParams.height = itemHeight
holder.itemView.layoutParams = layoutParams
if (item.date == null) {
holder.itemView.visibility = View.INVISIBLE
return

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

@@ -67,7 +67,7 @@ class FragmentSettingsLab : Fragment() {
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()
showCustomToast(requireContext(), "연차가 저장되었습니다. (남은 연차: ${String.format("%.1f", it.remainingDays)}일)")
}
}
}

View File

@@ -202,6 +202,17 @@ class MainActivity : AppCompatActivity() {
lifecycleScope.launch {
syncAllAlarms(this@MainActivity)
}
// 연차 정보 업데이트
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() {
@@ -257,6 +268,7 @@ class MainActivity : AppCompatActivity() {
private fun setupCalendar() {
binding.calendarGrid.layoutManager = GridLayoutManager(this, 7)
binding.calendarGrid.setHasFixedSize(false) // Allow dynamic item sizing
updateCalendar()
}
@@ -296,11 +308,17 @@ class MainActivity : AppCompatActivity() {
val days = generateDaysForMonthWithData(currentViewMonth, currentViewTeam, factory, overrides, memos)
// Calculate row count (5 or 6 rows)
val daysInMonth = currentViewMonth.lengthOfMonth()
val firstDayOfMonth = currentViewMonth.atDay(1).dayOfWeek.value % 7
val actualDayCount = firstDayOfMonth + daysInMonth
val rowCount = if (actualDayCount <= 35) 5 else 6
val adapter = CalendarAdapter(days, object : CalendarAdapter.OnDayClickListener {
override fun onDayClick(date: LocalDate, currentShift: String) {
showDaySettingsDialog(date, currentShift)
}
}, binding.cbShowHolidays.isChecked)
}, binding.cbShowHolidays.isChecked, rowCount)
binding.calendarGrid.adapter = adapter
binding.monthTitle.text = currentViewMonth.format(DateTimeFormatter.ofPattern("yyyy년 MM월"))
@@ -316,8 +334,15 @@ class MainActivity : AppCompatActivity() {
binding.todayStatusText.text = "오늘의 근무: $shiftForViewingTeam$teamSuffix"
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 = "연차: --"
}
}
updateOtherTeamsLayout(today, factory, prefs)
}
@@ -377,7 +402,7 @@ class MainActivity : AppCompatActivity() {
if (currentViewTeam != t) {
currentViewTeam = t
updateCalendar()
Toast.makeText(context, "${t}반 근무표를 표시합니다.", Toast.LENGTH_SHORT).show()
showCustomToast(context, "${t}반 근무표를 표시합니다.")
}
}
}
@@ -595,6 +620,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 +646,7 @@ class MainActivity : AppCompatActivity() {
updateCalendar()
syncAllAlarms(this)
android.widget.Toast.makeText(this, "${selected}(으)로 기록되었습니다. 알람이 해제됩니다.", android.widget.Toast.LENGTH_SHORT).show()
repo.updateRemainingAnnualLeave()
}
}
}

View File

@@ -60,7 +60,7 @@ class ShiftRepository(private val context: Context) {
// Annual Leave
suspend fun calculateUsedAnnualLeave(): Float = withContext(Dispatchers.IO) {
val currentYear = java.time.Year.now().toString()
val currentYear = java.time.Year.now(java.time.ZoneId.of("Asia/Seoul")).toString()
val overrides = dao.getAllOverrides()
var usedDays = 0f

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">
<solid android:color="@color/surface" />
<corners android:radius="12dp" />
<stroke
android:width="1dp"
android:color="@color/outline" />
</shape>

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="16dp"
android:paddingVertical="10dp"
android:gravity="center">
<TextView
android:id="@+id/toastText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@color/text_primary"
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 @@
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/dayRoot"
android:layout_width="match_parent"
android:layout_height="108dp"
android:layout_height="85dp"
android:background="@drawable/bg_grid_cell_v4">
<!-- Day Number (top-left) -->

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": 1141,
"versionName": "1.4.1",
"apkUrl": "https://git.webpluss.net/attachments/23f6818f-a647-4f9e-905f-e99f5c9d93b0",
"changelog": "v1.4.1: 달력 5행일 때 화면 꽉 채우기, 다크모드 토스트 지원, 연차 저장/연동 수정",
"forceUpdate": false
}