File tree Expand file tree Collapse file tree 13 files changed +31
-42
lines changed
java/com/smarttoolfactory/composecolorpicker
java/com/smarttoolfactory/colorpicker Expand file tree Collapse file tree 13 files changed +31
-42
lines changed Original file line number Diff line number Diff line change @@ -43,14 +43,15 @@ android {
4343 excludes + = ' /META-INF/{AL2.0,LGPL2.1}'
4444 }
4545 }
46+ namespace ' com.smarttoolfactory.composecolorpicker'
4647}
4748
4849dependencies {
4950
5051 implementation project(' :colorpicker' )
5152
52- implementation ' com.github.SmartToolFactory:Compose-Colorful-Sliders:1.0.1 '
53- implementation ' com.github.SmartToolFactory:Compose-Extended-Gestures:1.0 .0'
53+ implementation ' com.github.SmartToolFactory:Compose-Colorful-Sliders:1.0.2 '
54+ implementation ' com.github.SmartToolFactory:Compose-Extended-Gestures:1.2 .0'
5455 implementation ' com.github.SmartToolFactory:Compose-Extended-Colors:1.0.0-alpha07'
5556
5657 // Jetpack Compose
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.composecolorpicker" >
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.ComposeColorPicker" >
1715 <intent-filter >
1816 <action android : name =" android.intent.action.MAIN" />
Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ class MainActivity : ComponentActivity() {
4040}
4141
4242@ExperimentalPagerApi
43- @OptIn(ExperimentalAnimationApi ::class )
4443@Composable
4544private fun HomeContent () {
4645
@@ -82,7 +81,7 @@ private fun HomeContent() {
8281 2 -> GradientSelectionDemo ()
8382 3 -> HexConversionDemo ()
8483 4 -> SaturationSelectorDemo ()
85- 5 -> HSVHSLGradientDemo ()
84+ 5 -> HSVHSLGradientDemo ()
8685 else -> ColorfulSliderDemo ()
8786 }
8887 }
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 @@ -39,16 +39,18 @@ android {
3939 excludes + = ' /META-INF/{AL2.0,LGPL2.1}'
4040 }
4141 }
42+ namespace ' com.smarttoolfactory.colorpicker'
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-Colorful-Sliders:1.0.1'
50- implementation ' com.github.SmartToolFactory:Compose-Screenshot:1.0.0'
49+ implementation ' com.github.SmartToolFactory:Compose-Extended-Gestures:1.2.0'
5150 implementation ' com.github.SmartToolFactory:Compose-Extended-Colors:1.0.0-alpha07'
51+ implementation ' com.github.SmartToolFactory:Compose-Screenshot:1.0.3'
52+ implementation ' com.github.SmartToolFactory:Compose-Color-Detector:1.0.0'
53+ implementation ' com.github.SmartToolFactory:Compose-Colorful-Sliders:1.0.2'
5254
5355 // Jetpack Compose
5456 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.colorpicker" >
2+ <manifest >
43
54</manifest >
Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ import androidx.compose.ui.Modifier
88import androidx.compose.ui.geometry.Offset
99import androidx.compose.ui.graphics.Brush
1010import androidx.compose.ui.graphics.Color
11- import androidx.compose.ui.input.pointer.consumeDownChange
12- import androidx.compose.ui.input.pointer.consumePositionChange
1311import androidx.compose.ui.platform.LocalDensity
1412import androidx.compose.ui.unit.Dp
1513import com.smarttoolfactory.colorpicker.ui.gradientColorScaleHSVReversed
@@ -80,7 +78,7 @@ fun SelectorCircleHueSaturationHSV(
8078 val hueChange = calculateAngleFomLocalCoordinates(center, position)
8179 val saturationChange = (distance / radius).coerceIn(0f , 1f )
8280 onChange(hueChange, saturationChange)
83- it.consumeDownChange ()
81+ it.consume ()
8482 }
8583
8684 },
@@ -94,13 +92,13 @@ fun SelectorCircleHueSaturationHSV(
9492
9593 val saturationChange = (distance / radius).coerceIn(0f , 1f )
9694 onChange(hueChange, saturationChange)
97- it.consumePositionChange ()
95+ it.consume ()
9896 }
9997
10098 },
10199 onUp = {
102100 if (isTouched) {
103- it.consumeDownChange ()
101+ it.consume ()
104102 }
105103 isTouched = false
106104
Original file line number Diff line number Diff line change @@ -15,8 +15,6 @@ import androidx.compose.ui.graphics.BlendMode
1515import androidx.compose.ui.graphics.Brush
1616import androidx.compose.ui.graphics.Color
1717import androidx.compose.ui.graphics.Path
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.unit.Dp
2220import androidx.compose.ui.unit.LayoutDirection
@@ -249,7 +247,7 @@ private fun SelectorDiamond(
249247 // lightness increases while going up but android drawing system is opposite
250248 onChange(posXInPercent, 1 - posYInPercent)
251249 }
252- it.consumeDownChange ()
250+ it.consume ()
253251
254252 },
255253 onMove = {
@@ -266,11 +264,11 @@ private fun SelectorDiamond(
266264 // lightness increases while going up but android drawing system is opposite
267265 onChange(posXInPercent, 1 - posYInPercent)
268266 }
269- it.consumePositionChange ()
267+ it.consume ()
270268 },
271269 onUp = {
272270 isTouched = false
273- it.consumeDownChange ()
271+ it.consume ()
274272 }
275273 )
276274
Original file line number Diff line number Diff line change @@ -7,8 +7,6 @@ import androidx.compose.runtime.*
77import androidx.compose.ui.Modifier
88import androidx.compose.ui.geometry.Offset
99import androidx.compose.ui.graphics.Brush
10- import androidx.compose.ui.input.pointer.consumeDownChange
11- import androidx.compose.ui.input.pointer.consumePositionChange
1210import androidx.compose.ui.platform.LocalDensity
1311import androidx.compose.ui.unit.Dp
1412import com.smarttoolfactory.colorpicker.ui.brush.transparentToBlackVerticalGradient
@@ -256,7 +254,7 @@ private fun SelectorRect(
256254 (1 - (position.y / height)).coerceIn(0f , 1f )
257255 }
258256 onChange(hueChange, propertyChange)
259- it.consumeDownChange ()
257+ it.consume ()
260258
261259 },
262260 onMove = {
@@ -268,7 +266,7 @@ private fun SelectorRect(
268266 (1 - (position.y / height)).coerceIn(0f , 1f )
269267 }
270268 onChange(hueChange, propertyChange)
271- it.consumePositionChange ()
269+ it.consume ()
272270 },
273271 delayAfterDownInMillis = 20
274272 )
Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ import androidx.compose.ui.Modifier
88import androidx.compose.ui.geometry.Offset
99import androidx.compose.ui.graphics.BlendMode
1010import androidx.compose.ui.graphics.Brush
11- import androidx.compose.ui.input.pointer.consumeDownChange
12- import androidx.compose.ui.input.pointer.consumePositionChange
1311import androidx.compose.ui.platform.LocalDensity
1412import androidx.compose.ui.unit.Dp
1513import com.smarttoolfactory.colorpicker.model.ColorModel
@@ -139,15 +137,15 @@ private fun SelectorRect(
139137 val saturationChange = (position.x / width).coerceIn(0f , 1f )
140138 val valueChange = (1 - (position.y / height)).coerceIn(0f , 1f )
141139 onChange(saturationChange, valueChange)
142- it.consumeDownChange ()
140+ it.consume ()
143141
144142 },
145143 onMove = {
146144 val position = it.position
147145 val saturationChange = (position.x / width).coerceIn(0f , 1f )
148146 val valueChange = (1 - (position.y / height)).coerceIn(0f , 1f )
149147 onChange(saturationChange, valueChange)
150- it.consumePositionChange ()
148+ it.consume ()
151149 },
152150 delayAfterDownInMillis = 20
153151 )
You can’t perform that action at this time.
0 commit comments