5 Commits

Author SHA1 Message Date
f586d74759 fix: 휴가관리 UI 정리 및 자동 저장 기능 추가
- 중복된 '연차: -1일 / 반년: -0.5일 차감' 텍스트 제거
- 중복된 Spinner/NumberPicker 뷰 정리
- 저장 버튼 제거하고 Spinner 선택 시 자동 저장되도록 개선
- 버전 업데이트 v1.4.6 (1146)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-13 00:27:42 +09:00
608109e437 chore: 버전 업데이트 v1.4.5 (1145)
- versionCode: 1144 → 1145
- versionName: 1.4.4 → 1.4.5

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-13 00:20:18 +09:00
48cfbf3473 fix: 달력 아이템 동그라미 크기 확대
- 양쪽 마진 축소로 인한 공백 제거
- shiftChar 크기: 40dp → 48dp

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-13 00:03:34 +09:00
911ff3003f feat: 휴가 관리 NumberPicker → Spinner 변경 + 저장 버튼 복원
- NumberPicker 대신 Spinner(드롭다운) 사용
- 값 변경 시 자동 저장 제거하고 저장 버튼 복원
- 더 직관적인 UI 제공

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-13 00:02:38 +09:00
975c2cc9f6 fix: 연차/반년 최초 적용 타이밍 문제 수정
- setOverride 후 updateRemainingAnnualLeave()를 먼저 호출하고 updateCalendar() 호출
- 연차 계산이 완료된 후 화면 갱신되도록 순서 변경

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-13 00:02:27 +09:00
6 changed files with 62 additions and 65 deletions

View File

@@ -22,7 +22,8 @@ android {
targetSdk = 35
versionCode = 1144
versionName = "1.4.4"
versionName = "1.4.3"
versionCode = 1145
versionName = "1.4.5"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

View File

@@ -4,7 +4,8 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.NumberPicker
import android.widget.AdapterView
import android.widget.ArrayAdapter
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import com.example.shiftalarm.databinding.FragmentSettingsLabBinding
@@ -28,22 +29,29 @@ class FragmentSettingsLab : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
setupNumberPicker()
setupSpinner()
loadAnnualLeave()
}
private fun setupNumberPicker() {
binding.npTotalDays.apply {
minValue = 1
maxValue = 25
wrapSelectorWheel = false
private fun setupSpinner() {
// 1~25일 선택 가능한 어댑터 설정
val daysList = (1..25).map { "${it}" }.toList()
val adapter = ArrayAdapter(requireContext(), android.R.layout.simple_spinner_item, daysList)
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
binding.spinnerTotalDays.adapter = adapter
// 값 변경 시 자동 저장
setOnValueChangedListener { _, _, newVal ->
// 선택 시 자동 저장
binding.spinnerTotalDays.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
if (!isInitialLoad) {
saveAnnualLeave(newVal)
val totalDays = position + 1 // 0-indexed to actual days
saveAnnualLeave(totalDays)
}
}
override fun onNothingSelected(parent: AdapterView<*>?) {
// Do nothing
}
}
}
@@ -54,16 +62,17 @@ class FragmentSettingsLab : Fragment() {
val annualLeave = repo.getAnnualLeave()
annualLeave?.let {
binding.npTotalDays.value = it.totalDays.toInt()
// 저장된 값이 있으면 해당 위치 선택 (0-indexed)
binding.spinnerTotalDays.setSelection(it.totalDays.toInt() - 1)
binding.tvRemainingDays.text = formatRemainingDays(it.remainingDays)
} ?: run {
// Default: 15 days
binding.npTotalDays.value = 15
// Default: 15 days (index 14)
binding.spinnerTotalDays.setSelection(14)
binding.tvRemainingDays.text = "15"
}
// 초기 로드 완료 후 플래그 변경
delay(100)
// 초기 로드 완료 후 플래그 변경 (약간의 딜레이로 초기 선택 이벤트 방지)
delay(300)
isInitialLoad = false
}
}
@@ -77,7 +86,7 @@ class FragmentSettingsLab : Fragment() {
val updated = repo.getAnnualLeave()
updated?.let {
binding.tvRemainingDays.text = formatRemainingDays(it.remainingDays)
showCustomToast(requireContext(), "총 연차 ${totalDays}일로 설정되었습니다 (남은 연차: ${formatRemainingDays(it.remainingDays)}일)")
showCustomToast(requireContext(), "총 연차 ${totalDays}일로 저장되었습니다 (남은 연차: ${formatRemainingDays(it.remainingDays)}일)")
}
}
}

View File

