Skip to content

Commit

Permalink
Move the "vibrate" checkbox below the ringtone selection
Browse files Browse the repository at this point in the history
- Modify checkbox for bedtime, city selection and ringtone selection;
  • Loading branch information
BlackyHawky committed Apr 5, 2024
1 parent 1df0925 commit 82fae7c
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ private void bindDaysOfWeekButtons(Alarm alarm, Context context) {
}

private void bindVibrator(Alarm alarm) {
if (!mHasVibrator) {
vibrate.setVisibility(View.INVISIBLE);
} else {
if (mHasVibrator) {
vibrate.setVisibility(View.VISIBLE);
vibrate.setChecked(alarm.vibrate);
} else {
vibrate.setVisibility(View.GONE);
}
}

Expand Down
11 changes: 6 additions & 5 deletions app/src/main/res/drawable/ic_radio_button_checked.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<!--
icon available in Android Studio
SPDX-FileCopyrightText: Material Design Authors / Google LLC
modified
SPDX-License-Identifier: Apache-2.0
-->
<vector xmlns:android="https://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="@android:color/white"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM9.29,16.29L5.7,12.7c-0.39,-0.39 -0.39,-1.02 0,-1.41 0.39,-0.39 1.02,-0.39 1.41,0L10,14.17l6.88,-6.88c0.39,-0.39 1.02,-0.39 1.41,0 0.39,0.39 0.39,1.02 0,1.41l-7.59,7.59c-0.38,0.39 -1.02,0.39 -1.41,0z"/>
android:fillColor="@color/md_theme_primary"
android:pathData="M424,552L338,466Q327,455 310,455Q293,455 282,466Q271,477 271,494Q271,511 282,522L396,636Q408,648 424,648Q440,648 452,636L678,410Q689,399 689,382Q689,365 678,354Q667,343 650,343Q633,343 622,354L424,552ZM480,880Q397,880 324,848.5Q251,817 197,763Q143,709 111.5,636Q80,563 80,480Q80,397 111.5,324Q143,251 197,197Q251,143 324,111.5Q397,80 480,80Q563,80 636,111.5Q709,143 763,197Q817,251 848.5,324Q880,397 880,480Q880,563 848.5,636Q817,709 763,763Q709,817 636,848.5Q563,880 480,880Z"/>
</vector>
9 changes: 5 additions & 4 deletions app/src/main/res/drawable/ic_radio_button_unchecked.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<!--
icon available in Android Studio
SPDX-FileCopyrightText: Material Design Authors / Google LLC
modified
SPDX-License-Identifier: Apache-2.0
-->
<vector xmlns:android="https://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="@color/md_theme_onSurfaceVariant"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z" />
android:pathData="M480.07,860Q401.23,860 331.86,830.08Q262.49,800.16 211.18,748.87Q159.87,697.58 129.93,628.24Q100,558.9 100,480.07Q100,401.23 129.92,331.86Q159.84,262.49 211.13,211.18Q262.42,159.87 331.76,129.93Q401.1,100 479.93,100Q558.77,100 628.14,129.92Q697.51,159.84 748.82,211.13Q800.13,262.42 830.07,331.76Q860,401.1 860,479.93Q860,558.77 830.08,628.14Q800.16,697.51 748.87,748.82Q697.58,800.13 628.24,830.07Q558.9,860 480.07,860ZM480,800Q614,800 707,707Q800,614 800,480Q800,346 707,253Q614,160 480,160Q346,160 253,253Q160,346 160,480Q160,614 253,707Q346,800 480,800ZM480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Z" />
</vector>
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/ic_vibrate.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!--
icon available in Android Studio
SPDX-License-Identifier: Apache-2.0
-->
<vector xmlns:android="https://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="@color/md_theme_onSurfaceVariant"
android:pathData="M1,15c0.55,0 1,-0.45 1,-1v-4c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v4c0,0.55 0.45,1 1,1zM4,17c0.55,0 1,-0.45 1,-1L5,8c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v8c0,0.55 0.45,1 1,1zM22,10v4c0,0.55 0.45,1 1,1s1,-0.45 1,-1v-4c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1zM20,17c0.55,0 1,-0.45 1,-1L21,8c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v8c0,0.55 0.45,1 1,1zM16.5,3h-9C6.67,3 6,3.67 6,4.5v15c0,0.83 0.67,1.5 1.5,1.5h9c0.83,0 1.5,-0.67 1.5,-1.5v-15c0,-0.83 -0.67,-1.5 -1.5,-1.5zM16,19L8,19L8,5h8v14z"/>
</vector>
7 changes: 3 additions & 4 deletions app/src/main/res/layout/alarm_time_collapsed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<com.google.android.material.textview.MaterialTextView
android:id="@+id/edit_label"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_marginEnd="8dp"
android:background="?attr/selectableItemBackground"
Expand All @@ -45,9 +45,8 @@
app:drawableStartCompat="@drawable/ic_label"
app:drawableTint="@color/md_theme_onSurfaceVariant"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/arrow"
app:layout_constraintTop_toTopOf="parent"
tools:text="@string/add_label"/>
tools:text="@string/add_label" />

<include
layout="@layout/alarm_time_summary"
Expand All @@ -62,8 +61,8 @@
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/expand_alarm"
android:src="@drawable/ic_caret_down"
android:scaleType="center"
app:srcCompat="@drawable/ic_caret_down"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/edit_label"
app:layout_constraintBottom_toBottomOf="@+id/edit_label" />
Expand Down
38 changes: 16 additions & 22 deletions app/src/main/res/layout/alarm_time_expanded.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<com.google.android.material.textview.MaterialTextView
android:id="@+id/edit_label"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_marginEnd="8dp"
android:background="?attr/selectableItemBackground"
Expand All @@ -45,7 +45,6 @@
app:drawableStartCompat="@drawable/ic_label"
app:drawableTint="@color/md_theme_onSurfaceVariant"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/arrow"
app:layout_constraintTop_toTopOf="parent"
tools:textStyle="bold" />

Expand Down Expand Up @@ -120,20 +119,14 @@
android:orientation="horizontal"
app:layout_constraintTop_toBottomOf="@id/onoff" />

<LinearLayout
android:id="@+id/ringtone_linear_layout"
android:layout_width="match_parent"
android:layout_height="48dp"
app:layout_constraintTop_toBottomOf="@id/repeat_days_alarm">

<com.google.android.material.textview.MaterialTextView
android:id="@+id/choose_ringtone"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginEnd="8dp"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:drawableStart="@drawable/ic_ringtone"
android:drawableTint="@color/md_theme_onSurfaceVariant"
android:drawablePadding="10dp"
android:ellipsize="marquee"
android:focusable="true"
Expand All @@ -142,23 +135,24 @@
android:scrollHorizontally="true"
android:singleLine="true"
android:textColor="?android:attr/textColorPrimary"
app:drawableStartCompat="@drawable/ic_ringtone"
app:drawableTint="@color/md_theme_onSurfaceVariant"
app:layout_constraintTop_toBottomOf="@id/repeat_days_alarm"
tools:text="Standard (Hassium)" />

<com.google.android.material.checkbox.MaterialCheckBox
android:id="@+id/vibrate_onoff"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingStart="8dp"
android:paddingEnd="4dp"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="?selectableItemBackground"
android:button="@null"
android:drawableStart="@drawable/ic_vibrate"
android:drawableEnd="@drawable/ic_selector_checkbox"
android:drawablePadding="10dp"
android:text="@string/alarm_vibrate"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintTop_toBottomOf="@id/choose_ringtone"
tools:ignore="RtlSymmetry"
tools:checked="true" />

</LinearLayout>

<com.google.android.material.chip.Chip
android:id="@+id/delete"
android:layout_width="wrap_content"
Expand All @@ -171,7 +165,7 @@
app:chipBackgroundColor="#EF5350"
app:chipStrokeWidth="0dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ringtone_linear_layout" />
app:layout_constraintBottom_toBottomOf="parent" />

<com.google.android.material.chip.Chip
android:id="@+id/duplicate"
Expand All @@ -185,7 +179,7 @@
app:chipBackgroundColor="@color/md_theme_primary"
app:chipStrokeWidth="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/ringtone_linear_layout" />
app:layout_constraintTop_toBottomOf="@id/vibrate_onoff" />

</androidx.constraintlayout.widget.ConstraintLayout>

Expand Down
10 changes: 6 additions & 4 deletions app/src/main/res/layout/bedtime_bottom_sheet.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
xmlns:android="https://schemas.android.com/apk/res/android"
<androidx.core.widget.NestedScrollView xmlns:android="https://schemas.android.com/apk/res/android"
xmlns:app="https://schemas.android.com/apk/res-auto"
xmlns:tools="https://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_bedtime_bottom_sheet">
Expand Down Expand Up @@ -51,11 +51,13 @@
android:id="@+id/bedtime_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:background="?attr/selectableItemBackground"
android:textSize="36sp"
android:layout_marginStart="10dp"
android:text="?android:attr/textColorPrimary"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/bedtime_label" />
app:layout_constraintTop_toBottomOf="@+id/bedtime_label"
tools:text="23:00" />

<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/toggle_switch_bedtime"
Expand Down
27 changes: 13 additions & 14 deletions app/src/main/res/layout/bedtime_wakeup_bottom_sheet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
android:layout_marginStart="10dp"
android:background="?attr/selectableItemBackground"
android:textSize="36sp"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/wakeup_label"
tools:text="08:30" />
Expand Down Expand Up @@ -90,33 +91,31 @@
android:id="@+id/choose_ringtone_bedtime"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginStart="6dp"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:paddingHorizontal="12dp"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:drawablePadding="16dp"
android:drawableStart="@drawable/ic_ringtone"
android:drawablePadding="10dp"
android:drawableTint="@color/md_theme_onSurfaceVariant"
android:textColor="?android:attr/textColorPrimary"
android:ellipsize="marquee"
android:focusable="true"
android:gravity="start|center_vertical"
android:gravity="center_vertical"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAlignment="viewStart"
app:drawableStartCompat="@drawable/ic_ringtone"
app:drawableTint="@color/md_theme_onSurfaceVariant"
app:layout_constraintTop_toBottomOf="@+id/bedtime_preference_hairline"
tools:text="Standard (Hassium)" />

<com.google.android.material.checkbox.MaterialCheckBox
android:id="@+id/vibrate_onoff_wake"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginStart="10dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:paddingHorizontal="12dp"
android:background="?selectableItemBackground"
android:button="@null"
android:drawableStart="@drawable/ic_vibrate"
android:drawableEnd="@drawable/ic_selector_checkbox"
android:drawablePadding="10dp"
android:text="@string/alarm_vibrate"
android:textSize="16sp"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintTop_toBottomOf="@+id/choose_ringtone_bedtime" />

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/city_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
android:id="@+id/city_onoff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@drawable/ic_selector_checkbox"
android:clickable="false" />

<com.google.android.material.textview.MaterialTextView
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@
<item name="android:dialogCornerRadius" tools:targetApi="p">28dp</item>
<item name="colorBackgroundFloating">@color/md_theme_surface</item>

<item name="checkboxStyle">@style/Widget.CheckBox</item>

<item name="actionBarStyle">@style/ActionBarStyle</item>

<item name="preferenceTheme">@style/AppPreferenceThemeOverlay</item>
Expand Down
8 changes: 0 additions & 8 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@
<item name="android:dialogCornerRadius" tools:targetApi="p">28dp</item>
<item name="colorBackgroundFloating">@color/md_theme_surface</item>

<item name="checkboxStyle">@style/Widget.CheckBox</item>

<item name="actionBarStyle">@style/ActionBarStyle</item>

<item name="preferenceTheme">@style/AppPreferenceThemeOverlay</item>
Expand All @@ -82,12 +80,6 @@
<item name="android:background">@android:color/transparent</item>
</style>

<style name="Widget.CheckBox" parent="@style/Widget.Material3.CompoundButton.CheckBox">
<item name="android:button">@drawable/ic_selector_checkbox</item>
<item name="android:minWidth">48dp</item>
<item name="android:minHeight">48dp</item>
</style>

<style name="TimerSetupDigit" parent="@style/Widget.MaterialComponents.Button">
<item name="shapeAppearance">@style/ShapeAppearanceOverlay.MaterialComponents.FloatingActionButton</item>
<item name="backgroundTint">@color/md_theme_surface</item>
Expand Down

0 comments on commit 82fae7c

Please sign in to comment.