diff options
author | ByteHamster <info@bytehamster.com> | 2022-04-11 22:14:17 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2022-04-12 21:07:24 +0200 |
commit | 194363df54d1fabdd3118d58481dd6d5fb46cb87 (patch) | |
tree | 32f52b84129924b1e7f7aa66badfc42203a2e527 /app/src/main/java/de/danoeh/antennapod/view | |
parent | 4a91d6f5dea2c050b3713c8fc899d11ce9272dd6 (diff) | |
download | AntennaPod-194363df54d1fabdd3118d58481dd6d5fb46cb87.zip |
Work around Samsung having messed up the TimePicker
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/view')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/view/TimePicker.java | 31 |
1 files changed, 31 insertions, 0 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(); + } + } +} |