@@ -187,21 +187,21 @@ class MainActivity : AppCompatActivity() {
}
}
override fun onResume() {
super.onResume()
val prefs = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
currentViewTeam = prefs.getString(KEY_TEAM, "A") ?: "A"
override fun onResume() {
super.onResume()
val prefs = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
currentViewTeam = prefs.getString(KEY_TEAM, "A") ?: "A"
updateTideButtonVisibility()
updateCalendar()
updateTideButtonVisibility()
updateCalendar()
// 일원화된 통합 권한 체크 실행 (신뢰도 100% 보장)
AlarmPermissionUtil.checkAndRequestAllPermissions(this)
// 일원화된 통합 권한 체크 실행 (신뢰도 100% 보장)
AlarmPermissionUtil.checkAndRequestAllPermissions(this)
// 설정 변경 시 즉시 반영을 위한 강제 동기화 (30일 스케줄링)
lifecycleScope.launch {
syncAllAlarms(this@MainActivity)
}
// 설정 변경 시 즉시 반영을 위한 강제 동기화 (30일 스케줄링)
lifecycleScope.launch {
syncAllAlarms(this@MainActivity)
}
// 연차 정보 업데이트
lifecycleScope.launch {
@@ -213,16 +213,7 @@ class MainActivity : AppCompatActivity() {
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)
@@ -334,15 +325,9 @@ 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 {
@@ -350,7 +335,7 @@ class MainActivity : AppCompatActivity() {
} ?: run {
binding.tvAnnualLeave.text = "연차: --"
}
}
}
updateOtherTeamsLayout(today, factory, prefs)
}
@@ -651,10 +636,11 @@ class MainActivity : AppCompatActivity() {
else -> {
// New Types: 월차, 연차, 반월, 반년, 교육 -> Saved as Override with no time
repo.setOverride(date, selected, team, factory)
// 연차 계산을 먼저 수행하고 달력 업데이트
repo.updateRemainingAnnualLeave()
updateCalendar()
syncAllAlarms(this)
android.widget.Toast.makeText(this, "${selected}(으)로 기록되었습니다. 알람이 해제됩니다.", android.widget.Toast.LENGTH_SHORT).show()
repo.updateRemainingAnnualLeave()
}
}
}

View File

@@ -15,13 +15,13 @@
android:textSize="18sp"
android:textStyle="bold"
android:textColor="@color/text_primary"
android:layout_marginBottom="16dp"/>
android:layout_marginBottom="24dp"/>
<!-- Total Annual Leave Setting -->
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:layout_marginBottom="16dp"
app:cardCornerRadius="12dp"
app:cardElevation="2dp"
app:cardBackgroundColor="@color/surface">
@@ -30,7 +30,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="12dp"
android:padding="16dp"
android:gravity="center_vertical">
<TextView
@@ -47,10 +47,10 @@
android:orientation="horizontal"
android:gravity="center_vertical">
<NumberPicker
android:id="@+id/npTotalDays"
android:layout_width="60dp"
android:layout_height="100dp"/>
<Spinner
android:id="@+id/spinnerTotalDays"
android:layout_width="80dp"
android:layout_height="48dp"/>
<TextView
android:layout_width="wrap_content"
@@ -67,7 +67,7 @@
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:layout_marginBottom="16dp"
app:cardCornerRadius="12dp"
app:cardElevation="2dp"
app:cardBackgroundColor="@color/surface">
@@ -76,7 +76,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="12dp"
android:padding="16dp"
android:gravity="center_vertical">
<TextView
@@ -120,7 +120,7 @@
android:text="※ 연차: -1일 / 반년: -0.5일 차감"
android:textSize="12sp"
android:textColor="@color/text_tertiary"
android:layout_marginBottom="8dp"
android:layout_marginBottom="24dp"
android:gravity="center"/>
</LinearLayout>

View File

@@ -38,7 +38,8 @@
<!-- Shift Abbreviation Circular Indicator (Center) -->
<TextView
android:id="@+id/shiftChar"
android:layout_width="40dp"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_height="40dp"
android:gravity="center"
android:text="주"

View File

@@ -1,7 +1,7 @@
{
"versionCode": 1144,
"versionName": "1.4.4",
"apkUrl": "https://git.webpluss.net/attachments/9658b292-b9fa-4509-b270-706ba6e6fd54",
"changelog": "v1.4.4: 마진 3dp 축소, 연차 최초적용 수정, 휴가관리 자동저장, 연차 표시 개선",
"versionCode": 1146,
"versionName": "1.4.6",
"apkUrl": "https://git.webpluss.net/attachments/94d91eff-db0f-44af-b043-b03918cba243",
"changelog": "v1.4.6: 휴가관리 중복 텍스트 제거, 자동 저장 기능 추가",
"forceUpdate": false
}