jamfish/app/src/main/res/layout/dialog_sleep_timer.xml
Peng Guanwen 2111c41836 Finish current music when Sleep Timer stops (#629)
Implement #329.
This commit adds a CheckBox to dialog_sleep_timer, and a curresponding
option `TIMER_FINISH_MUSIC` in PreferenceUtil.

In MusicService, a new flag `pendingQuit` is to indicate if it should
stop after current music stops. A new action `ACTION_PENDING_QUIT` will
set that flag.

Canceling is a little tricky. I must bind MusicService in Dialog
activity to check if `pendingQuit` is set, and show the corresponding
canceling button.
2019-01-07 21:45:33 -05:00

43 lines
1.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:seekarc="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<com.triggertrap.seekarc.SeekArc
android:id="@+id/seek_arc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="30dp"
seekarc:SeekArc_clockwise="false"
seekarc:SeekArc_max="120"
seekarc:SeekArc_progressColor="?colorAccent"
seekarc:SeekArc_rotation="180"
seekarc:SeekArc_startAngle="30"
seekarc:SeekArc_sweepAngle="300" />
<TextView
android:id="@+id/timer_display"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textAppearance="?android:textAppearanceLarge" />
</FrameLayout>
<com.kabouzeid.appthemehelper.common.views.ATECheckBox
android:id="@+id/should_finish_last_song"
android:layout_width="wrap_content"
android:layout_height="42dp"
android:layout_gravity="bottom"
android:layout_margin="20dp"
android:text="@string/finish_current_music_sleep_timer" />
</LinearLayout>