For #15640: Remove private resources from TextPercentageSeekBarPref.

upstream-sync
mcarare 4 years ago committed by Mihai Adrian Carare
parent 0a6808d0bc
commit fa08afbc03

@ -229,19 +229,19 @@ class TextPercentageSeekBarPreference @JvmOverloads constructor(
init {
val a = context.obtainStyledAttributes(
attrs, R.styleable.SeekBarPreference, defStyleAttr, defStyleRes
attrs, R.styleable.TextPercentageSeekBarPreference, defStyleAttr, defStyleRes
)
// The ordering of these two statements are important. If we want to set max first, we need
// to perform the same steps by changing min/max to max/min as following:
// mMax = a.getInt(...) and setMin(...).
mMin = a.getInt(R.styleable.SeekBarPreference_min, 0)
max = a.getInt(R.styleable.SeekBarPreference_android_max, SEEK_BAR_MAX)
seekBarIncrement = a.getInt(R.styleable.SeekBarPreference_seekBarIncrement, 0)
isAdjustable = a.getBoolean(R.styleable.SeekBarPreference_adjustable, true)
mShowSeekBarValue = a.getBoolean(R.styleable.SeekBarPreference_showSeekBarValue, false)
mMin = a.getInt(R.styleable.TextPercentageSeekBarPreference_min, 0)
max = a.getInt(R.styleable.TextPercentageSeekBarPreference_android_max, SEEK_BAR_MAX)
seekBarIncrement = a.getInt(R.styleable.TextPercentageSeekBarPreference_seekBarIncrement, 0)
isAdjustable = a.getBoolean(R.styleable.TextPercentageSeekBarPreference_adjustable, true)
mShowSeekBarValue = a.getBoolean(R.styleable.TextPercentageSeekBarPreference_showSeekBarValue, false)
updatesContinuously = a.getBoolean(
R.styleable.SeekBarPreference_updatesContinuously,
R.styleable.TextPercentageSeekBarPreference_updatesContinuously,
false
)
a.recycle()

@ -93,4 +93,14 @@
</declare-styleable>
<attr name="selectLoginHeaderTextColor" format="reference"/>
<declare-styleable name="TextPercentageSeekBarPreference">
<attr format="integer" name="min"/>
<attr name="android:max"/>
<attr name="android:layout"/>
<attr format="integer" name="seekBarIncrement"/>
<attr format="boolean" name="adjustable"/>
<attr format="boolean" name="showSeekBarValue"/>
<attr format="boolean" name="updatesContinuously"/>
</declare-styleable>
</resources>

Loading…
Cancel
Save