File tree 4 files changed +18
-4
lines changed
src/main/kotlin/com/litekite/widget
4 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 16
16
17
17
// Top-level build file where you can add configuration options common to all sub-projects/modules.
18
18
buildscript {
19
- ext. kotlin_version = " 1.4.10 "
19
+ ext. kotlin_version = " 1.4.21 "
20
20
repositories {
21
21
google()
22
22
jcenter()
23
23
}
24
24
dependencies {
25
- classpath " com.android.tools.build:gradle:4.1.0 "
25
+ classpath " com.android.tools.build:gradle:4.1.1 "
26
26
classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version "
27
27
28
28
// NOTE: Do not place your application dependencies here; they belong
Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
3
3
distributionPath =wrapper/dists
4
4
zipStoreBase =GRADLE_USER_HOME
5
5
zipStorePath =wrapper/dists
6
- distributionUrl =https\://services.gradle.org/distributions/gradle-6.7-all.zip
6
+ distributionUrl =https\://services.gradle.org/distributions/gradle-6.7.1 -all.zip
Original file line number Diff line number Diff line change 17
17
apply plugin : ' com.android.library'
18
18
apply plugin : ' kotlin-android'
19
19
apply plugin : ' kotlin-kapt'
20
- apply plugin : ' kotlin-android-extensions '
20
+ apply plugin : ' kotlin-parcelize '
21
21
22
22
android {
23
23
compileSdkVersion 30
@@ -34,6 +34,10 @@ android {
34
34
main. java. srcDirs + = " src/main/kotlin"
35
35
androidTest. assets. srcDirs + = files(" $projectDir /schemas" . toString())
36
36
}
37
+ buildFeatures {
38
+ viewBinding = true
39
+ dataBinding = true
40
+ }
37
41
compileOptions {
38
42
sourceCompatibility = JavaVersion . VERSION_1_8
39
43
targetCompatibility = JavaVersion . VERSION_1_8
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ class SmoothSeekBar @JvmOverloads constructor(
36
36
) : AppCompatSeekBar(context, attrs, defStyleAttr) {
37
37
38
38
private var callback: OnSeekBarChangeListener ? = null
39
+ private var lastPointerId: Int = 0
39
40
private var lastProgress = 0
40
41
41
42
@SuppressLint(" ClickableViewAccessibility" )
@@ -47,9 +48,18 @@ class SmoothSeekBar @JvmOverloads constructor(
47
48
MotionEvent .ACTION_DOWN -> {
48
49
lastProgress = calculateProgress(event)
49
50
callback?.onStartTrackingTouch(this )
51
+ lastPointerId = event.getPointerId(event.actionIndex)
50
52
}
51
53
MotionEvent .ACTION_MOVE -> {
52
54
isPressed = true
55
+ // Updates last known progress based on the active pointer id
56
+ // in-case of any multi-touch event.
57
+ val currentPointerId = event.getPointerId(event.actionIndex)
58
+ if (lastPointerId != currentPointerId) {
59
+ lastProgress = calculateProgress(event)
60
+ lastPointerId = currentPointerId
61
+ return true
62
+ }
53
63
val newProgress = calculateProgress(event)
54
64
makeProgress(newProgress)
55
65
callback?.onProgressChanged(this , progress, true )
You can’t perform that action at this time.
0 commit comments