A fork of xdtianyu/ColorPicker (a possibly abandoned library) that allows it to build against newer version of Android build tools.
"poor man's", because this was the bare minimum required to get it to compile. A public function name might have changed in the ctrl-F process.
This will be required for every system where you want to build your project that consumes this library. Someone please feel free to publish this on maven central!
Run:
git clone [email protected]:locofocos/ColorPicker.git
cd ColorPicker
./gradlew clean
./gradlew build -x lintVitalRelease -x lint
./gradlew install
./gradlew publishToMavenLocal
# or some combinations of commands like that, until you see the new version appear in your .m2 folder
# go to .m2/repository/org/xdty/preference/color-picker
# if you see an "unspecified" version instead of 0.0.7,
# replace all instances of "unspecified" with 0.0.7 (file contents and filenames).
# (yes I hate doing this. Someone please fix this library, I can't get the build configured)
Forget spending hours coercing gradle and Android Studio to let you build this every time you need to update your app which consumes this on a new laptop. Just copy m2-contents
into your .m2 folder (possibly .m2/repository
) and be done with it.
Then in the project where you consume it, add mavenLocal() as a repository in 2 places. See https://stackoverflow.com/a/39015691. Like so:
buildscript {
repositories {
mavenLocal()
...
}
}
allprojects {
repositories {
mavenLocal()
...
}
}
Bump the version from 0.0.5 (or whatever you're using) to 0.0.7 (this fork's version). Then compile your project and enjoy.
Original readme below:
An easy to use android color picker library. Based on android-colorpicker.
Grab via gradle
dependencies {
compile 'org.xdty.preference:color-picker:0.0.5'
}
or maven
<dependency>
<groupId>org.xdty.preference</groupId>
<artifactId>color-picker</artifactId>
<version>0.0.5</version>
<type>aar</type>
</dependency>
or JAR from maven central
For more details, see example
<org.xdty.preference.ColorPreference
android:key="example_color"
android:title="Color"
android:summary="This is a color preference"
tools:dialogTitle="@string/default_color"
tools:colors="@array/default_rainbow"
tools:columns="5"
tools:material="true"
tools:backwardsOrder="true"
tools:customStrokeWidth="0"
tools:strokeColor="@android:color/black"
android:defaultValue="@color/flamingo"/>