From d540934915da26ab2cec4c897e973be35e0bfe24 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 9 Sep 2018 11:59:24 -0400 Subject: Clean up kotterknife (#161) * Remove bindview implementations internally * Remove more bindView calls * Make config private in ElasticRecyclerActivity * Fix recyclerview * Update adapter * Improve swipe destroy and add direction to swipe finish --- .../allanwang/kau/colorpicker/ColorPickerView.kt | 45 +++++++++++++--------- 1 file changed, 27 insertions(+), 18 deletions(-) (limited to 'colorpicker/src') diff --git a/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerView.kt b/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerView.kt index dfb0773..b9cea99 100644 --- a/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerView.kt +++ b/colorpicker/src/main/kotlin/ca/allanwang/kau/colorpicker/ColorPickerView.kt @@ -56,30 +56,39 @@ internal class ColorPickerView @JvmOverloads constructor( } } - private val gridView: FillGridView by bindView(R.id.md_grid) - private val customFrame: LinearLayout by bindView(R.id.md_colorChooserCustomFrame) - private val customColorIndicator: View by bindView(R.id.md_colorIndicator) - private val hexInput: EditText by bindView(R.id.md_hexInput) - private val alphaLabel: TextView by bindView(R.id.md_colorALabel) - private val alphaSeekbar: SeekBar by bindView(R.id.md_colorA) - private val alphaValue: TextView by bindView(R.id.md_colorAValue) - private val redSeekbar: SeekBar by bindView(R.id.md_colorR) - private val redValue: TextView by bindView(R.id.md_colorRValue) - private val greenSeekbar: SeekBar by bindView(R.id.md_colorG) - private val greenValue: TextView by bindView(R.id.md_colorGValue) - private val blueSeekbar: SeekBar by bindView(R.id.md_colorB) - private val blueValue: TextView by bindView(R.id.md_colorBValue) + private val gridView: FillGridView + private val customFrame: LinearLayout + private val customColorIndicator: View + private val hexInput: EditText + private val alphaLabel: TextView + private val alphaSeekbar: SeekBar + private val alphaValue: TextView + private val redSeekbar: SeekBar + private val redValue: TextView + private val greenSeekbar: SeekBar + private val greenValue: TextView + private val blueSeekbar: SeekBar + private val blueValue: TextView private var customHexTextWatcher: TextWatcher? = null private var customRgbListener: SeekBar.OnSeekBarChangeListener? = null init { - init() - } - - @SuppressLint("PrivateResource") - private fun init() { + //noinspection PrivateResource View.inflate(context, R.layout.md_dialog_colorchooser, this) + gridView = findViewById(R.id.md_grid) + customFrame = findViewById(R.id.md_colorChooserCustomFrame) + customColorIndicator = findViewById(R.id.md_colorIndicator) + hexInput = findViewById(R.id.md_hexInput) + alphaLabel = findViewById(R.id.md_colorALabel) + alphaSeekbar = findViewById(R.id.md_colorA) + alphaValue = findViewById(R.id.md_colorAValue) + redSeekbar = findViewById(R.id.md_colorR) + redValue = findViewById(R.id.md_colorRValue) + greenSeekbar = findViewById(R.id.md_colorG) + greenValue = findViewById(R.id.md_colorGValue) + blueSeekbar = findViewById(R.id.md_colorB) + blueValue = findViewById(R.id.md_colorBValue) } fun bind(builder: ColorContract, dialog: MaterialDialog) { -- cgit v1.2.3