Work around Samsung having messed up the TimePicker

This commit is contained in:
ByteHamster 2022-04-11 22:14:17 +02:00
parent 4a91d6f5de
commit 194363df54
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:id="@+id/intervalRadioButton"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/feed_refresh_interval"/> android:text="@string/feed_refresh_interval" />
<Spinner <Spinner
android:id="@+id/spinner" android:id="@+id/spinner"
@ -24,7 +24,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/feed_refresh_time" /> android:text="@string/feed_refresh_time" />
<TimePicker <de.danoeh.antennapod.view.TimePicker
android:id="@+id/timePicker" android:id="@+id/timePicker"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -36,4 +36,5 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/feed_refresh_never" /> android:text="@string/feed_refresh_never" />
</RadioGroup> </RadioGroup>