Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7774c20a45 | |||
| cce9c48345 | |||
| 7462656c15 | |||
| 30b150bb81 | |||
| f586d74759 |
12
.env.local
Normal file
12
.env.local
Normal file
@@ -0,0 +1,12 @@
|
||||
# 로컬 설정 파일
|
||||
|
||||
## Personal Access Token (Gitea)
|
||||
- 토큰: `e3b515eaa0a6683c921ca3bf718e281ed30a6075`
|
||||
- 용도: git.webpluss.net API 접근 (Release 업로드, version.json 업데이트)
|
||||
- **Git에 Commit되지 않도록 주의**
|
||||
|
||||
## 사용 예시
|
||||
```bash
|
||||
curl -u "sanjeok77:e3b515eaa0a6683c921ca3bf718e281ed30a6075" \
|
||||
"https://git.webpluss.net/api/v1/repos/sanjeok77/NeFLIX/releases"
|
||||
```
|
||||
BIN
.env.local:Zone.Identifier
Normal file
BIN
.env.local:Zone.Identifier
Normal file
Binary file not shown.
@@ -20,10 +20,8 @@ android {
|
||||
applicationId = "com.example.shiftalarm"
|
||||
minSdk = 26
|
||||
targetSdk = 35
|
||||
versionCode = 1144
|
||||
versionName = "1.4.4"
|
||||
versionCode = 1145
|
||||
versionName = "1.4.5"
|
||||
versionCode = 1149
|
||||
versionName = "1.4.9"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@@ -35,27 +35,6 @@ fun showCustomToast(context: Context, message: String, duration: Int = android.w
|
||||
// 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 생성
|
||||
|
||||
@@ -4,16 +4,19 @@ import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.AdapterView
|
||||
import android.widget.ArrayAdapter
|
||||
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 +31,6 @@ class FragmentSettingsLab : Fragment() {
|
||||
|
||||
setupSpinner()
|
||||
loadAnnualLeave()
|
||||
setupSaveButton()
|
||||
}
|
||||
|
||||
private fun setupSpinner() {
|
||||
@@ -37,10 +39,25 @@ class FragmentSettingsLab : Fragment() {
|
||||
val adapter = ArrayAdapter(requireContext(), android.R.layout.simple_spinner_item, daysList)
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
||||
binding.spinnerTotalDays.adapter = adapter
|
||||
|
||||
// 선택 시 자동 저장
|
||||
binding.spinnerTotalDays.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||
override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
|
||||
if (!isInitialLoad) {
|
||||
val totalDays = position + 1 // 0-indexed to actual days
|
||||
saveAnnualLeave(totalDays)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onNothingSelected(parent: AdapterView<*>?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadAnnualLeave() {
|
||||
lifecycleScope.launch {
|
||||
isInitialLoad = true
|
||||
val repo = ShiftRepository(requireContext())
|
||||
|
||||
val annualLeave = repo.getAnnualLeave()
|
||||
@@ -53,14 +70,14 @@ class FragmentSettingsLab : Fragment() {
|
||||
binding.spinnerTotalDays.setSelection(14)
|
||||
binding.tvRemainingDays.text = "15"
|
||||
}
|
||||
|
||||
// 초기 로드 완료 후 플래그 변경 (약간의 딜레이로 초기 선택 이벤트 방지)
|
||||
delay(300)
|
||||
isInitialLoad = false
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupSaveButton() {
|
||||
binding.btnSaveAnnualLeave.setOnClickListener {
|
||||
val selectedPosition = binding.spinnerTotalDays.selectedItemPosition
|
||||
val totalDays = selectedPosition + 1 // 0-indexed to actual days
|
||||
|
||||
private fun saveAnnualLeave(totalDays: Int) {
|
||||
lifecycleScope.launch {
|
||||
val repo = ShiftRepository(requireContext())
|
||||
|
||||
@@ -73,7 +90,6 @@ class FragmentSettingsLab : Fragment() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 남은 연차 표시 형식 개선
|
||||
|
||||
@@ -80,8 +80,7 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
binding.prevMonth.setOnClickListener {
|
||||
currentViewMonth = currentViewMonth.minusMonths(1)
|
||||
updateCalendar()
|
||||
animateMonthTransition(-1)
|
||||
}
|
||||
|
||||
binding.monthTitle.setOnClickListener {
|
||||
@@ -89,8 +88,7 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
binding.nextMonth.setOnClickListener {
|
||||
currentViewMonth = currentViewMonth.plusMonths(1)
|
||||
updateCalendar()
|
||||
animateMonthTransition(1)
|
||||
}
|
||||
|
||||
binding.btnToday.setOnClickListener {
|
||||
@@ -707,11 +705,42 @@ class MainActivity : AppCompatActivity() {
|
||||
Toast.makeText(this, "⚠️ 루팅된 기기에서 시각적 오류나 알람 불안정이 발생할 수 있습니다.", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 남은 연차 표시 형식 개선
|
||||
* - 정수면 정수로 표시 (예: 22)
|
||||
* - 소숫점 있으면 소숫점 표시 (예: 21.5)
|
||||
*/
|
||||
private fun animateMonthTransition(direction: Int) {
|
||||
val card = binding.calendarCard
|
||||
val width = card.width.toFloat()
|
||||
|
||||
if (width == 0f) {
|
||||
currentViewMonth = if (direction > 0) {
|
||||
currentViewMonth.plusMonths(1)
|
||||
} else {
|
||||
currentViewMonth.minusMonths(1)
|
||||
}
|
||||
updateCalendar()
|
||||
return
|
||||
}
|
||||
|
||||
card.animate()
|
||||
.translationX(if (direction > 0) -width else width)
|
||||
.alpha(0.5f)
|
||||
.setDuration(200)
|
||||
.withEndAction {
|
||||
currentViewMonth = if (direction > 0) {
|
||||
currentViewMonth.plusMonths(1)
|
||||
} else {
|
||||
currentViewMonth.minusMonths(1)
|
||||
}
|
||||
updateCalendar()
|
||||
|
||||
card.translationX = if (direction > 0) width else -width
|
||||
card.animate()
|
||||
.translationX(0f)
|
||||
.alpha(1f)
|
||||
.setDuration(200)
|
||||
.start()
|
||||
}
|
||||
.start()
|
||||
}
|
||||
|
||||
private fun formatRemainingDays(days: Float): String {
|
||||
return if (days == days.toInt().toFloat()) {
|
||||
// 정수인 경우
|
||||
|
||||
@@ -108,11 +108,4 @@ class ShiftRepository(private val context: Context) {
|
||||
))
|
||||
}
|
||||
}
|
||||
val annualLeave = dao.getAnnualLeave()
|
||||
annualLeave?.let {
|
||||
val usedDays = calculateUsedAnnualLeave()
|
||||
val remainingDays = it.totalDays - usedDays
|
||||
dao.insertAnnualLeave(it.copy(remainingDays = remainingDays))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -51,9 +51,6 @@
|
||||
android:id="@+id/spinnerTotalDays"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="48dp"/>
|
||||
android:id="@+id/npTotalDays"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="100dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -70,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">
|
||||
@@ -79,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
|
||||
@@ -126,25 +123,14 @@
|
||||
android:layout_marginBottom="8dp"
|
||||
android:gravity="center"/>
|
||||
|
||||
<!-- Calculation Info -->
|
||||
<!-- 기능추가중 Notice -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="※ 연차: -1일 / 반년: -0.5일 차감"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/text_tertiary"
|
||||
android:text="기능추가중"
|
||||
android:textSize="11sp"
|
||||
android:textColor="@color/primary"
|
||||
android:layout_marginBottom="24dp"
|
||||
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>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
android:id="@+id/shiftChar"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_height="40dp"
|
||||
|
||||
android:gravity="center"
|
||||
android:text="주"
|
||||
android:textSize="15sp"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<string name="tab_basic">기본 설정</string>
|
||||
<string name="tab_alarm">알람 설정</string>
|
||||
<string name="tab_additional">부가기능</string>
|
||||
<string name="tab_lab">휴가 관리</string>
|
||||
<string name="tab_lab">근무 관리</string>
|
||||
|
||||
<string-array name="factory_array">
|
||||
<item>전주</item>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"versionCode": 1145,
|
||||
"versionName": "1.4.5",
|
||||
"apkUrl": "https://git.webpluss.net/attachments/aeb7b079-f81b-4c77-b8ee-b8fde90a530e",
|
||||
"changelog": "v1.4.5: 연차 최초적용 수정, 휴가관리 Spinner 변경, 동그라미 크기 확대",
|
||||
"versionCode": 1149,
|
||||
"versionName": "1.4.9",
|
||||
"apkUrl": "https://git.webpluss.net/attachments/b8f51fa6-d26c-404a-b798-ee1c847a2be0",
|
||||
"changelog": "v1.4.9: 버전 업데이트",
|
||||
"forceUpdate": false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user