Loading app/src/main/java/net/fabiszewski/ulogger/ListWithEditTextPreference.java +5 −4 Original line number Diff line number Diff line Loading @@ -60,12 +60,13 @@ class ListWithEditTextPreference extends ListPreference implements Preference.On } @SuppressWarnings("resource") // Don't use auto-closable, breaks lower APIs private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { setOnPreferenceChangeListener(this); try (TypedArray attributes = context.obtainStyledAttributes(attrs, R.styleable.ListWithEditTextPreference, defStyleAttr, defStyleRes)) { otherSummary = attributes.getText(R.styleable.ListWithEditTextPreference_otherSummary); } TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ListWithEditTextPreference, defStyleAttr, defStyleRes); otherSummary = a.getText(R.styleable.ListWithEditTextPreference_otherSummary); a.recycle(); } Loading app/src/main/java/net/fabiszewski/ulogger/ProviderPreferenceDialogFragment.java +6 −4 Original line number Diff line number Diff line Loading @@ -123,15 +123,17 @@ public class ProviderPreferenceDialogFragment extends ListPreferenceDialogWithMe * Get default layout for single choice dialog * @return Layout resource id */ @SuppressWarnings("resource") @SuppressLint("PrivateResource") // Don't use auto-closable, breaks lower APIs private int getSingleChoiceLayoutResource() { int resId = android.R.layout.select_dialog_singlechoice; final Context context = getContext(); if (context != null) { try (final TypedArray attributes = context.obtainStyledAttributes(null, R.styleable.AlertDialog, R.attr.alertDialogStyle, 0)) { resId = attributes.getResourceId(R.styleable.AlertDialog_singleChoiceItemLayout, resId); } final TypedArray typedArray = context.obtainStyledAttributes(null, R.styleable.AlertDialog, R.attr.alertDialogStyle, 0); resId = typedArray.getResourceId(R.styleable.AlertDialog_singleChoiceItemLayout, resId); typedArray.recycle(); } return resId; } Loading Loading
app/src/main/java/net/fabiszewski/ulogger/ListWithEditTextPreference.java +5 −4 Original line number Diff line number Diff line Loading @@ -60,12 +60,13 @@ class ListWithEditTextPreference extends ListPreference implements Preference.On } @SuppressWarnings("resource") // Don't use auto-closable, breaks lower APIs private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { setOnPreferenceChangeListener(this); try (TypedArray attributes = context.obtainStyledAttributes(attrs, R.styleable.ListWithEditTextPreference, defStyleAttr, defStyleRes)) { otherSummary = attributes.getText(R.styleable.ListWithEditTextPreference_otherSummary); } TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ListWithEditTextPreference, defStyleAttr, defStyleRes); otherSummary = a.getText(R.styleable.ListWithEditTextPreference_otherSummary); a.recycle(); } Loading
app/src/main/java/net/fabiszewski/ulogger/ProviderPreferenceDialogFragment.java +6 −4 Original line number Diff line number Diff line Loading @@ -123,15 +123,17 @@ public class ProviderPreferenceDialogFragment extends ListPreferenceDialogWithMe * Get default layout for single choice dialog * @return Layout resource id */ @SuppressWarnings("resource") @SuppressLint("PrivateResource") // Don't use auto-closable, breaks lower APIs private int getSingleChoiceLayoutResource() { int resId = android.R.layout.select_dialog_singlechoice; final Context context = getContext(); if (context != null) { try (final TypedArray attributes = context.obtainStyledAttributes(null, R.styleable.AlertDialog, R.attr.alertDialogStyle, 0)) { resId = attributes.getResourceId(R.styleable.AlertDialog_singleChoiceItemLayout, resId); } final TypedArray typedArray = context.obtainStyledAttributes(null, R.styleable.AlertDialog, R.attr.alertDialogStyle, 0); resId = typedArray.getResourceId(R.styleable.AlertDialog_singleChoiceItemLayout, resId); typedArray.recycle(); } return resId; } Loading