Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 26fb793ab9 |
@@ -20,8 +20,10 @@ android {
|
|||||||
applicationId = "com.example.shiftalarm"
|
applicationId = "com.example.shiftalarm"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 1142
|
versionCode = 1130
|
||||||
versionName = "1.4.2"
|
versionName = "1.3.0"
|
||||||
|
versionName = "1.2.5"
|
||||||
|
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,47 +16,6 @@ import java.util.concurrent.TimeUnit
|
|||||||
val SEOUL_ZONE: ZoneId = ZoneId.of("Asia/Seoul")
|
val SEOUL_ZONE: ZoneId = ZoneId.of("Asia/Seoul")
|
||||||
const val TAG = "ShiftAlarm"
|
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 생성
|
// 알람 ID 생성
|
||||||
// ============================================
|
// ============================================
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
package com.example.shiftalarm
|
package com.example.shiftalarm
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.room.Database
|
import androidx.room.*
|
||||||
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)
|
@Database(entities = [ShiftOverride::class, DailyMemo::class, CustomAlarm::class], version = 3, exportSchema = false)
|
||||||
abstract class AppDatabase : RoomDatabase() {
|
abstract class AppDatabase : RoomDatabase() {
|
||||||
abstract fun shiftDao(): ShiftDao
|
abstract fun shiftDao(): ShiftDao
|
||||||
|
|
||||||
@@ -15,23 +11,6 @@ abstract class AppDatabase : RoomDatabase() {
|
|||||||
@Volatile
|
@Volatile
|
||||||
private var INSTANCE: AppDatabase? = null
|
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 {
|
fun getDatabase(context: Context): AppDatabase {
|
||||||
return INSTANCE ?: synchronized(this) {
|
return INSTANCE ?: synchronized(this) {
|
||||||
val instance = Room.databaseBuilder(
|
val instance = Room.databaseBuilder(
|
||||||
@@ -39,7 +18,7 @@ abstract class AppDatabase : RoomDatabase() {
|
|||||||
AppDatabase::class.java,
|
AppDatabase::class.java,
|
||||||
"shift_database"
|
"shift_database"
|
||||||
)
|
)
|
||||||
.addMigrations(MIGRATION_3_4)
|
.fallbackToDestructiveMigration() // Simple for now
|
||||||
.build()
|
.build()
|
||||||
INSTANCE = instance
|
INSTANCE = instance
|
||||||
instance
|
instance
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ data class DayShift(
|
|||||||
class CalendarAdapter(
|
class CalendarAdapter(
|
||||||
var days: List<DayShift>,
|
var days: List<DayShift>,
|
||||||
private val listener: OnDayClickListener,
|
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>() {
|
) : RecyclerView.Adapter<CalendarAdapter.ViewHolder>() {
|
||||||
|
|
||||||
interface OnDayClickListener {
|
interface OnDayClickListener {
|
||||||
fun onDayClick(date: LocalDate, currentShift: String)
|
fun onDayClick(date: LocalDate, currentShift: String)
|
||||||
}
|
}
|
||||||
@@ -52,15 +52,6 @@ class CalendarAdapter(
|
|||||||
val item = days[position]
|
val item = days[position]
|
||||||
val context = holder.itemView.context
|
val context = holder.itemView.context
|
||||||
|
|
||||||
// Fixed item height - square cells based on screen width
|
|
||||||
val displayMetrics = context.resources.displayMetrics
|
|
||||||
val screenWidth = displayMetrics.widthPixels
|
|
||||||
val itemHeight = screenWidth / 7
|
|
||||||
|
|
||||||
val layoutParams = holder.itemView.layoutParams
|
|
||||||
layoutParams.height = itemHeight
|
|
||||||
holder.itemView.layoutParams = layoutParams
|
|
||||||
|
|
||||||
if (item.date == null) {
|
if (item.date == null) {
|
||||||
holder.itemView.visibility = View.INVISIBLE
|
holder.itemView.visibility = View.INVISIBLE
|
||||||
return
|
return
|
||||||
@@ -69,6 +60,7 @@ class CalendarAdapter(
|
|||||||
holder.itemView.visibility = View.VISIBLE
|
holder.itemView.visibility = View.VISIBLE
|
||||||
|
|
||||||
// Day Number
|
// Day Number
|
||||||
|
holder.dayNumber.text = item.date.dayOfMonth.toString()
|
||||||
|
|
||||||
// Holiday / Weekend logic
|
// Holiday / Weekend logic
|
||||||
val isSunday = item.date.dayOfWeek == java.time.DayOfWeek.SUNDAY
|
val isSunday = item.date.dayOfWeek == java.time.DayOfWeek.SUNDAY
|
||||||
@@ -107,7 +99,7 @@ class CalendarAdapter(
|
|||||||
holder.shiftChar.background = null
|
holder.shiftChar.background = null
|
||||||
holder.shiftChar.text = ""
|
holder.shiftChar.text = ""
|
||||||
holder.holidayNameSmall.visibility = View.GONE
|
holder.holidayNameSmall.visibility = View.GONE
|
||||||
holder.shiftChar.textSize = 15f
|
holder.shiftChar.textSize = 13f
|
||||||
|
|
||||||
// "반월", "반년" (Half-Monthly, Half-Yearly) Special Logic
|
// "반월", "반년" (Half-Monthly, Half-Yearly) Special Logic
|
||||||
// These are overrides or specific shifts that user sets.
|
// These are overrides or specific shifts that user sets.
|
||||||
@@ -119,7 +111,7 @@ class CalendarAdapter(
|
|||||||
// Holiday Mode (Priority): Show full holiday name, no circle
|
// Holiday Mode (Priority): Show full holiday name, no circle
|
||||||
holder.shiftChar.text = fullHolidayName
|
holder.shiftChar.text = fullHolidayName
|
||||||
holder.shiftChar.setTextColor(Color.parseColor("#FF5252"))
|
holder.shiftChar.setTextColor(Color.parseColor("#FF5252"))
|
||||||
holder.shiftChar.textSize = 11f
|
holder.shiftChar.textSize = 10f
|
||||||
holder.shiftChar.background = null
|
holder.shiftChar.background = null
|
||||||
} else if (item.shift != null && item.shift != "비번") {
|
} else if (item.shift != null && item.shift != "비번") {
|
||||||
// Shift Mode
|
// Shift Mode
|
||||||
@@ -128,7 +120,7 @@ class CalendarAdapter(
|
|||||||
if (item.shift == "반월" || item.shift == "반년") {
|
if (item.shift == "반월" || item.shift == "반년") {
|
||||||
holder.shiftChar.text = if (item.shift == "반월") "월" else "년"
|
holder.shiftChar.text = if (item.shift == "반월") "월" else "년"
|
||||||
holder.shiftChar.setTextColor(ContextCompat.getColor(context, R.color.black)) // Black for contrast on Half Red/Transparent
|
holder.shiftChar.setTextColor(ContextCompat.getColor(context, R.color.black)) // Black for contrast on Half Red/Transparent
|
||||||
holder.shiftChar.textSize = 15f
|
holder.shiftChar.textSize = 13f
|
||||||
holder.shiftChar.background = ContextCompat.getDrawable(context, R.drawable.bg_shift_half_red)
|
holder.shiftChar.background = ContextCompat.getDrawable(context, R.drawable.bg_shift_half_red)
|
||||||
} else {
|
} else {
|
||||||
// Standard Logic
|
// Standard Logic
|
||||||
@@ -145,7 +137,7 @@ class CalendarAdapter(
|
|||||||
else -> item.shift.take(1)
|
else -> item.shift.take(1)
|
||||||
}
|
}
|
||||||
holder.shiftChar.text = shiftAbbreviation
|
holder.shiftChar.text = shiftAbbreviation
|
||||||
holder.shiftChar.textSize = 17f
|
holder.shiftChar.textSize = 15f
|
||||||
holder.shiftChar.setTypeface(null, android.graphics.Typeface.BOLD)
|
holder.shiftChar.setTypeface(null, android.graphics.Typeface.BOLD)
|
||||||
|
|
||||||
val shiftColorRes = when (item.shift) {
|
val shiftColorRes = when (item.shift) {
|
||||||
@@ -213,7 +205,7 @@ class CalendarAdapter(
|
|||||||
// holder.holidayNameSmall.text = HolidayManager.getLunarDateString(item.date)
|
// holder.holidayNameSmall.text = HolidayManager.getLunarDateString(item.date)
|
||||||
|
|
||||||
holder.shiftChar.text = HolidayManager.getLunarDateString(item.date)
|
holder.shiftChar.text = HolidayManager.getLunarDateString(item.date)
|
||||||
holder.shiftChar.textSize = 11f
|
holder.shiftChar.textSize = 10f
|
||||||
holder.shiftChar.setTextColor(ContextCompat.getColor(context, R.color.text_tertiary))
|
holder.shiftChar.setTextColor(ContextCompat.getColor(context, R.color.text_tertiary))
|
||||||
holder.shiftChar.background = null
|
holder.shiftChar.background = null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.example.shiftalarm
|
package com.example.shiftalarm
|
||||||
|
|
||||||
import androidx.room.Entity
|
import androidx.room.*
|
||||||
import androidx.room.PrimaryKey
|
|
||||||
|
|
||||||
@Entity(tableName = "shift_overrides", primaryKeys = ["factory", "team", "date"])
|
@Entity(tableName = "shift_overrides", primaryKeys = ["factory", "team", "date"])
|
||||||
data class ShiftOverride(
|
data class ShiftOverride(
|
||||||
@@ -29,12 +28,3 @@ data class CustomAlarm(
|
|||||||
val snoozeInterval: Int = 5,
|
val snoozeInterval: Int = 5,
|
||||||
val snoozeRepeat: Int = 3
|
val snoozeRepeat: Int = 3
|
||||||
)
|
)
|
||||||
|
|
||||||
@Entity(tableName = "annual_leave")
|
|
||||||
data class AnnualLeave(
|
|
||||||
@PrimaryKey
|
|
||||||
val id: Int = 1, // Single row for app-wide annual leave
|
|
||||||
val totalDays: Float, // 총 연차 (1~25)
|
|
||||||
val remainingDays: Float, // 남은 연차
|
|
||||||
val updatedAt: Long = System.currentTimeMillis()
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -93,7 +93,6 @@ class FragmentSettingsAdditional : Fragment() {
|
|||||||
|
|
||||||
// Tide Switch
|
// Tide Switch
|
||||||
binding.switchTide.isChecked = prefs.getBoolean("show_tide", false)
|
binding.switchTide.isChecked = prefs.getBoolean("show_tide", false)
|
||||||
loadAppVersion()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupListeners() {
|
private fun setupListeners() {
|
||||||
@@ -212,18 +211,6 @@ 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() {
|
override fun onDestroyView() {
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
_binding = null
|
_binding = null
|
||||||
|
|||||||
@@ -4,11 +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.Toast
|
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.lifecycle.lifecycleScope
|
|
||||||
import com.example.shiftalarm.databinding.FragmentSettingsLabBinding
|
import com.example.shiftalarm.databinding.FragmentSettingsLabBinding
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
|
|
||||||
class FragmentSettingsLab : Fragment() {
|
class FragmentSettingsLab : Fragment() {
|
||||||
|
|
||||||
@@ -23,56 +20,6 @@ class FragmentSettingsLab : Fragment() {
|
|||||||
return binding.root
|
return binding.root
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
|
||||||
super.onViewCreated(view, savedInstanceState)
|
|
||||||
|
|
||||||
setupNumberPicker()
|
|
||||||
loadAnnualLeave()
|
|
||||||
setupSaveButton()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun setupNumberPicker() {
|
|
||||||
binding.npTotalDays.apply {
|
|
||||||
minValue = 1
|
|
||||||
maxValue = 25
|
|
||||||
wrapSelectorWheel = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun loadAnnualLeave() {
|
|
||||||
lifecycleScope.launch {
|
|
||||||
val repo = ShiftRepository(requireContext())
|
|
||||||
|
|
||||||
val annualLeave = repo.getAnnualLeave()
|
|
||||||
annualLeave?.let {
|
|
||||||
binding.npTotalDays.value = it.totalDays.toInt()
|
|
||||||
binding.tvRemainingDays.text = String.format("%.1f", it.remainingDays)
|
|
||||||
} ?: run {
|
|
||||||
// Default: 15 days
|
|
||||||
binding.npTotalDays.value = 15
|
|
||||||
binding.tvRemainingDays.text = "15.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
|
||||||
showCustomToast(requireContext(), "연차가 저장되었습니다. (남은 연차: ${String.format("%.1f", it.remainingDays)}일)")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
super.onDestroyView()
|
super.onDestroyView()
|
||||||
_binding = null
|
_binding = null
|
||||||
|
|||||||
@@ -202,17 +202,6 @@ class MainActivity : AppCompatActivity() {
|
|||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
syncAllAlarms(this@MainActivity)
|
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() {
|
private fun showMonthYearPicker() {
|
||||||
@@ -268,7 +257,6 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
private fun setupCalendar() {
|
private fun setupCalendar() {
|
||||||
binding.calendarGrid.layoutManager = GridLayoutManager(this, 7)
|
binding.calendarGrid.layoutManager = GridLayoutManager(this, 7)
|
||||||
binding.calendarGrid.setHasFixedSize(false) // Allow dynamic item sizing
|
|
||||||
updateCalendar()
|
updateCalendar()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -308,34 +296,13 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
val days = generateDaysForMonthWithData(currentViewMonth, currentViewTeam, factory, overrides, memos)
|
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 {
|
val adapter = CalendarAdapter(days, object : CalendarAdapter.OnDayClickListener {
|
||||||
override fun onDayClick(date: LocalDate, currentShift: String) {
|
override fun onDayClick(date: LocalDate, currentShift: String) {
|
||||||
showDaySettingsDialog(date, currentShift)
|
showDaySettingsDialog(date, currentShift)
|
||||||
}
|
}
|
||||||
}, binding.cbShowHolidays.isChecked, rowCount)
|
}, binding.cbShowHolidays.isChecked)
|
||||||
|
|
||||||
binding.calendarGrid.adapter = adapter
|
binding.calendarGrid.adapter = adapter
|
||||||
|
|
||||||
// Set RecyclerView height based on row count
|
|
||||||
// 5 rows: fixed height to fill space, no scroll
|
|
||||||
// 6 rows: max height (5 rows worth), enable scroll
|
|
||||||
val displayMetrics = resources.displayMetrics
|
|
||||||
val screenWidth = displayMetrics.widthPixels
|
|
||||||
val cellHeight = screenWidth / 7 // Square cells
|
|
||||||
val recyclerViewHeight = cellHeight * rowCount
|
|
||||||
val layoutParams = binding.calendarGrid.layoutParams
|
|
||||||
layoutParams.height = recyclerViewHeight
|
|
||||||
binding.calendarGrid.layoutParams = layoutParams
|
|
||||||
|
|
||||||
// Disable scroll for 5 rows, enable for 6 rows
|
|
||||||
binding.calendarGrid.isNestedScrollingEnabled = rowCount > 5
|
|
||||||
|
|
||||||
binding.monthTitle.text = currentViewMonth.format(DateTimeFormatter.ofPattern("yyyy년 MM월"))
|
binding.monthTitle.text = currentViewMonth.format(DateTimeFormatter.ofPattern("yyyy년 MM월"))
|
||||||
|
|
||||||
// Update Header Status Text with Permission Warning if needed
|
// Update Header Status Text with Permission Warning if needed
|
||||||
@@ -349,15 +316,8 @@ class MainActivity : AppCompatActivity() {
|
|||||||
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 = "연차: --"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
updateOtherTeamsLayout(today, factory, prefs)
|
updateOtherTeamsLayout(today, factory, prefs)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -417,7 +377,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
if (currentViewTeam != t) {
|
if (currentViewTeam != t) {
|
||||||
currentViewTeam = t
|
currentViewTeam = t
|
||||||
updateCalendar()
|
updateCalendar()
|
||||||
showCustomToast(context, "${t}반 근무표를 표시합니다.")
|
Toast.makeText(context, "${t}반 근무표를 표시합니다.", Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -635,7 +595,6 @@ class MainActivity : AppCompatActivity() {
|
|||||||
android.widget.Toast.makeText(this, "원래 근무로 복구되었습니다.", android.widget.Toast.LENGTH_SHORT).show()
|
android.widget.Toast.makeText(this, "원래 근무로 복구되었습니다.", android.widget.Toast.LENGTH_SHORT).show()
|
||||||
syncAllAlarms(this)
|
syncAllAlarms(this)
|
||||||
updateCalendar()
|
updateCalendar()
|
||||||
repo.updateRemainingAnnualLeave()
|
|
||||||
}
|
}
|
||||||
"직접 입력" -> {
|
"직접 입력" -> {
|
||||||
showCustomInputDialog(date, repo, team, factory)
|
showCustomInputDialog(date, repo, team, factory)
|
||||||
@@ -661,7 +620,6 @@ class MainActivity : AppCompatActivity() {
|
|||||||
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()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
package com.example.shiftalarm
|
package com.example.shiftalarm
|
||||||
|
|
||||||
import androidx.room.Dao
|
import androidx.room.*
|
||||||
import androidx.room.Delete
|
|
||||||
import androidx.room.Insert
|
|
||||||
import androidx.room.OnConflictStrategy
|
|
||||||
import androidx.room.Query
|
|
||||||
import androidx.room.Update
|
|
||||||
|
|
||||||
@Dao
|
@Dao
|
||||||
interface ShiftDao {
|
interface ShiftDao {
|
||||||
@@ -62,17 +57,4 @@ interface ShiftDao {
|
|||||||
|
|
||||||
@Query("DELETE FROM custom_alarms")
|
@Query("DELETE FROM custom_alarms")
|
||||||
suspend fun clearCustomAlarms()
|
suspend fun clearCustomAlarms()
|
||||||
|
|
||||||
// Annual Leave Queries
|
|
||||||
@Query("SELECT * FROM annual_leave WHERE id = 1")
|
|
||||||
suspend fun getAnnualLeave(): AnnualLeave?
|
|
||||||
|
|
||||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
|
||||||
suspend fun insertAnnualLeave(annualLeave: AnnualLeave)
|
|
||||||
|
|
||||||
@Query("UPDATE annual_leave SET remainingDays = :remainingDays, updatedAt = :timestamp WHERE id = 1")
|
|
||||||
suspend fun updateRemainingDays(remainingDays: Float, timestamp: Long = System.currentTimeMillis())
|
|
||||||
|
|
||||||
@Query("DELETE FROM annual_leave")
|
|
||||||
suspend fun clearAnnualLeave()
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,47 +57,4 @@ class ShiftRepository(private val context: Context) {
|
|||||||
suspend fun clearAllCustomAlarms() = withContext(Dispatchers.IO) {
|
suspend fun clearAllCustomAlarms() = withContext(Dispatchers.IO) {
|
||||||
dao.clearCustomAlarms()
|
dao.clearCustomAlarms()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun recalculateAndSaveAnnualLeave(totalDays: Float) {
|
|
||||||
val usedDays = calculateUsedAnnualLeave()
|
|
||||||
val remainingDays = totalDays - usedDays
|
|
||||||
|
|
||||||
dao.insertAnnualLeave(AnnualLeave(
|
|
||||||
id = 1,
|
|
||||||
totalDays = totalDays,
|
|
||||||
remainingDays = remainingDays
|
|
||||||
))
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun updateRemainingAnnualLeave() {
|
|
||||||
val annualLeave = dao.getAnnualLeave()
|
|
||||||
annualLeave?.let {
|
|
||||||
val usedDays = calculateUsedAnnualLeave()
|
|
||||||
val remainingDays = it.totalDays - usedDays
|
|
||||||
dao.insertAnnualLeave(it.copy(remainingDays = remainingDays))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
<?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>
|
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
<shape android:shape="oval">
|
<shape android:shape="oval">
|
||||||
<stroke android:width="1.5dp" android:color="@color/shift_red"/>
|
<stroke android:width="1.5dp" android:color="@color/shift_red"/>
|
||||||
<solid android:color="@android:color/transparent"/>
|
<solid android:color="@android:color/transparent"/>
|
||||||
<size android:width="52dp" android:height="52dp"/>
|
<size android:width="44dp" android:height="44dp"/>
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
</layer-list>
|
</layer-list>
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="oval">
|
android:shape="oval">
|
||||||
<solid android:color="@color/primary" />
|
<solid android:color="@color/primary" />
|
||||||
<size android:width="52dp" android:height="52dp" />
|
<size android:width="44dp" android:height="44dp" />
|
||||||
</shape>
|
</shape>
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="oval">
|
android:shape="oval">
|
||||||
<stroke android:width="1.5dp" android:color="@color/primary" />
|
<stroke android:width="1.5dp" android:color="@color/primary" />
|
||||||
<size android:width="52dp" android:height="52dp" />
|
<size android:width="44dp" android:height="44dp" />
|
||||||
</shape>
|
</shape>
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="52dp"
|
android:width="44dp"
|
||||||
android:height="52dp"
|
android:height="44dp"
|
||||||
android:viewportWidth="52"
|
android:viewportWidth="44"
|
||||||
android:viewportHeight="52">
|
android:viewportHeight="44">
|
||||||
<!-- Left Half Red -->
|
<!-- Left Half Red -->
|
||||||
<path
|
<path
|
||||||
android:name="left_half"
|
android:name="left_half"
|
||||||
android:fillColor="@color/shift_red"
|
android:fillColor="@color/shift_red"
|
||||||
android:pathData="M26,0 A26,26 0 0 0 26,52 L26,0 Z" />
|
android:pathData="M22,0 A22,22 0 0 0 22,44 L22,0 Z" />
|
||||||
|
|
||||||
</vector>
|
</vector>
|
||||||
|
|||||||
@@ -58,12 +58,12 @@
|
|||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<!-- Maximized Calendar Card - Reduced margins for wider calendar -->
|
<!-- Maximized Calendar Card -->
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:id="@+id/calendarCard"
|
android:id="@+id/calendarCard"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginHorizontal="4dp"
|
android:layout_marginHorizontal="12dp"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
app:cardCornerRadius="28dp"
|
app:cardCornerRadius="28dp"
|
||||||
app:cardElevation="0dp"
|
app:cardElevation="0dp"
|
||||||
@@ -160,20 +160,7 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/tvAnnualLeave"/>
|
app:layout_constraintEnd_toStartOf="@id/btnTideLocation"/>
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tvAnnualLeave"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="연차: 0.0"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:textColor="@color/primary"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/btnTideLocation"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatButton
|
<androidx.appcompat.widget.AppCompatButton
|
||||||
android:id="@+id/btnTideLocation"
|
android:id="@+id/btnTideLocation"
|
||||||
@@ -240,7 +227,7 @@
|
|||||||
android:id="@+id/otherTeamsCard"
|
android:id="@+id/otherTeamsCard"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="4dp"
|
android:layout_marginHorizontal="12dp"
|
||||||
android:layout_marginBottom="16dp"
|
android:layout_marginBottom="16dp"
|
||||||
app:cardCornerRadius="20dp"
|
app:cardCornerRadius="20dp"
|
||||||
app:cardElevation="0dp"
|
app:cardElevation="0dp"
|
||||||
@@ -274,4 +261,5 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
<?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>
|
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
android:text="알람 추가"
|
android:text="알람 추가"
|
||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:textColor="@color/text_primary"
|
android:textColor="@color/black"
|
||||||
android:layout_centerInParent="true"/>
|
android:layout_centerInParent="true"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:cardCornerRadius="24dp"
|
app:cardCornerRadius="24dp"
|
||||||
app:cardElevation="0dp"
|
app:cardElevation="0dp"
|
||||||
app:cardBackgroundColor="@color/surface"
|
app:cardBackgroundColor="@color/white"
|
||||||
android:layout_marginBottom="16dp">
|
android:layout_marginBottom="16dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:cardCornerRadius="24dp"
|
app:cardCornerRadius="24dp"
|
||||||
app:cardElevation="0dp"
|
app:cardElevation="0dp"
|
||||||
app:cardBackgroundColor="@color/surface"
|
app:cardBackgroundColor="@color/white"
|
||||||
android:layout_marginBottom="16dp">
|
android:layout_marginBottom="16dp">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/btnSelectSound"
|
android:id="@+id/btnSelectSound"
|
||||||
@@ -162,7 +162,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:cardCornerRadius="24dp"
|
app:cardCornerRadius="24dp"
|
||||||
app:cardElevation="0dp"
|
app:cardElevation="0dp"
|
||||||
app:cardBackgroundColor="@color/surface"
|
app:cardBackgroundColor="@color/white"
|
||||||
android:layout_marginBottom="16dp">
|
android:layout_marginBottom="16dp">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -56,32 +56,16 @@
|
|||||||
<TextView android:id="@+id/btnYaMat" style="@style/ShiftCircleButton" android:text="야맞" android:textSize="13sp" android:textColor="@color/shift_yamat"/>
|
<TextView android:id="@+id/btnYaMat" style="@style/ShiftCircleButton" android:text="야맞" android:textSize="13sp" android:textColor="@color/shift_yamat"/>
|
||||||
|
|
||||||
<!-- Row 2 -->
|
<!-- Row 2 -->
|
||||||
<TextView android:id="@+id/btnOff" style="@style/ShiftCircleButton" android:text="휴" android:textColor="@color/shift_off"
|
<TextView android:id="@+id/btnOff" style="@style/ShiftCircleButton" android:text="휴" android:textColor="@color/shift_off"/>
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
<TextView android:id="@+id/btnWolcha" style="@style/ShiftCircleButton" android:text="월차" android:textSize="13sp" android:textColor="@color/secondary"/>
|
||||||
app:layout_constraintStart_toStartOf="parent"/>
|
<TextView android:id="@+id/btnYeoncha" style="@style/ShiftCircleButton" android:text="연차" android:textSize="13sp" android:textColor="@color/secondary"/>
|
||||||
<TextView android:id="@+id/btnWolcha" 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"/>
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
<TextView android:id="@+id/btnBannyeon" style="@style/ShiftCircleButton" android:text="반년" android:textSize="13sp" android:textColor="@color/shift_red"/>
|
||||||
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 -->
|
<!-- Row 3 -->
|
||||||
<TextView android:id="@+id/btnEdu" style="@style/ShiftCircleButton" android:text="교육" android:textSize="13sp" android:textColor="@color/primary"
|
<TextView android:id="@+id/btnEdu" style="@style/ShiftCircleButton" android:text="교육" android:textSize="13sp" android:textColor="@color/primary"/>
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
<TextView android:id="@+id/btnReset" style="@style/ShiftCircleButton" android:text="초기" android:textSize="13sp" android:textColor="@color/text_secondary"/>
|
||||||
app:layout_constraintStart_toStartOf="parent"/>
|
<TextView android:id="@+id/btnManual" style="@style/ShiftCircleButton" android:text="직접" android:textSize="14sp" android:textColor="@color/shift_gray"/>
|
||||||
<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
|
<androidx.constraintlayout.helper.widget.Flow
|
||||||
android:id="@+id/gridFlow"
|
android:id="@+id/gridFlow"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
android:text="날짜 이동"
|
android:text="날짜 이동"
|
||||||
android:textSize="24sp"
|
android:textSize="24sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:textColor="@color/text_primary"
|
android:textColor="@color/black"
|
||||||
android:layout_marginBottom="32dp"
|
android:layout_marginBottom="32dp"
|
||||||
android:layout_gravity="center_horizontal"/>
|
android:layout_gravity="center_horizontal"/>
|
||||||
|
|
||||||
|
|||||||
@@ -361,17 +361,5 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</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>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|||||||
@@ -1,135 +1,36 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:fillViewport="true">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="24dp"
|
|
||||||
android:gravity="center_horizontal">
|
|
||||||
|
|
||||||
<!-- Header Title -->
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="나의 연차 설정"
|
|
||||||
android:textSize="20sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:textColor="@color/text_primary"
|
|
||||||
android:layout_marginBottom="32dp"/>
|
|
||||||
|
|
||||||
<!-- 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"
|
|
||||||
app:cardBackgroundColor="@color/surface">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="24dp"
|
android:padding="24dp"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="80dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="80dp"
|
||||||
android:text="총 연차"
|
android:src="@drawable/ic_settings"
|
||||||
android:textSize="16sp"
|
app:tint="@color/text_tertiary"
|
||||||
android:textColor="@color/text_secondary"
|
android:layout_marginBottom="16dp"
|
||||||
android:layout_marginBottom="16dp"/>
|
android:alpha="0.5"/>
|
||||||
|
|
||||||
<!-- NumberPicker for Total Days -->
|
|
||||||
<NumberPicker
|
|
||||||
android:id="@+id/npTotalDays"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="8dp"/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="일"
|
android:text="실험실 기능 준비 중"
|
||||||
android:textSize="14sp"
|
android:textSize="18sp"
|
||||||
android:textColor="@color/text_tertiary"/>
|
|
||||||
|
|
||||||
</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"
|
|
||||||
app:cardBackgroundColor="@color/surface">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="24dp"
|
|
||||||
android:gravity="center">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
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:textStyle="bold"
|
||||||
android:textColor="@color/primary"
|
android:textColor="@color/text_secondary"
|
||||||
android:layout_marginBottom="4dp"/>
|
android:layout_marginBottom="8dp"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="일"
|
android:text="더욱 편리한 기능을 개발하고 있습니다.\n다음 업데이트를 기대해 주세요!"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textColor="@color/text_tertiary"/>
|
|
||||||
|
|
||||||
</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:textColor="@color/text_tertiary"
|
android:textColor="@color/text_tertiary"
|
||||||
android:layout_marginBottom="24dp"
|
android:gravity="center"
|
||||||
android:gravity="center"/>
|
android:lineSpacingExtra="4dp"/>
|
||||||
|
|
||||||
<!-- 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>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/dayRoot"
|
android:id="@+id/dayRoot"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="92dp"
|
||||||
android:minHeight="72dp"
|
|
||||||
android:background="@drawable/bg_grid_cell_v4">
|
android:background="@drawable/bg_grid_cell_v4">
|
||||||
|
|
||||||
<!-- Day Number (top-left) -->
|
<!-- Day Number (top-left) -->
|
||||||
@@ -17,7 +16,7 @@
|
|||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
android:text="12"
|
android:text="12"
|
||||||
android:textColor="@color/text_primary"
|
android:textColor="@color/text_primary"
|
||||||
android:textSize="15sp"
|
android:textSize="14sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -36,21 +35,21 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<!-- Shift Abbreviation Circular Indicator (Center) - Larger size -->
|
<!-- Shift Abbreviation Circular Indicator (Center) -->
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/shiftChar"
|
android:id="@+id/shiftChar"
|
||||||
android:layout_width="48dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="48dp"
|
android:layout_height="40dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="주"
|
android:text="주"
|
||||||
android:textSize="17sp"
|
android:textSize="15sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:textColor="@color/text_primary"
|
android:textColor="@color/text_primary"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="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 -->
|
<!-- Memo Content Text (Below Shift) - Replacing icon logic for visibility -->
|
||||||
<TextView
|
<TextView
|
||||||
|
|||||||
@@ -1,28 +1,3 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Shift Alarm</string>
|
<string name="app_name">shiftring</string>
|
||||||
<string name="team_selection">Team selection</string>
|
|
||||||
<string name="current_shift">Current shift: %1$s</string>
|
|
||||||
<string name="next_shift">Next shift: %1$s</string>
|
|
||||||
<string name="alarm_status">Alarm Status</string>
|
|
||||||
<string name="company_selection">Company selection</string>
|
|
||||||
<string name="tab_basic">Basic Settings</string>
|
|
||||||
<string name="tab_alarm">Alarm Settings</string>
|
|
||||||
<string name="tab_additional">Extras</string>
|
|
||||||
<string name="tab_lab">Leave Management</string>
|
|
||||||
<string-array name="factory_array">
|
|
||||||
<item>Jeonju</item>
|
|
||||||
<item>Nonsan</item>
|
|
||||||
</string-array>
|
|
||||||
<string-array name="team_array">
|
|
||||||
<item>A Team</item>
|
|
||||||
<item>B Team</item>
|
|
||||||
<item>C Team</item>
|
|
||||||
<item>D Team</item>
|
|
||||||
</string-array>
|
|
||||||
<string-array name="theme_array">
|
|
||||||
<item>System Settings</item>
|
|
||||||
<item>Light</item>
|
|
||||||
<item>Dark</item>
|
|
||||||
</string-array>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
14
version.json
14
version.json
@@ -1,7 +1,13 @@
|
|||||||
{
|
{
|
||||||
"versionCode": 1142,
|
"versionCode": 1130,
|
||||||
"versionName": "1.4.2",
|
"versionName": "1.3.0",
|
||||||
"apkUrl": "https://git.webpluss.net/attachments/96025498-3f84-4410-9f13-7cdd559ef60e",
|
"apkUrl": "https://git.webpluss.net/sanjeok77/ShiftRing/releases/download/v1.3.0/app.apk",
|
||||||
"changelog": "v1.4.2: 달력 5행/6행 스크롤 수정, 토스트 다크모드 완전 지원, 연차 설정 UI 개선",
|
"changelog": "v1.3.0: versionCode 기반 업데이트 체크 개선",
|
||||||
|
"forceUpdate": false
|
||||||
|
}
|
||||||
|
"versionCode": 1125,
|
||||||
|
"versionName": "1.2.5",
|
||||||
|
"apkUrl": "https://git.webpluss.net/sanjeok77/ShiftRing/releases/download/v1.2.5/app.apk",
|
||||||
|
"changelog": "v1.2.5: 알람 시스템 단순화 - 삭제된 알람 버그 수정",
|
||||||
"forceUpdate": false
|
"forceUpdate": false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user