Add ScrollView to sleep timer dialog

This commit is contained in:
peking_ling 2023-11-18 05:51:42 +08:00 committed by GitHub
parent c7d6cd358c
commit 45480f4e2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 137 additions and 131 deletions

View File

@ -1,164 +1,170 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <ScrollView
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
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="wrap_content" android:layout_height="wrap_content">
android:orientation="vertical"
android:gravity="center"
android:padding="16dp">
<LinearLayout <LinearLayout
android:id="@+id/timeSetup"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical"
android:gravity="center"
android:padding="16dp">
<LinearLayout <LinearLayout
android:id="@+id/timeSetup"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="vertical">
<EditText <LinearLayout
android:id="@+id/etxtTime" android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:orientation="horizontal">
android:selectAllOnFocus="true"
android:layout_margin="8dp" <EditText
android:ems="2" android:id="@+id/etxtTime"
android:inputType="number" android:layout_width="0dp"
android:maxLength="3" /> android:layout_height="wrap_content"
android:layout_weight="1"
android:selectAllOnFocus="true"
android:layout_margin="8dp"
android:ems="2"
android:inputType="number"
android:maxLength="3" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/time_minutes"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp" />
</LinearLayout>
<Button
android:id="@+id/setSleeptimerButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/set_sleeptimer_label" />
</LinearLayout>
<LinearLayout
android:id="@+id/timeDisplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="visible">
<TextView <TextView
android:layout_width="wrap_content" android:id="@+id/time"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="00:00:00"
android:layout_gravity="center"
android:gravity="center"
android:textSize="32sp"
android:textColor="?android:attr/textColorPrimary" />
<Button
android:id="@+id/disableSleeptimerButton"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/time_minutes" android:text="@string/disable_sleeptimer_label" />
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp" /> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical">
<Button
android:id="@+id/extendSleepFiveMinutesButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:layout_marginRight="4dp"
android:paddingHorizontal="2dp"
android:paddingVertical="4dp"
android:layout_weight="1"
style="?attr/materialButtonOutlinedStyle"
tools:text="+5 min" />
<Button
android:id="@+id/extendSleepTenMinutesButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:paddingHorizontal="2dp"
android:paddingVertical="4dp"
android:layout_weight="1"
style="?attr/materialButtonOutlinedStyle"
tools:text="+10 min" />
<Button
android:id="@+id/extendSleepTwentyMinutesButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginRight="4dp"
android:layout_marginLeft="4dp"
android:paddingHorizontal="2dp"
android:paddingVertical="4dp"
android:layout_weight="1"
style="?attr/materialButtonOutlinedStyle"
tools:text="+20 min" />
</LinearLayout>
</LinearLayout> </LinearLayout>
<Button
android:id="@+id/setSleeptimerButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/set_sleeptimer_label" />
</LinearLayout>
<LinearLayout
android:id="@+id/timeDisplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="visible">
<TextView
android:id="@+id/time"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="00:00:00"
android:layout_gravity="center"
android:gravity="center"
android:textSize="32sp"
android:textColor="?android:attr/textColorPrimary" />
<Button
android:id="@+id/disableSleeptimerButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/disable_sleeptimer_label" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="vertical"
android:gravity="center_vertical"> android:layout_marginTop="8dp">
<Button
android:id="@+id/extendSleepFiveMinutesButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:layout_marginRight="4dp"
android:paddingHorizontal="2dp"
android:paddingVertical="4dp"
android:layout_weight="1"
style="?attr/materialButtonOutlinedStyle"
tools:text="+5 min" />
<Button
android:id="@+id/extendSleepTenMinutesButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:paddingHorizontal="2dp"
android:paddingVertical="4dp"
android:layout_weight="1"
style="?attr/materialButtonOutlinedStyle"
tools:text="+10 min" />
<Button
android:id="@+id/extendSleepTwentyMinutesButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginRight="4dp"
android:layout_marginLeft="4dp"
android:paddingHorizontal="2dp"
android:paddingVertical="4dp"
android:layout_weight="1"
style="?attr/materialButtonOutlinedStyle"
tools:text="+20 min" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="8dp">
<CheckBox
android:id="@+id/cbShakeToReset"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/shake_to_reset_label" />
<CheckBox
android:id="@+id/cbVibrate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/timer_vibration_label" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1">
<CheckBox <CheckBox
android:id="@+id/chAutoEnable" android:id="@+id/cbShakeToReset"
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:text="@string/shake_to_reset_label" />
android:text="@string/auto_enable_label" />
<ImageView <CheckBox
android:id="@+id/changeTimesButton" android:id="@+id/cbVibrate"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:contentDescription="@string/auto_enable_change_times" android:text="@string/timer_vibration_label" />
android:background="?attr/selectableItemBackgroundBorderless"
app:srcCompat="@drawable/ic_settings" /> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1">
<CheckBox
android:id="@+id/chAutoEnable"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/auto_enable_label" />
<ImageView
android:id="@+id/changeTimesButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:contentDescription="@string/auto_enable_change_times"
android:background="?attr/selectableItemBackgroundBorderless"
app:srcCompat="@drawable/ic_settings" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </ScrollView>