summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2023-10-22 15:09:07 +0200
committerGitHub <noreply@github.com>2023-10-22 15:09:07 +0200
commit69be89881a7ceb7938209a532859050ff96bb257 (patch)
tree0e5101b4ead1dd252ea50668dee74ba686c23722 /app/src/main
parent0b7403e1ddd9d1ef2910d4ffabfb377fe3b11b3c (diff)
downloadAntennaPod-69be89881a7ceb7938209a532859050ff96bb257.zip
Make 'change times' button a settings icon (#6721)
Users didn't scroll down to find the button. Now it is next to the checkbox, so it is harder to overlook.
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java5
-rw-r--r--app/src/main/res/layout/time_dialog.xml30
2 files changed, 24 insertions, 11 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java
index 8314382cb..67eb74fbc 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java
@@ -10,6 +10,7 @@ import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
+import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
@@ -110,12 +111,13 @@ public class SleepTimerDialog extends DialogFragment {
final CheckBox cbShakeToReset = content.findViewById(R.id.cbShakeToReset);
final CheckBox cbVibrate = content.findViewById(R.id.cbVibrate);
chAutoEnable = content.findViewById(R.id.chAutoEnable);
- final TextView changeTimesButton = content.findViewById(R.id.changeTimes);
+ final ImageView changeTimesButton = content.findViewById(R.id.changeTimesButton);
cbShakeToReset.setChecked(SleepTimerPreferences.shakeToReset());
cbVibrate.setChecked(SleepTimerPreferences.vibrate());
chAutoEnable.setChecked(SleepTimerPreferences.autoEnable());
changeTimesButton.setEnabled(chAutoEnable.isChecked());
+ changeTimesButton.setAlpha(chAutoEnable.isChecked() ? 1.0f : 0.5f);
cbShakeToReset.setOnCheckedChangeListener((buttonView, isChecked)
-> SleepTimerPreferences.setShakeToReset(isChecked));
@@ -125,6 +127,7 @@ public class SleepTimerDialog extends DialogFragment {
-> {
SleepTimerPreferences.setAutoEnable(isChecked);
changeTimesButton.setEnabled(isChecked);
+ changeTimesButton.setAlpha(isChecked ? 1.0f : 0.5f);
});
updateAutoEnableText();
diff --git a/app/src/main/res/layout/time_dialog.xml b/app/src/main/res/layout/time_dialog.xml
index 1a8f02c7c..263ac0c9c 100644
--- a/app/src/main/res/layout/time_dialog.xml
+++ b/app/src/main/res/layout/time_dialog.xml
@@ -2,6 +2,7 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
@@ -135,19 +136,28 @@
android:layout_height="wrap_content"
android:text="@string/timer_vibration_label" />
- <CheckBox
- android:id="@+id/chAutoEnable"
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/auto_enable_label" />
+ android:orientation="horizontal"
+ android:weightSum="1">
- <Button
- android:id="@+id/changeTimes"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/auto_enable_change_times"
- android:layout_gravity="center"
- style="@style/Widget.MaterialComponents.Button.TextButton" />
+ <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>