Last active
May 2, 2020 17:12
-
-
Save o4oren/50628e00d04f57029ad3377794e4e154 to your computer and use it in GitHub Desktop.
Rotary knob constructor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class RotaryKnobView @JvmOverloads constructor( | |
| context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 | |
| ) : RelativeLayout(context, attrs, defStyleAttr), GestureDetector.OnGestureListener { | |
| private val gestureDetector: GestureDetectorCompat | |
| private var maxValue = 99 | |
| private var minValue = 0 | |
| var listener: RotaryKnobListener? = null | |
| var value = 50 | |
| private var knobDrawable: Drawable? = null | |
| private var divider = 300f / (maxValue - minValue) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment