Merge pull request #5839 from ByteHamster/samsung-warning

Work around Samsung having messed up the TimePicker
This commit is contained in:
ByteHamster 2022-04-22 20:09:47 +02:00 committed by GitHub
commit 1dd6636a61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 2 deletions

View File

@ -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();
}
}
}

View File

@ -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>