Perubahan UI

This commit is contained in:
RafiFattan23 2025-12-31 19:41:36 +07:00
parent 44ac435853
commit cc895ca0d5
28 changed files with 220 additions and 226 deletions

6
.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

View File

@ -159,19 +159,51 @@ class AlarmRingActivity : AppCompatActivity() {
private fun snoozeAlarm() {
snoozeCount++
// Schedule snooze (typically 5 minutes)
val snoozeIntent = android.content.Intent(this, AlarmService::class.java).apply {
putExtras(intent)
// Save statistics with snooze count
val stats = Statistics(
id = statisticsId,
alarmId = alarmId,
triggeredAt = triggeredTime,
stoppedAt = null, // Not stopped yet, just snoozed
snoozedCount = snoozeCount,
stopMethod = "snooze"
)
lifecycleScope.launch {
try {
if (statisticsId > 0) {
statisticsViewModel.updateStatistics(stats)
} else {
statisticsId = statisticsViewModel.saveStatistics(stats) as? Long ?: 0L
}
} catch (e: Exception) {
e.printStackTrace()
}
}
// Stop current alarm service
stopService(android.content.Intent(this, AlarmService::class.java))
// Reschedule for 5 minutes later
lifecycleScope.launch {
delay(5 * 60 * 1000) // 5 minutes
startForegroundService(snoozeIntent)
// Schedule snooze alarm for 5 minutes later
val handler = android.os.Handler(android.os.Looper.getMainLooper())
handler.postDelayed({
val snoozeIntent = android.content.Intent(applicationContext, AlarmService::class.java).apply {
putExtra("ALARM_ID", alarmId)
putExtra("ALARM_LABEL", intent.getStringExtra("ALARM_LABEL") ?: "Alarm")
putExtra("SHAKE_TO_STOP", shakeToStop)
putExtra("SHAKE_INTENSITY", shakeIntensity)
putExtra("GRADUAL_MODE", intent.getBooleanExtra("GRADUAL_MODE", false))
putExtra("VIBRATE", intent.getBooleanExtra("VIBRATE", true))
putExtra("RINGTONE_URI", intent.getStringExtra("RINGTONE_URI"))
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
startForegroundService(snoozeIntent)
} else {
startService(snoozeIntent)
}
}, 5 * 60 * 1000) // 5 minutes
finish()
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#B2DFDB"/>
<corners android:radius="8dp"/>
</shape>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFE0B2"/>
<corners android:radius="8dp"/>
</shape>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#424242"/>
<corners android:radius="12dp"/>
<stroke
android:width="2dp"
android:color="?attr/colorPrimary"/>
</shape>

View File

@ -1,170 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
<vector
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z"/>
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
</vector>

View File

@ -62,9 +62,12 @@
android:id="@+id/btnDismiss"
android:layout_width="0dp"
android:layout_height="64dp"
android:text="Dismiss"
android:text="DISMISS"
android:textSize="18sp"
android:textColor="@android:color/white"
app:cornerRadius="32dp"
app:strokeColor="@android:color/white"
app:strokeWidth="2dp"
app:layout_constraintBottom_toTopOf="@id/btnSnooze"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@ -74,8 +77,11 @@
android:id="@+id/btnSnooze"
android:layout_width="0dp"
android:layout_height="64dp"
android:text="Snooze"
android:text="SNOOZE"
android:textSize="18sp"
android:textColor="@android:color/white"
app:strokeColor="@android:color/white"
app:strokeWidth="2dp"
app:cornerRadius="32dp"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
app:layout_constraintBottom_toBottomOf="parent"
@ -83,3 +89,4 @@
app:layout_constraintEnd_toEndOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -109,9 +109,11 @@
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp"
android:background="@drawable/bg_badge"
android:background="@drawable/bg_shake_settings"
android:visibility="gone"
android:layout_marginTop="8dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintTop_toBottomOf="@id/switchShakeToStop">
<TextView
@ -119,13 +121,17 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Intensity: 3"
android:textSize="14sp"/>
android:textSize="14sp"
android:textColor="@android:color/white"
android:textStyle="bold"/>
<SeekBar
android:id="@+id/seekBarShakeIntensity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"/>
android:layout_marginTop="8dp"
android:progressTint="?attr/colorPrimary"
android:thumbTint="?attr/colorPrimary"/>
</LinearLayout>

View File

@ -18,7 +18,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="08:00"
android:textSize="48sp"
android:textSize="42sp"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
@ -27,7 +27,8 @@
android:id="@+id/switchEnabled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toTopOf="@id/tvTime"
app:layout_constraintBottom_toBottomOf="@id/tvTime"
app:layout_constraintEnd_toEndOf="parent"/>
<TextView
@ -35,8 +36,10 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Wake Up"
android:textSize="16sp"
android:layout_marginTop="8dp"
android:textSize="14sp"
android:layout_marginTop="4dp"
android:singleLine="true"
android:ellipsize="end"
app:layout_constraintTop_toBottomOf="@id/tvTime"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/btnDelete"/>
@ -46,24 +49,33 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Mon, Tue, Wed, Thu, Fri"
android:textSize="14sp"
android:textSize="12sp"
android:textColor="?android:attr/textColorSecondary"
android:layout_marginTop="4dp"
android:layout_marginTop="2dp"
android:singleLine="true"
android:ellipsize="end"
app:layout_constraintTop_toBottomOf="@id/tvLabel"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/btnDelete"/>
<TextView
android:id="@+id/tvTimeUntil"
<LinearLayout
android:id="@+id/layoutBadges"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="in 8 hr 30 min"
android:textSize="12sp"
android:textColor="?attr/colorPrimary"
android:layout_marginTop="4dp"
android:orientation="horizontal"
android:layout_marginTop="6dp"
app:layout_constraintTop_toBottomOf="@id/tvRepeatDays"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/badgeShake"/>
app:layout_constraintEnd_toStartOf="@id/btnDelete">
<TextView
android:id="@+id/tvTimeUntil"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="in 8 hr 30 min"
android:textSize="11sp"
android:textColor="?attr/colorPrimary"
android:textStyle="bold"/>
<TextView
android:id="@+id/badgeShake"
@ -71,13 +83,13 @@
android:layout_height="wrap_content"
android:text="🤚 Shake"
android:textSize="10sp"
android:padding="4dp"
android:background="@drawable/bg_badge"
android:layout_marginTop="4dp"
android:paddingStart="6dp"
android:paddingEnd="6dp"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:background="@drawable/bg_badge_shake"
android:layout_marginStart="8dp"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/tvRepeatDays"
app:layout_constraintStart_toEndOf="@id/tvTimeUntil"/>
android:visibility="gone"/>
<TextView
android:id="@+id/badgeGradual"
@ -85,17 +97,20 @@
android:layout_height="wrap_content"
android:text="📈 Gradual"
android:textSize="10sp"
android:padding="4dp"
android:background="@drawable/bg_badge"
android:paddingStart="6dp"
android:paddingEnd="6dp"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:background="@drawable/bg_badge_gradual"
android:layout_marginStart="4dp"
android:visibility="gone"
app:layout_constraintTop_toTopOf="@id/badgeShake"
app:layout_constraintStart_toEndOf="@id/badgeShake"/>
android:visibility="gone"/>
</LinearLayout>
<ImageButton
android:id="@+id/btnDelete"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@android:drawable/ic_menu_delete"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="Delete"

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 982 B

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -9,4 +9,12 @@
<color name="white">#FFFFFFFF</color>
<color name="blue_500">#FF2196F3</color>
<color name="blue_700">#FF1976D2</color>
<!-- Badge colors -->
<color name="badge_shake">#FFE0B2</color>
<color name="badge_gradual">#B2DFDB</color>
<!-- Background colors -->
<color name="bg_shake_settings">#424242</color>
<color name="bg_shake_border">#2196F3</color>
</resources>