diff --git a/app/src/main/java/be/ugent/zeus/hydra/common/ui/widgets/TimePreference.java b/app/src/main/java/be/ugent/zeus/hydra/common/ui/widgets/TimePreference.java index fb1eb001a..1c7c8f89a 100644 --- a/app/src/main/java/be/ugent/zeus/hydra/common/ui/widgets/TimePreference.java +++ b/app/src/main/java/be/ugent/zeus/hydra/common/ui/widgets/TimePreference.java @@ -33,9 +33,6 @@ import java.time.LocalTime; -import be.ugent.zeus.hydra.R; -import be.ugent.zeus.hydra.common.utils.ViewUtils; - /** * Custom dialog to select a time in the preferences. *

@@ -48,36 +45,28 @@ * @author Niko Strijbol * @see Based on this library * @see LocalTime#toString() The exact documentation on how the value is saved. + * @noinspection unused */ -@SuppressWarnings({"WeakerAccess"}) public class TimePreference extends DialogPreference { public TimePreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); - - TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TimePreference, defStyleAttr, defStyleRes); - - if (ViewUtils.getBoolean(a, R.styleable.TimePreference_useDefaultSummary, - R.styleable.TimePreference_useDefaultSummary, false)) { - setSummaryProvider(new TimeSummaryProvider()); - } - - a.recycle(); + setSummaryProvider(new TimeSummaryProvider()); } public TimePreference(Context context, AttributeSet attrs, int defStyleAttr) { - this(context, attrs, defStyleAttr, 0); + super(context, attrs, defStyleAttr); + setSummaryProvider(new TimeSummaryProvider()); } public TimePreference(Context context, AttributeSet attrs) { - this(context, attrs, ViewUtils.getAttr(context, - androidx.preference.R.attr.dialogPreferenceStyle, - android.R.attr.dialogPreferenceStyle)); + super(context, attrs); + setSummaryProvider(new TimeSummaryProvider()); } - @SuppressWarnings({"unused", "RedundantSuppression"}) public TimePreference(Context context) { - this(context, null); + super(context); + setSummaryProvider(new TimeSummaryProvider()); } @Nullable diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 4d3476d5d..1b5cb5c4f 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -43,10 +43,6 @@ - - - -