Skip to content

Commit 648b040

Browse files
authored
Merge pull request #184 from side-codes/develop
Release v0.6.1
2 parents 3686760 + e51c092 commit 648b040

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+388
-306
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
Gradle dependency:
2222

2323
```gradle
24-
implementation "codes.side:andcolorpicker:0.5.0"
24+
implementation "codes.side:andcolorpicker:0.6.1"
2525
```
2626

2727
## :art: Picker types

andcolorpicker/build.gradle

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
plugins {
2-
id "com.github.ben-manes.versions" version "0.35.0"
2+
id "com.github.ben-manes.versions" version "0.38.0"
33
}
44

55
apply plugin: "com.android.library"
66
apply plugin: "kotlin-android"
77
apply plugin: "kotlin-android-extensions"
8-
apply plugin: "com.novoda.bintray-release"
8+
9+
ext {
10+
PUBLISH_GROUP_ID = "codes.side"
11+
PUBLISH_VERSION = "0.6.1"
12+
PUBLISH_ARTIFACT_ID = "andcolorpicker"
13+
}
14+
15+
apply from: "${rootProject.projectDir}/scripts/publish-mavencentral.gradle"
916

1017
android {
1118
compileSdkVersion 30
@@ -14,8 +21,8 @@ android {
1421
defaultConfig {
1522
minSdkVersion 19
1623
targetSdkVersion 30
17-
versionCode 1
18-
versionName "1.0"
24+
versionCode 7
25+
versionName "0.6.1"
1926

2027
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2128
consumerProguardFiles "consumer-rules.pro"
@@ -35,24 +42,11 @@ dependencies {
3542
implementation fileTree(dir: "libs", include: ["*.jar"])
3643
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
3744

38-
implementation "androidx.appcompat:appcompat:1.3.0-alpha02"
39-
implementation "androidx.core:core-ktx:1.5.0-alpha04"
45+
implementation "androidx.appcompat:appcompat:1.3.0-rc01"
46+
implementation "androidx.core:core-ktx:1.6.0-alpha02"
4047
implementation "androidx.constraintlayout:constraintlayout:2.0.4"
4148

42-
testImplementation "junit:junit:4.13.1"
49+
testImplementation "junit:junit:4.13.2"
4350
androidTestImplementation "androidx.test.ext:junit:1.1.2"
4451
androidTestImplementation "androidx.test.espresso:espresso-core:3.3.0"
4552
}
46-
47-
publish {
48-
def groupProjectID = "codes.side"
49-
def artifactProjectID = "andcolorpicker"
50-
def publishVersionID = "0.5.0"
51-
userOrg = "side-codes"
52-
repoName = "andColorPicker"
53-
groupId = groupProjectID
54-
artifactId = artifactProjectID
55-
publishVersion = publishVersionID
56-
desc = "Handy, flexible and lightning-fast material color picker view components for Android"
57-
website = "https://github.com/side-codes/andColorPicker"
58-
}

andcolorpicker/src/main/java/codes/side/andcolorpicker/alpha/AlphaColorPickerSeekBar.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ abstract class AlphaColorPickerSeekBar<C : Color> @JvmOverloads constructor(
2121
colorFactory: ColorFactory<C>,
2222
context: Context,
2323
attrs: AttributeSet? = null,
24-
defStyle: Int = androidx.appcompat.R.attr.seekBarStyle
24+
defStyle: Int = R.attr.seekBarStyle
2525
) :
2626
ColorSeekBar<C>(
2727
colorFactory,
2828
context,
2929
attrs,
3030
defStyle
3131
) {
32+
3233
// TODO: Handle rounded corners
3334
override fun onSetupProgressDrawableLayers(layers: Array<Drawable>): Array<Drawable> {
3435
val layerList = layers.toMutableList()

andcolorpicker/src/main/java/codes/side/andcolorpicker/alpha/HSLAlphaColorPickerSeekBar.kt

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ package codes.side.andcolorpicker.alpha
22

33
import android.content.Context
44
import android.util.AttributeSet
5+
import codes.side.andcolorpicker.R
56
import codes.side.andcolorpicker.converter.IntegerHSLColorConverter
67
import codes.side.andcolorpicker.model.IntegerHSLColor
78
import codes.side.andcolorpicker.model.factory.HSLColorFactory
8-
import codes.side.andcolorpicker.view.picker.ColorSeekBar
99

1010
// TODO: Add modes support
1111
class HSLAlphaColorPickerSeekBar @JvmOverloads constructor(
1212
context: Context,
1313
attrs: AttributeSet? = null,
14-
defStyle: Int = androidx.appcompat.R.attr.seekBarStyle
14+
defStyle: Int = R.attr.seekBarStyle
1515
) :
1616
AlphaColorPickerSeekBar<IntegerHSLColor>(
1717
HSLColorFactory(),
@@ -45,7 +45,7 @@ class HSLAlphaColorPickerSeekBar @JvmOverloads constructor(
4545
max = IntegerHSLColor.Component.A.maxValue
4646
}
4747

48-
override fun onRefreshProgressFromColor(color: IntegerHSLColor): Int? {
48+
override fun onRefreshProgressFromColor(color: IntegerHSLColor): Int {
4949
return color.intA
5050
}
5151

@@ -58,35 +58,4 @@ class HSLAlphaColorPickerSeekBar @JvmOverloads constructor(
5858
false
5959
}
6060
}
61-
62-
interface OnColorPickListener :
63-
ColorSeekBar.OnColorPickListener<HSLAlphaColorPickerSeekBar, IntegerHSLColor>
64-
65-
open class DefaultOnColorPickListener : OnColorPickListener {
66-
override fun onColorPicking(
67-
picker: HSLAlphaColorPickerSeekBar,
68-
color: IntegerHSLColor,
69-
value: Int,
70-
fromUser: Boolean
71-
) {
72-
73-
}
74-
75-
override fun onColorPicked(
76-
picker: HSLAlphaColorPickerSeekBar,
77-
color: IntegerHSLColor,
78-
value: Int,
79-
fromUser: Boolean
80-
) {
81-
82-
}
83-
84-
override fun onColorChanged(
85-
picker: HSLAlphaColorPickerSeekBar,
86-
color: IntegerHSLColor,
87-
value: Int
88-
) {
89-
90-
}
91-
}
9261
}

andcolorpicker/src/main/java/codes/side/andcolorpicker/cmyk/CMYKColorPickerSeekBar.kt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,14 @@ import codes.side.andcolorpicker.view.picker.GradientColorSeekBar
1717
class CMYKColorPickerSeekBar @JvmOverloads constructor(
1818
context: Context,
1919
attrs: AttributeSet? = null,
20-
defStyle: Int = androidx.appcompat.R.attr.seekBarStyle
20+
defStyle: Int = R.attr.seekBarStyle
2121
) :
2222
GradientColorSeekBar<IntegerCMYKColor>(
2323
CMYKColorFactory(),
2424
context,
2525
attrs,
2626
defStyle
2727
) {
28-
companion object {
29-
private const val TAG = "CMYKColorPickerSeekBar"
30-
31-
private val DEFAULT_MODE = Mode.MODE_C
32-
private val DEFAULT_COLORING_MODE = ColoringMode.PURE_COLOR
33-
34-
// TODO: Make configurable
35-
private const val COERCE_AT_LEAST_COMPONENT = 15
36-
}
3728

3829
override val colorConverter: IntegerCMYKColorConverter
3930
get() = super.colorConverter as IntegerCMYKColorConverter
@@ -324,4 +315,12 @@ class CMYKColorPickerSeekBar @JvmOverloads constructor(
324315
)
325316
),
326317
}
318+
319+
companion object {
320+
private val DEFAULT_MODE = Mode.MODE_C
321+
private val DEFAULT_COLORING_MODE = ColoringMode.PURE_COLOR
322+
323+
// TODO: Make configurable
324+
private const val COERCE_AT_LEAST_COMPONENT = 15
325+
}
327326
}

andcolorpicker/src/main/java/codes/side/andcolorpicker/converter/ColorConverter.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import androidx.annotation.ColorInt
44
import codes.side.andcolorpicker.model.Color
55

66
interface ColorConverter {
7+
78
@ColorInt
89
fun convertToOpaqueColorInt(color: Color): Int
910

andcolorpicker/src/main/java/codes/side/andcolorpicker/converter/ColorConverterHub.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package codes.side.andcolorpicker.converter
33
import codes.side.andcolorpicker.model.ColorKey
44

55
object ColorConverterHub {
6+
67
private val map = hashMapOf<ColorKey, ColorConverter>()
78

89
init {

andcolorpicker/src/main/java/codes/side/andcolorpicker/converter/IntegerCMYKColorConverter.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import codes.side.andcolorpicker.model.Color
44
import codes.side.andcolorpicker.model.IntegerCMYKColor
55

66
class IntegerCMYKColorConverter : ColorConverter {
7+
78
override fun convertToOpaqueColorInt(color: Color): Int {
89
TODO("Not yet implemented")
910
}

andcolorpicker/src/main/java/codes/side/andcolorpicker/converter/IntegerHSLColorConverter.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import codes.side.andcolorpicker.model.IntegerHSLColor
77

88
// Should it be generic?
99
class IntegerHSLColorConverter : ColorConverter {
10+
1011
private val convertToColorIntHSLCache = FloatArray(3)
12+
1113
override fun convertToOpaqueColorInt(color: Color): Int {
1214
require(color is IntegerHSLColor) { "Unsupported color type supplied" }
1315

andcolorpicker/src/main/java/codes/side/andcolorpicker/converter/IntegerLABColorConverter.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import codes.side.andcolorpicker.model.Color
55
import codes.side.andcolorpicker.model.IntegerLABColor
66

77
class IntegerLABColorConverter : ColorConverter {
8+
89
override fun convertToOpaqueColorInt(color: Color): Int {
910
TODO("Not yet implemented")
1011
}

0 commit comments

Comments
 (0)