Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8a2dacb104 | |||
| 2f4b2ebe4c | |||
| 89068b4d05 | |||
| 7835d0ab65 |
@@ -20,8 +20,8 @@ android {
|
|||||||
applicationId = "com.example.shiftalarm"
|
applicationId = "com.example.shiftalarm"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 1141
|
versionCode = 1142
|
||||||
versionName = "1.4.1"
|
versionName = "1.4.2"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,27 @@ fun showCustomToast(context: Context, message: String, duration: Int = android.w
|
|||||||
val toast = android.widget.Toast(context)
|
val toast = android.widget.Toast(context)
|
||||||
toast.duration = duration
|
toast.duration = duration
|
||||||
toast.view = layout
|
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.setGravity(android.view.Gravity.BOTTOM or android.view.Gravity.CENTER_HORIZONTAL, 0, 100)
|
||||||
toast.show()
|
toast.show()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
|||||||
@@ -52,15 +52,10 @@ class CalendarAdapter(
|
|||||||
val item = days[position]
|
val item = days[position]
|
||||||
val context = holder.itemView.context
|
val context = holder.itemView.context
|
||||||
|
|
||||||
// Dynamically adjust item height based on row count (5 or 6 rows)
|
// Fixed item height - square cells based on screen width
|
||||||
val displayMetrics = context.resources.displayMetrics
|
val displayMetrics = context.resources.displayMetrics
|
||||||
val screenWidth = displayMetrics.widthPixels
|
val screenWidth = displayMetrics.widthPixels
|
||||||
val itemWidth = screenWidth / 7 // Each cell width
|
val itemHeight = screenWidth / 7
|
||||||
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
|
val layoutParams = holder.itemView.layoutParams
|
||||||
layoutParams.height = itemHeight
|
layoutParams.height = itemHeight
|
||||||
@@ -74,7 +69,6 @@ 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
|
||||||
|
|||||||
@@ -320,7 +320,22 @@ class MainActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}, binding.cbShowHolidays.isChecked, rowCount)
|
}, binding.cbShowHolidays.isChecked, rowCount)
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
<solid android:color="@color/surface" />
|
<!-- 배경색: 다크모드에서도 잘 보이도록 surface 색상 사용 -->
|
||||||
<corners android:radius="12dp" />
|
<solid android:color="#CC333333" />
|
||||||
|
<corners android:radius="16dp" />
|
||||||
<stroke
|
<stroke
|
||||||
android:width="1dp"
|
android:width="1dp"
|
||||||
android:color="@color/outline" />
|
android:color="@color/outline" />
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:background="@drawable/bg_custom_toast"
|
android:background="@drawable/bg_custom_toast"
|
||||||
android:paddingHorizontal="16dp"
|
android:paddingHorizontal="20dp"
|
||||||
android:paddingVertical="10dp"
|
android:paddingVertical="12dp"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textColor="@color/text_primary"
|
android:textColor="@android:color/white"
|
||||||
android:maxLines="2"
|
android:maxLines="2"
|
||||||
android:ellipsize="end" />
|
android:ellipsize="end" />
|
||||||
|
|
||||||
|
|||||||
@@ -1,128 +1,135 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView 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:orientation="vertical"
|
android:fillViewport="true">
|
||||||
android:padding="24dp"
|
|
||||||
android:gravity="center_horizontal">
|
|
||||||
|
|
||||||
<!-- Header Title -->
|
<LinearLayout
|
||||||
<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_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="24dp"
|
android:orientation="vertical"
|
||||||
app:cardCornerRadius="16dp"
|
android:padding="24dp"
|
||||||
app:cardElevation="4dp"
|
android:gravity="center_horizontal">
|
||||||
app:cardBackgroundColor="@color/surface">
|
|
||||||
|
|
||||||
<LinearLayout
|
<!-- 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_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:layout_marginBottom="24dp"
|
||||||
android:padding="24dp"
|
app:cardCornerRadius="16dp"
|
||||||
android:gravity="center">
|
app:cardElevation="4dp"
|
||||||
|
app:cardBackgroundColor="@color/surface">
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="총 연차"
|
android:orientation="vertical"
|
||||||
android:textSize="16sp"
|
android:padding="24dp"
|
||||||
android:textColor="@color/text_secondary"
|
android:gravity="center">
|
||||||
android:layout_marginBottom="16dp"/>
|
|
||||||
|
|
||||||
<!-- NumberPicker for Total Days -->
|
<TextView
|
||||||
<NumberPicker
|
android:layout_width="wrap_content"
|
||||||
android:id="@+id/npTotalDays"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:text="총 연차"
|
||||||
android:layout_height="wrap_content"
|
android:textSize="16sp"
|
||||||
android:layout_marginBottom="8dp"/>
|
android:textColor="@color/text_secondary"
|
||||||
|
android:layout_marginBottom="16dp"/>
|
||||||
|
|
||||||
<TextView
|
<!-- NumberPicker for Total Days -->
|
||||||
android:layout_width="wrap_content"
|
<NumberPicker
|
||||||
android:layout_height="wrap_content"
|
android:id="@+id/npTotalDays"
|
||||||
android:text="일"
|
android:layout_width="wrap_content"
|
||||||
android:textSize="14sp"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@color/text_tertiary"/>
|
android:layout_marginBottom="8dp"/>
|
||||||
|
|
||||||
</LinearLayout>
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="일"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textColor="@color/text_tertiary"/>
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- Remaining Annual Leave Display -->
|
</androidx.cardview.widget.CardView>
|
||||||
<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
|
<!-- Remaining Annual Leave Display -->
|
||||||
|
<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:orientation="vertical"
|
android:layout_marginBottom="32dp"
|
||||||
android:padding="24dp"
|
app:cardCornerRadius="16dp"
|
||||||
android:gravity="center">
|
app:cardElevation="4dp"
|
||||||
|
app:cardBackgroundColor="@color/surface">
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="남은 연차"
|
android:orientation="vertical"
|
||||||
android:textSize="16sp"
|
android:padding="24dp"
|
||||||
android:textColor="@color/text_secondary"
|
android:gravity="center">
|
||||||
android:layout_marginBottom="8dp"/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvRemainingDays"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:text="남은 연차"
|
||||||
android:text="0.0"
|
android:textSize="16sp"
|
||||||
android:textSize="36sp"
|
android:textColor="@color/text_secondary"
|
||||||
android:textStyle="bold"
|
android:layout_marginBottom="8dp"/>
|
||||||
android:textColor="@color/primary"
|
|
||||||
android:layout_marginBottom="4dp"/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/tvRemainingDays"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:text="일"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="14sp"
|
android:text="0.0"
|
||||||
android:textColor="@color/text_tertiary"/>
|
android:textSize="36sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="@color/primary"
|
||||||
|
android:layout_marginBottom="4dp"/>
|
||||||
|
|
||||||
</LinearLayout>
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="일"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textColor="@color/text_tertiary"/>
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- Calculation Info -->
|
</androidx.cardview.widget.CardView>
|
||||||
<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:layout_marginBottom="24dp"
|
|
||||||
android:gravity="center"/>
|
|
||||||
|
|
||||||
<!-- Save Button -->
|
<!-- Calculation Info -->
|
||||||
<com.google.android.material.button.MaterialButton
|
<TextView
|
||||||
android:id="@+id/btnSaveAnnualLeave"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="56dp"
|
android:text="※ 연차: -1일 차감 / 반년: -0.5일 차감"
|
||||||
android:text="저장"
|
android:textSize="13sp"
|
||||||
android:textSize="16sp"
|
android:textColor="@color/text_tertiary"
|
||||||
android:textStyle="bold"
|
android:layout_marginBottom="24dp"
|
||||||
app:cornerRadius="12dp"
|
android:gravity="center"/>
|
||||||
android:backgroundTint="@color/primary"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
<!-- 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>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
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="85dp"
|
android:layout_height="wrap_content"
|
||||||
|
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) -->
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"versionCode": 1141,
|
"versionCode": 1142,
|
||||||
"versionName": "1.4.1",
|
"versionName": "1.4.2",
|
||||||
"apkUrl": "https://git.webpluss.net/attachments/23f6818f-a647-4f9e-905f-e99f5c9d93b0",
|
"apkUrl": "https://git.webpluss.net/attachments/96025498-3f84-4410-9f13-7cdd559ef60e",
|
||||||
"changelog": "v1.4.1: 달력 5행일 때 화면 꽉 채우기, 다크모드 토스트 지원, 연차 저장/연동 수정",
|
"changelog": "v1.4.2: 달력 5행/6행 스크롤 수정, 토스트 다크모드 완전 지원, 연차 설정 UI 개선",
|
||||||
"forceUpdate": false
|
"forceUpdate": false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user