File tree Expand file tree Collapse file tree 9 files changed +17
-22
lines changed
java/com/smarttoolfactory/slider Expand file tree Collapse file tree 9 files changed +17
-22
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ android {
4343 excludes + = ' /META-INF/{AL2.0,LGPL2.1}'
4444 }
4545 }
46+ namespace ' com.smarttoolfactory.composematerialslider'
4647}
4748
4849dependencies {
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
2- <manifest xmlns : android =" http://schemas.android.com/apk/res/android"
3- package =" com.smarttoolfactory.composematerialslider" >
2+ <manifest xmlns : android =" http://schemas.android.com/apk/res/android" >
43
54 <application
65 android : allowBackup =" true"
1211 <activity
1312 android : name =" .MainActivity"
1413 android : exported =" true"
15- android : label =" @string/app_name"
1614 android : theme =" @style/Theme.ComposeMaterialSlider" >
1715 <intent-filter >
1816 <action android : name =" android.intent.action.MAIN" />
Original file line number Diff line number Diff line change 11buildscript {
22 ext {
3- compose_version = ' 1.2.0-alpha07 '
3+ compose_version = ' 1.2.0-beta02 '
44 }
55}// Top-level build file where you can add configuration options common to all sub-projects/modules.
66plugins {
7- id ' com.android.application' version ' 7.1.3 ' apply false
8- id ' com.android.library' version ' 7.1.3 ' apply false
9- id ' org.jetbrains.kotlin.android' version ' 1.6.10 ' apply false
7+ id ' com.android.application' version ' 7.2.0 ' apply false
8+ id ' com.android.library' version ' 7.2.0 ' apply false
9+ id ' org.jetbrains.kotlin.android' version ' 1.6.21 ' apply false
1010}
1111
1212task clean (type : Delete ) {
Original file line number Diff line number Diff line change 11# Mon Mar 14 14:21:27 TRT 2022
22distributionBase =GRADLE_USER_HOME
3- distributionUrl =https\://services.gradle.org/distributions/gradle-7.2 -bin.zip
3+ distributionUrl =https\://services.gradle.org/distributions/gradle-7.3.3 -bin.zip
44distributionPath =wrapper/dists
55zipStorePath =wrapper/dists
66zipStoreBase =GRADLE_USER_HOME
Original file line number Diff line number Diff line change @@ -39,13 +39,14 @@ android {
3939 excludes + = ' /META-INF/{AL2.0,LGPL2.1}'
4040 }
4141 }
42+ namespace ' com.smarttoolfactory.slider'
4243}
4344
4445dependencies {
4546
4647 implementation ' androidx.core:core-ktx:1.7.0'
4748
48- implementation ' com.github.SmartToolFactory:Compose-Extended-Gestures:1.0 .0'
49+ implementation ' com.github.SmartToolFactory:Compose-Extended-Gestures:1.2 .0'
4950
5051 // Jetpack Compose
5152 implementation " androidx.compose.ui:ui:$compose_version "
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
2- <manifest xmlns : android =" http://schemas.android.com/apk/res/android"
3- package =" com.smarttoolfactory.slider" >
2+ <manifest >
43
54</manifest >
Original file line number Diff line number Diff line change @@ -14,8 +14,6 @@ import androidx.compose.ui.geometry.Offset
1414import androidx.compose.ui.geometry.Size
1515import androidx.compose.ui.graphics.*
1616import androidx.compose.ui.graphics.drawscope.Stroke
17- import androidx.compose.ui.input.pointer.consumeDownChange
18- import androidx.compose.ui.input.pointer.consumePositionChange
1917import androidx.compose.ui.layout.Placeable
2018import androidx.compose.ui.layout.SubcomposeLayout
2119import androidx.compose.ui.platform.LocalDensity
@@ -200,7 +198,7 @@ fun ColorfulIconSlider(
200198 scaleToUserValue(offsetInTrack),
201199 Offset (rawOffset.value.coerceIn(trackStart, trackEnd), strokeRadius)
202200 )
203- it.consumeDownChange ()
201+ it.consume ()
204202 }
205203 },
206204 onMove = {
@@ -211,14 +209,14 @@ fun ColorfulIconSlider(
211209 scaleToUserValue(offsetInTrack),
212210 Offset (rawOffset.value.coerceIn(trackStart, trackEnd), strokeRadius)
213211 )
214- it.consumePositionChange ()
212+ it.consume ()
215213 }
216214
217215 },
218216 onUp = {
219217 if (enabled) {
220218 onValueChangeFinished?.invoke()
221- it.consumeDownChange ()
219+ it.consume ()
222220 }
223221 }
224222 )
Original file line number Diff line number Diff line change @@ -15,8 +15,6 @@ import androidx.compose.ui.geometry.Size
1515import androidx.compose.ui.geometry.lerp
1616import androidx.compose.ui.graphics.*
1717import androidx.compose.ui.graphics.drawscope.Stroke
18- import androidx.compose.ui.input.pointer.consumeDownChange
19- import androidx.compose.ui.input.pointer.consumePositionChange
2018import androidx.compose.ui.platform.LocalDensity
2119import androidx.compose.ui.platform.LocalLayoutDirection
2220import androidx.compose.ui.unit.Dp
@@ -224,7 +222,7 @@ fun ColorfulSlider(
224222 scaleToUserValue(offsetInTrack),
225223 Offset (rawOffset.value.coerceIn(trackStart, trackEnd), strokeRadius)
226224 )
227- it.consumeDownChange ()
225+ it.consume ()
228226 }
229227 },
230228 onMove = {
@@ -235,14 +233,14 @@ fun ColorfulSlider(
235233 scaleToUserValue(offsetInTrack),
236234 Offset (rawOffset.value.coerceIn(trackStart, trackEnd), strokeRadius)
237235 )
238- it.consumePositionChange ()
236+ it.consume ()
239237 }
240238
241239 },
242240 onUp = {
243241 if (enabled) {
244242 onValueChangeFinished?.invoke()
245- it.consumeDownChange ()
243+ it.consume ()
246244 }
247245 }
248246 )
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ package com.smarttoolfactory.slider
88 * @param amount e closed unit interval [0, 1]
99 */
1010internal fun lerp (start : Float , end : Float , amount : Float ): Float {
11- return (1 - amount) * start + amount * ( end - start)
11+ return (1 - amount) * start + amount * end
1212}
1313
1414/* *
You can’t perform that action at this time.
0 commit comments