Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 30b150bb81 | |||
| f586d74759 | |||
| 608109e437 | |||
| 48cfbf3473 | |||
| 911ff3003f | |||
| 975c2cc9f6 |
@@ -20,9 +20,8 @@ android {
|
|||||||
applicationId = "com.example.shiftalarm"
|
applicationId = "com.example.shiftalarm"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 1144
|
versionCode = 1147
|
||||||
versionName = "1.4.4"
|
versionName = "1.4.7"
|
||||||
versionName = "1.4.3"
|
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ import android.os.Bundle
|
|||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.NumberPicker
|
import android.widget.AdapterView
|
||||||
|
import android.widget.ArrayAdapter
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import com.example.shiftalarm.databinding.FragmentSettingsLabBinding
|
import com.example.shiftalarm.databinding.FragmentSettingsLabBinding
|
||||||
@@ -28,22 +29,29 @@ class FragmentSettingsLab : Fragment() {
|
|||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
setupNumberPicker()
|
setupSpinner()
|
||||||
loadAnnualLeave()
|
loadAnnualLeave()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupNumberPicker() {
|
private fun setupSpinner() {
|
||||||
binding.npTotalDays.apply {
|
// 1~25일 선택 가능한 어댑터 설정
|
||||||
minValue = 1
|
val daysList = (1..25).map { "${it}일" }.toList()
|
||||||
maxValue = 25
|
val adapter = ArrayAdapter(requireContext(), android.R.layout.simple_spinner_item, daysList)
|
||||||
wrapSelectorWheel = false
|
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) {
|
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()
|
val annualLeave = repo.getAnnualLeave()
|
||||||
annualLeave?.let {
|
annualLeave?.let {
|
||||||
binding.npTotalDays.value = it.totalDays.toInt()
|
// 저장된 값이 있으면 해당 위치 선택 (0-indexed)
|
||||||
|
binding.spinnerTotalDays.setSelection(it.totalDays.toInt() - 1)
|
||||||
binding.tvRemainingDays.text = formatRemainingDays(it.remainingDays)
|
binding.tvRemainingDays.text = formatRemainingDays(it.remainingDays)
|
||||||
} ?: run {
|
} ?: run {
|
||||||
// Default: 15 days
|
// Default: 15 days (index 14)
|
||||||
binding.npTotalDays.value = 15
|
binding.spinnerTotalDays.setSelection(14)
|
||||||
binding.tvRemainingDays.text = "15"
|
binding.tvRemainingDays.text = "15"
|
||||||
}
|
}
|
||||||
|
|
||||||
// 초기 로드 완료 후 플래그 변경
|
// 초기 로드 완료 후 플래그 변경 (약간의 딜레이로 초기 선택 이벤트 방지)
|
||||||
delay(100)
|
delay(300)
|
||||||
isInitialLoad = false
|
isInitialLoad = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,7 +86,7 @@ class FragmentSettingsLab : Fragment() {
|
|||||||
val updated = repo.getAnnualLeave()
|
val updated = repo.getAnnualLeave()
|
||||||
updated?.let {
|
updated?.let {
|
||||||
binding.tvRemainingDays.text = formatRemainingDays(it.remainingDays)
|
binding.tvRemainingDays.text = formatRemainingDays(it.remainingDays)
|
||||||
showCustomToast(requireContext(), "총 연차 ${totalDays}일로 설정되었습니다 (남은 연차: ${formatRemainingDays(it.remainingDays)}일)")
|
showCustomToast(requireContext(), "총 연차 ${totalDays}일로 저장되었습니다 (남은 연차: ${formatRemainingDays(it.remainingDays)}일)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -187,21 +187,21 @@ class MainActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
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"
|
||||||
|
|
||||||
updateTideButtonVisibility()
|
updateTideButtonVisibility()
|
||||||
updateCalendar()
|
updateCalendar()
|
||||||
|
|
||||||
// 일원화된 통합 권한 체크 실행 (신뢰도 100% 보장)
|
// 일원화된 통합 권한 체크 실행 (신뢰도 100% 보장)
|
||||||
AlarmPermissionUtil.checkAndRequestAllPermissions(this)
|
AlarmPermissionUtil.checkAndRequestAllPermissions(this)
|
||||||
|
|
||||||
// 설정 변경 시 즉시 반영을 위한 강제 동기화 (30일 스케줄링)
|
// 설정 변경 시 즉시 반영을 위한 강제 동기화 (30일 스케줄링)
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
syncAllAlarms(this@MainActivity)
|
syncAllAlarms(this@MainActivity)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 연차 정보 업데이트
|
// 연차 정보 업데이트
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
@@ -213,16 +213,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
binding.tvAnnualLeave.text = "연차: --"
|
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() {
|
private fun showMonthYearPicker() {
|
||||||
val dialogView = layoutInflater.inflate(R.layout.dialog_month_year_picker, null)
|
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))
|
binding.todayStatusText.setTextColor(androidx.core.content.ContextCompat.getColor(this@MainActivity, R.color.warning_red))
|
||||||
} else {
|
} else {
|
||||||
binding.todayStatusText.text = "오늘의 근무: $shiftForViewingTeam$teamSuffix"
|
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
|
// Update Annual Leave display
|
||||||
val annualLeave = withContext(Dispatchers.IO) { repo.getAnnualLeave() }
|
val annualLeave = withContext(Dispatchers.IO) { repo.getAnnualLeave() }
|
||||||
annualLeave?.let {
|
annualLeave?.let {
|
||||||
@@ -350,7 +335,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
} ?: run {
|
} ?: run {
|
||||||
binding.tvAnnualLeave.text = "연차: --"
|
binding.tvAnnualLeave.text = "연차: --"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updateOtherTeamsLayout(today, factory, prefs)
|
updateOtherTeamsLayout(today, factory, prefs)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -651,10 +636,11 @@ class MainActivity : AppCompatActivity() {
|
|||||||
else -> {
|
else -> {
|
||||||
// New Types: 월차, 연차, 반월, 반년, 교육 -> Saved as Override with no time
|
// New Types: 월차, 연차, 반월, 반년, 교육 -> Saved as Override with no time
|
||||||
repo.setOverride(date, selected, team, factory)
|
repo.setOverride(date, selected, team, factory)
|
||||||
|
// 연차 계산을 먼저 수행하고 달력 업데이트
|
||||||
|
repo.updateRemainingAnnualLeave()
|
||||||
updateCalendar()
|
updateCalendar()
|
||||||
syncAllAlarms(this)
|
syncAllAlarms(this)
|
||||||
android.widget.Toast.makeText(this, "${selected}(으)로 기록되었습니다. 알람이 해제됩니다.", android.widget.Toast.LENGTH_SHORT).show()
|
android.widget.Toast.makeText(this, "${selected}(으)로 기록되었습니다. 알람이 해제됩니다.", android.widget.Toast.LENGTH_SHORT).show()
|
||||||
repo.updateRemainingAnnualLeave()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,13 +15,13 @@
|
|||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:textColor="@color/text_primary"
|
android:textColor="@color/text_primary"
|
||||||
android:layout_marginBottom="16dp"/>
|
android:layout_marginBottom="24dp"/>
|
||||||
|
|
||||||
<!-- Total Annual Leave Setting -->
|
<!-- Total Annual Leave Setting -->
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="12dp"
|
android:layout_marginBottom="16dp"
|
||||||
app:cardCornerRadius="12dp"
|
app:cardCornerRadius="12dp"
|
||||||
app:cardElevation="2dp"
|
app:cardElevation="2dp"
|
||||||
app:cardBackgroundColor="@color/surface">
|
app:cardBackgroundColor="@color/surface">
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:padding="12dp"
|
android:padding="16dp"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -47,10 +47,10 @@
|
|||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<NumberPicker
|
<Spinner
|
||||||
android:id="@+id/npTotalDays"
|
android:id="@+id/spinnerTotalDays"
|
||||||
android:layout_width="60dp"
|
android:layout_width="80dp"
|
||||||
android:layout_height="100dp"/>
|
android:layout_height="48dp"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="12dp"
|
android:layout_marginBottom="16dp"
|
||||||
app:cardCornerRadius="12dp"
|
app:cardCornerRadius="12dp"
|
||||||
app:cardElevation="2dp"
|
app:cardElevation="2dp"
|
||||||
app:cardBackgroundColor="@color/surface">
|
app:cardBackgroundColor="@color/surface">
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:padding="12dp"
|
android:padding="16dp"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -123,4 +123,14 @@
|
|||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:gravity="center"/>
|
android:gravity="center"/>
|
||||||
|
|
||||||
|
<!-- 기능추가중 Notice -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="기능추가중"
|
||||||
|
android:textSize="11sp"
|
||||||
|
android:textColor="@color/primary"
|
||||||
|
android:layout_marginBottom="24dp"
|
||||||
|
android:gravity="center"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -38,7 +38,8 @@
|
|||||||
<!-- Shift Abbreviation Circular Indicator (Center) -->
|
<!-- Shift Abbreviation Circular Indicator (Center) -->
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/shiftChar"
|
android:id="@+id/shiftChar"
|
||||||
android:layout_width="40dp"
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="주"
|
android:text="주"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<string name="tab_basic">기본 설정</string>
|
<string name="tab_basic">기본 설정</string>
|
||||||
<string name="tab_alarm">알람 설정</string>
|
<string name="tab_alarm">알람 설정</string>
|
||||||
<string name="tab_additional">부가기능</string>
|
<string name="tab_additional">부가기능</string>
|
||||||
<string name="tab_lab">휴가 관리</string>
|
<string name="tab_lab">근무 관리</string>
|
||||||
|
|
||||||
<string-array name="factory_array">
|
<string-array name="factory_array">
|
||||||
<item>전주</item>
|
<item>전주</item>
|
||||||
|
|||||||
+4
-4
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"versionCode": 1144,
|
"versionCode": 1147,
|
||||||
"versionName": "1.4.4",
|
"versionName": "1.4.7",
|
||||||
"apkUrl": "https://git.webpluss.net/attachments/9658b292-b9fa-4509-b270-706ba6e6fd54",
|
"apkUrl": "https://git.webpluss.net/attachments/eb7f2a8d-3243-4c23-a833-f9864a4686a3",
|
||||||
"changelog": "v1.4.4: 마진 3dp 축소, 연차 최초적용 수정, 휴가관리 자동저장, 연차 표시 개선",
|
"changelog": "v1.4.7: 버전업 오류 수정, 휴가관리→근무관리 명칭 변경, 기능추가중 표시",
|
||||||
"forceUpdate": false
|
"forceUpdate": false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user