All Projects → fennifith → WearColorPicker

fennifith / WearColorPicker

Licence: Apache-2.0 license
A lightweight color picker library for Android Wear.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to WearColorPicker

AndroidWearTutorialForChinese
AndroidWearTutorialForChinese By JialeDai
Stars: ✭ 15 (-34.78%)
Mutual labels:  android-wear
ColorPicker
A HSV style Color Picker Dialog library for Android (with Alpha setting)
Stars: ✭ 16 (-30.43%)
Mutual labels:  color-picker
eye drop
Eye Drop is a set of bottles containing a digital liquid made of shiny particles. Eye Drop uses a Huawei smartwatch and a lens from Google Cardboard to give an impression of immersive screen.
Stars: ✭ 19 (-17.39%)
Mutual labels:  android-wear
andColorPicker
Color picker library for Android
Stars: ✭ 233 (+913.04%)
Mutual labels:  color-picker
react-native-color-panel
React Native Color Panel Component for iOS and Android 🏳️‍🌈
Stars: ✭ 21 (-8.7%)
Mutual labels:  color-picker
Cheesebaron.ColorPickers
Sample library with ports of different Color Picker implementations.
Stars: ✭ 14 (-39.13%)
Mutual labels:  color-picker
Powertoys
Microsoft PowerToys is a set of utilities for power users to tune and streamline their Windows experience for greater productivity. For more info on PowerToys overviews and how to use the utilities, or any other tools and resources for Windows development environments, head over to docs.microsoft.com!
Stars: ✭ 65,024 (+282613.04%)
Mutual labels:  color-picker
RAScrollablePickerView
Lightweight HSB color picker view.
Stars: ✭ 39 (+69.57%)
Mutual labels:  color-picker
meazure
Screen magnification, measurement, capture and color sampling for Windows.
Stars: ✭ 55 (+139.13%)
Mutual labels:  color-picker
vscode-color
Helper with GUI to generate color codes such as CSS color notations.
Stars: ✭ 88 (+282.61%)
Mutual labels:  color-picker
vue-uix
Vue components based on the JUI components available in Vue.js
Stars: ✭ 15 (-34.78%)
Mutual labels:  color-picker
react-native-image-color-picker
Image color picker based on image source provided and return image different color palettes or average color palette
Stars: ✭ 25 (+8.7%)
Mutual labels:  color-picker
colr pickr
Colr Pickr, a vanilla JavaScript color picker component built with SVGs, with features like saving colors. Similar design to the chrome-dev-tools color picker.
Stars: ✭ 27 (+17.39%)
Mutual labels:  color-picker
RandomKolor
🎨 A tiny (Kotlin) library for generating attractive colors
Stars: ✭ 46 (+100%)
Mutual labels:  color-picker
PDColorPicker
🎨 A simple, fast color picker for iOS apps.
Stars: ✭ 30 (+30.43%)
Mutual labels:  color-picker
ColorPickerLib
A WPF/MVVM implementation of a themeable color picker control.
Stars: ✭ 44 (+91.3%)
Mutual labels:  color-picker
SwiftColorWheel
Delightful color picker wheel for iOS in Swift.
Stars: ✭ 37 (+60.87%)
Mutual labels:  color-picker
reinvented-color-wheel
A vanilla-js touch-friendly HSV color picker inspired by Farbtastic Color Picker.
Stars: ✭ 43 (+86.96%)
Mutual labels:  color-picker
pikko
Color picker for iOS made with ❤️
Stars: ✭ 34 (+47.83%)
Mutual labels:  color-picker
color-picker
Implementation of an HSV color picker
Stars: ✭ 23 (+0%)
Mutual labels:  color-picker

WearColorPicker is lightweight color picker library for Android Wear.

Screenshots

Square Watch Round Watch
img img

Usage

Setup

The Gradle dependency is available through jCenter, which is used by default in Android Studio. To add the module to your project, copy this line into the dependencies section of your Android Wear module's build.gradle file.

compile 'james.wearcolorpicker:wearcolorpicker:0.0.1'

Please note that this library can only be used on Android Wear devices; it will not function inside a regular Android app.

Opening the Color Picker

To open the Color Picker Activity, you need to call 'startActivityForResult' like below.

startActivityForResult(new Intent(this, WearColorPickerActivity.class), requestCode);

In this snippet, requestCode is a unique integer greater than or equal to 0. As stated in the great documents of wisdom, it will be passed to onActivityResult() as an argument once the activity has been closed.

Getting a Returned Value

To obtain the result of the Color Picker, you need to override onActivityResult() in your Activity like below.

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == this.requestCode) {
        if (resultCode == RESULT_OK && data != null && data.hasExtra(WearColorPickerActivity.EXTRA_COLOR)) {
          int color = data.getIntExtra(WearColorPickerActivity.EXTRA_COLOR, Color.BLACK);
          //do something with the color value
        } else {
          //the color has not been changed - the color picker activity has been closed without pressing the 'done' button
        }
    }
}

In this snippet, this.requestCode should be replaced with the same integer passed to startActivityForResult() when opening the color picker. This is mainly used to differentiate between places where startActivityForResult() is called in your Activity.

Setting a Default Color (optional)

It is possible to specify a default color for the color picker (before the user changes it) by passing it through the Intent like below.

Intent intent = new Intent(this, WearColorPickerActivity.class);
intent.putExtra(WearColorPickerActivity.EXTRA_COLOR, defaultColor);
startActivityForResult(intent, requestCode);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].