diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2022-04-22 20:09:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-22 20:09:47 +0200 |
commit | 1dd6636a6144722282ea88c3f1e213a77ea4172e (patch) | |
tree | 7245fa6255c3bac264d297a178a39416f275e6c5 | |
parent | eb2fea0a4e95eb2c0ebe5b6c585fa9756bdd4580 (diff) | |
parent | 194363df54d1fabdd3118d58481dd6d5fb46cb87 (diff) | |
download | AntennaPod-1dd6636a6144722282ea88c3f1e213a77ea4172e.zip |
Merge pull request #5839 from ByteHamster/samsung-warning
Work around Samsung having messed up the TimePicker
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/view/TimePicker.java | 31 | ||||
-rw-r--r-- | app/src/main/res/layout/feed_refresh_dialog.xml | 5 |
2 files changed, 34 insertions, 2 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/view/TimePicker.java b/app/src/main/java/de/danoeh/antennapod/view/TimePicker.java new file mode 100644 index 000000000..191f72d2e --- /dev/null +++ b/app/src/main/java/de/danoeh/antennapod/view/TimePicker.java @@ -0,0 +1,31 @@ +package de.danoeh.antennapod.view; + +import android.content.Context; +import android.util.AttributeSet; + +/** + * Samsung's Android 6.0.1 has a bug that crashes the app when inflating a time picker. + * This class serves as a workaround for affected devices. + */ +public class TimePicker extends android.widget.TimePicker { + public TimePicker(Context context) { + super(context); + } + + public TimePicker(Context context, AttributeSet attrs) { + super(context, attrs); + } + + public TimePicker(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + @Override + public void onRtlPropertiesChanged(int layoutDirection) { + try { + super.onRtlPropertiesChanged(layoutDirection); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/app/src/main/res/layout/feed_refresh_dialog.xml b/app/src/main/res/layout/feed_refresh_dialog.xml index 02b49a6c6..5a6770a80 100644 --- a/app/src/main/res/layout/feed_refresh_dialog.xml +++ b/app/src/main/res/layout/feed_refresh_dialog.xml @@ -10,7 +10,7 @@ android:id="@+id/intervalRadioButton" android:layout_width="match_parent" android:layout_height="wrap_content" - android:text="@string/feed_refresh_interval"/> + android:text="@string/feed_refresh_interval" /> <Spinner android:id="@+id/spinner" @@ -24,7 +24,7 @@ android:layout_height="wrap_content" android:text="@string/feed_refresh_time" /> - <TimePicker + <de.danoeh.antennapod.view.TimePicker android:id="@+id/timePicker" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -36,4 +36,5 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/feed_refresh_never" /> + </RadioGroup> |