All Projects → commonsguy → Cwac Colormixer

commonsguy / Cwac Colormixer

Licence: apache-2.0
CommonsWare Android Components: ColorMixer

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Cwac Colormixer

Grocerystore With Server
Grocery Store with server integration
Stars: ✭ 51 (-36.25%)
Mutual labels:  android-ui
Fitbutton
The button which can use with icon, text, divider, custom ripple effect, border, corner radius e.t.c.
Stars: ✭ 63 (-21.25%)
Mutual labels:  android-ui
Edxposedmanager
Companion Android application for EdXposed
Stars: ✭ 1,172 (+1365%)
Mutual labels:  android-ui
Testleavesloading
Android 自定义 View 之 LeavesLoading
Stars: ✭ 55 (-31.25%)
Mutual labels:  android-ui
Kakao
Nice and simple DSL for Espresso in Kotlin
Stars: ✭ 1,109 (+1286.25%)
Mutual labels:  android-ui
Rippleview
View that imitates Ripple Effect on click which was introduced in Android L (for Android 2.3+)
Stars: ✭ 1,147 (+1333.75%)
Mutual labels:  android-ui
Lovelydialog
This library is a set of simple wrapper classes that are aimed to help you easily create fancy material dialogs.
Stars: ✭ 1,043 (+1203.75%)
Mutual labels:  android-ui
Confetti
An Android particle system library for displaying confetti!
Stars: ✭ 1,194 (+1392.5%)
Mutual labels:  android-ui
Moviebookingui Android
This is a concept of fetching a user's cinema show details like venue, movie, date & showtime before allowing him to place a cinema F&B order.
Stars: ✭ 62 (-22.5%)
Mutual labels:  android-ui
Androidformenhancer
Form validation library for Android applications.
Stars: ✭ 71 (-11.25%)
Mutual labels:  android-ui
Expandable Fab
A highly customizable 'speed dial' FloatingActionButton implementation.
Stars: ✭ 56 (-30%)
Mutual labels:  android-ui
Battery Meter View
🔋 Material design battery meter (i.e. level, state) view for Android
Stars: ✭ 57 (-28.75%)
Mutual labels:  android-ui
Floatingactionbuttonspeeddial
A Floating Action Button Speed Dial implementation for Android that follows the Material Design specification (https://material.io/components/buttons-floating-action-button#types-of-transitions)
Stars: ✭ 1,164 (+1355%)
Mutual labels:  android-ui
Phonenumberverificationui Android
Check out the new style for mobile number verification 😉😉😊😊
Stars: ✭ 52 (-35%)
Mutual labels:  android-ui
Cwac Layouts
CWAC Layouts: Custom Containers, Concisely Coded
Stars: ✭ 76 (-5%)
Mutual labels:  android-ui
Colorpickerview
🎨 Android colorpicker for getting colors from any images by tapping on the desired color.
Stars: ✭ 1,042 (+1202.5%)
Mutual labels:  android-ui
Bubbles
⚡️A library for adding messenger style floating bubbles to any android application 📲
Stars: ✭ 66 (-17.5%)
Mutual labels:  android-ui
Booking Seats Layout Sample
A sample that shows how to create a dynamic layout for booking seats
Stars: ✭ 79 (-1.25%)
Mutual labels:  android-ui
Cycleviewpager2
使用 ViewPager2 实现无限轮播效果,可以用来实现 banner 以及上下滚动文字广告等。Implementing android cycle viewPager with ViewPager2
Stars: ✭ 76 (-5%)
Mutual labels:  android-ui
Slideactionview
An Android view which provides a nice slide-to-left/right interaction.
Stars: ✭ 70 (-12.5%)
Mutual labels:  android-ui

CWAC ColorMixer: Appealing To Your Users' Sense of Fashion

NOTE: This library is discontinued. There are many color picker libraries to choose from as alternatives. This repository will become inaccessible on or after 1 January 2019.

Sometimes, you want your users to pick a color. A simple approach is to give the user a fixed roster of a handful of colors -- easy, but limited. A fancy approach is to use some form of color wheel, but these can be difficult to use on a touchscreen and perhaps impossible without a touchscreen.

ColorMixer is a widget that provides a simple set of SeekBars to let the user mix red, green, and blue to pick an arbitrary color. It is not very big, so it is easy to fit on a form, and it is still fairly finger-friendly.

It is also packaged as a dialog (ColorMixerDialog), a dialog-themed activity (ColorMixerActivity), and a preference (ColorPreference).

This is distributed as an Android library project. You can use it in source form or via an AAR.

Usage

Obtaining the AAR

Add the following blocks to your build.gradle file:

repositories {
    maven {
        url "https://s3.amazonaws.com/repo.commonsware.com"
    }
}

dependencies {
    compile 'com.commonsware.cwac:colormixer:0.6.+'
}

Or, if you cannot use SSL, use http://repo.commonsware.com for the repository URL.

ColorMixer

ColorMixer is a simple widget. Given that you have the parcel installed in your project, or have manually merged the source and resources into your project, you can add the widget to a layout like any other:

<com.commonsware.cwac.colormixer.ColorMixer
	android:id="@+id/mixer"
	android:layout_width="wrap_content"
	android:layout_height="wrap_content"
/>

You can call getColor() and setColor() to manipulate the color at runtime. You can also call setOnColorChangedListener() to register a ColorMixer.OnColorChangedListener object, which will be called with onColorChanged() when the color is altered by the user.

There is one custom attribute, cwac_colormixer_color, that you can use, to set the initial color (instead of using setColor()). To use this custom attribute, add the xmlns:mixer="http://schemas.android.com/apk/res-auto" namespace declaration to your layout, then add the mixer:cwac_colormixer_color attribute to the com.commonsware.cwac.colormixer.ColorMixer widget:

<com.commonsware.cwac.colormixer.ColorMixer android:id="@+id/mixer" android:layout_width="wrap_content" android:layout_height="wrap_content" mixer:cwac_colormixer_color="#FFFF00FF" />

ColorMixerDialog

ColorMixerDialog is an AlertDialog subclass. Hence, to create and show the dialog, all you need to do is create an instance and show() it:

new ColorMixerDialog(this, someColor, onDialogSet).show();

In the above code snippet, this is a Context (e.g., an Activity), someColor is the color you want to start with, and onDialogSet is a ColorMixer.OnColorChangedListener that will be notified if the user clicks the "Set" button on the dialog and has changed the color from the initial value.

ColorMixerActivity

ColorMixerActivity is a dialog-themed Activity. This is useful for situations where you want a dialog but do not want to deal with a dialog.

To use it, add it as an activity to your project. You will need to use the full package in your <activity> element, marking it as using Theme.Dialog. Here is one implementation, from the demo/ project:

<activity android:name="com.commonsware.cwac.colormixer.ColorMixerActivity"
				android:label="@string/app_name"
				android:theme="@android:style/Theme.Dialog">
</activity>

In the Intent you use to start the activity, you can supply the starting color via a ColorMixerActivity.COLOR integer extra, and the dialog title via a ColorMixerActivity.TITLE string extra. For example:

Intent i=new Intent(this, ColorMixerActivity.class);

i.putExtra(ColorMixerActivity.TITLE, "Pick a Color");
i.putExtra(ColorMixerActivity.COLOR, mixer.getColor());

startActivityForResult(i, COLOR_REQUEST);

ColorPreference

ColorPreference is a Preference class, to be referenced in preference XML and loaded into a PreferenceActivity. It has no attributes beyond the standard ones.

<PreferenceScreen
	xmlns:android="http://schemas.android.com/apk/res/android">
	<com.commonsware.cwac.colormixer.ColorPreference
		android:key="favoriteColor"
		android:defaultValue="0xFFA4C639"
		android:title="Your Favorite Color"
		android:summary="Blue.  No yel--  Auuuuuuuugh!" />
</PreferenceScreen>

The preference is stored as an integer under the key you specify in the XML.

Dependencies

This project has no dependencies.

This project should work on API Level 4 and higher — please report bugs if you find otherwise.

Version

This is version v0.6.0 of this module, meaning it is creeping towards respectability.

NOTE: To eliminate a collision on the attribute name with Android 5.0, users of v0.5.3 or older versions of this library will need to upgrade their layout XML to reference cwac_colormixer_color instead of just color.

Demo

There is a demo/ directory containing a demo project. It uses the library project itself to access the source code and resources of the ColorMixer library. When built using Eclipse, it depends upon the library being located at ../colormixer with respect to the demo project. When built using Gradle/Android Studio, it uses the local :colormixer project for debug builds and the AAR artifact for release builds.

License

The code in this project is licensed under the Apache Software License 2.0, per the terms of the included LICENSE file.

Questions

This library is no longer supported.

Release Notes

  • v0.6.1: updated for Android Studio 1.0 and new AAR publishing system
  • v0.6.0: renamed attribute from color to cwac_colormixer_color, added more Gradle
  • v0.5.3: manifest fixes to help with manifest merging
  • v0.5.2: continued work to improve IDE preview panes
  • v0.5.1: bug fix to help with IDE preview panes
  • v0.5.0: added Gradle support
  • v0.4.3: removed CWAC-Parcel dependency
  • v0.4.2: demonstrated better Android library project integration with layouts
  • v0.4.1: fixed ColorPreference to work better on Honeycomb
  • v0.4.0: converted to Android library project, added ColorMixerActivity

Who Made This?

CommonsWare

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].