1
0
Fork 0

For #4530 Reduce build warnings (#4531)

master
Nikit Bhandari 2019-08-05 21:40:57 +05:30 committed by Colin Lee
parent d0071d0177
commit 8aecc2b850
1 changed files with 19 additions and 19 deletions

View File

@ -110,7 +110,7 @@ class TextPercentageSeekBarPreference @JvmOverloads constructor(
* set to true; it transfers the key presses to the [SeekBar] * set to true; it transfers the key presses to the [SeekBar]
* to be handled accordingly. * to be handled accordingly.
*/ */
private val mSeekBarKeyListener = View.OnKeyListener { v, keyCode, event -> private val mSeekBarKeyListener = View.OnKeyListener { _, keyCode, event ->
if (event.action != KeyEvent.ACTION_DOWN) { if (event.action != KeyEvent.ACTION_DOWN) {
return@OnKeyListener false return@OnKeyListener false
} }
@ -142,12 +142,12 @@ class TextPercentageSeekBarPreference @JvmOverloads constructor(
var min: Int var min: Int
get() = mMin get() = mMin
set(min) { set(min) {
var min = min var minimum = min
if (min > mMax) { if (minimum > mMax) {
min = mMax minimum = mMax
} }
if (min != mMin) { if (minimum != mMin) {
mMin = min mMin = minimum
notifyChanged() notifyChanged()
} }
} }
@ -181,12 +181,12 @@ class TextPercentageSeekBarPreference @JvmOverloads constructor(
var max: Int var max: Int
get() = mMax get() = mMax
set(max) { set(max) {
var max = max var maximum = max
if (max < mMin) { if (maximum < mMin) {
max = mMin maximum = mMin
} }
if (max != mMax) { if (maximum != mMax) {
mMax = max mMax = maximum
notifyChanged() notifyChanged()
} }
} }
@ -272,8 +272,8 @@ class TextPercentageSeekBarPreference @JvmOverloads constructor(
mSeekBar?.isEnabled = isEnabled mSeekBar?.isEnabled = isEnabled
} }
override fun onSetInitialValue(defaultValue: Any?) { override fun onSetInitialValue(initialValue: Any?) {
var defaultValue = defaultValue var defaultValue = initialValue
if (defaultValue == null) { if (defaultValue == null) {
defaultValue = 0 defaultValue = 0
} }
@ -284,8 +284,8 @@ class TextPercentageSeekBarPreference @JvmOverloads constructor(
return a!!.getInt(index, 0) return a!!.getInt(index, 0)
} }
private fun setValueInternal(seekBarValue: Int, notifyChanged: Boolean) { private fun setValueInternal(value: Int, notifyChanged: Boolean) {
var seekBarValue = seekBarValue var seekBarValue = value
if (seekBarValue < mMin) { if (seekBarValue < mMin) {
seekBarValue = mMin seekBarValue = mMin
} }
@ -326,8 +326,8 @@ class TextPercentageSeekBarPreference @JvmOverloads constructor(
* *
* @param value the value to display next to the [SeekBar] * @param value the value to display next to the [SeekBar]
*/ */
internal /* synthetic access */ fun updateLabelValue(value: Int) { internal /* synthetic access */ fun updateLabelValue(labelValue: Int) {
var value = value var value = labelValue
if (mSeekBarValueTextView != null) { if (mSeekBarValueTextView != null) {
value = value * STEP_SIZE + MIN_VALUE value = value * STEP_SIZE + MIN_VALUE
val decimalValue = (value / DECIMAL_CONVERSION).toDouble() val decimalValue = (value / DECIMAL_CONVERSION).toDouble()
@ -341,8 +341,8 @@ class TextPercentageSeekBarPreference @JvmOverloads constructor(
* *
* @param value the value of text size * @param value the value of text size
*/ */
internal /* synthetic access */ fun updateExampleTextValue(value: Int) { internal /* synthetic access */ fun updateExampleTextValue(textValue: Int) {
var value = value var value = textValue
if (mExampleTextTextView != null) { if (mExampleTextTextView != null) {
value = value * STEP_SIZE + MIN_VALUE value = value * STEP_SIZE + MIN_VALUE
val decimal = value / DECIMAL_CONVERSION val decimal = value / DECIMAL_CONVERSION