Skip to content

An easy to use android color picker library

License

Notifications You must be signed in to change notification settings

locofocos/ColorPicker

 
 

Repository files navigation

A poor man's fork

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.

How to use this poor man's fork

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!

Option 1, build it

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)

Option 2, copy the binaries into your m2 folder

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:

ColorPicker

An easy to use android color picker library. Based on android-colorpicker.

Android Arsenal Build Status JAR Download

Download

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

Usage

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"/>

ScreenShot

screenshot

About

An easy to use android color picker library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%