Lobsterpicker


Source link: https://github.com/LarsWerkman/Lobsterpicker

Lobsterpicker

Designed by Marie Schweiz, Developed by Lars Werkman

Lobsterpicker is a library for android material design made to support apps and developers if a color should be choosen by a user. The library is offering a dialog with all shades of material design colors. Give it a try and download our demo app via google play

![image](http://dvsty.com/git-lobsterpicker/header.png)

How you can use it:

Include one or multiple of the views inside of you layout:

<com.larswerkman.lobsterpicker.LobsterPicker
  android:id="@+id/lobsterpicker"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content" />  <com.larswerkman.lobsterpicker.sliders.LobsterShadeSlider
  android:id="@+id/shadeslider"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content" />  <com.larswerkman.lobsterpicker.sliders.LobsterOpacitySlider
  android:id="@+id/opacityslider"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content" />

summary of options

  • color wheel you prefer (wheel only)
  • color wheel and a before and after circle in the middle
  • color wheel and a slider for switching between different color spaces
  • color wheel, a slider for the colorspace and the opacity
  • slider only, toggle for 5 different shades you define
  • slider only and opacity

color wheel you prefer (wheel only)

LobsterPicker lobsterPicker = (LobsterPicker) findViewById(R.id.lobsterpicker);
  //To retrieve the selected color use lobsterPicker.getColor();
  //You'r also able to add a listener lobsterPicker.addOnColorListener(new OnColorListener() {

  @Override
  public void onColorChanged(@ColorInt int color) {

  
}

@Override
  public void onColorSelected(@ColorInt int color) {

}
 
}
);

color wheel and a before and after circle in the middle

By default this is disabled your able to enable it in xml

app:color_history_enabled="true"

Or in Java

LobsterPicker lobsterPicker = (LobsterPicker) findViewById(R.id.lobsterpicker);
  //To enable to color feedback use lobsterPicker.setColorHistoryEnabled(true);
  //To set a previous picked color or reference color use lobsterPicker.setHistory(Color.RED);

color wheel and a slider for switching between different color spaces

To connect a slider to the color wheel use

LobsterPicker lobsterPicker = (LobsterPicker) findViewById(R.id.lobsterpicker);
 LobsterShadeSlider shadeSlider = (LobsterShadeSlider) findViewById(R.id.shadeslider);
  //To connect them lobsterpicker.addDecorator(shadeSlider);

All sliders implement the ColorDecorator interface, which enables them to manipulate the user selected color. Important to notice is the sequence you add decorators, because the first decorator that is added will be the first to manipulate the color.

color wheel, a slider for the colorspace and the opacity

To connect both the LobsterShadeSlider and LobsterOpacitySlider isn't any diffent then the previous mentioned method

LobsterPicker lobsterPicker = (LobsterPicker) findViewById(R.id.lobsterpicker);
 LobsterShadeSlider shadeSlider = (LobsterShadeSlider) findViewById(R.id.shadeslider);
 LobsterOpacitySlider opacitySlider = (LobsterOpacitySlider) findViewById(R.id.opacityslider);
  //To connect them lobsterpicker.addDecorator(shadeSlider);
 lobsterpicker.addDecorator(opacitySlider);

slider only, toggle for 5 different shades you define

The LobsterShadeSlider can also be used as a standalone color selector.

//To retrieve to color is the same mehtod used for the LobsterPicker shadeSlider.getColor();

To use your own colors this can be done by implementing the ColorAdapter interface. Or use the existing BitmapColorAdapter which takes a Drawable as color source.

lobsterPicker.setColorAdapter(new BitmapColorAdapter(this, R.drawable.default_shader_pallete));

slider only and opacity

Just like for the LobsterPicker you have to add the opacity slider as a decorator

LobsterShadeSlider shadeSlider = (LobsterShadeSlider) findViewById(R.id.shadeslider);
 LobsterOpacitySlider opacitySlider = (LobsterOpacitySlider) findViewById(R.id.opacityslider);
  //To connect them shadeSlider.addDecorator(opacitySlider);

Download

Maven:

<dependency>  <groupId>com.larswerkman</groupId>  <artifactId>lobsterpicker</artifactId>  <version>1.0.1</version> </dependency>

Gradle:

compile 'com.larswerkman:lobsterpicker:1.0.1'

License

Copyright (C) 2015 Marie Schweiz & Lars Werkman Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License. You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 

Credits

This library is written and developed by Lars Werkman. For feedback, requests and collaboration please use Github or write us.

Lars Werkman Freelance android developer [email protected]

Marie Schweiz Freelance android designer [email protected]

Resources

Following the same approach that RxActivityResult does, RxPermissionsResult is a reactive wrapper around the permission's Android Api, which allows to get the data without breaking the observable chain.

You don't want your apps look and feel boring, do you? Add some bubbles!

This custom view is structured of Sine Wave Equation.

CheckableView library that features Button and ImageButton to work as a checkable view components.

An extension of RelativeLayout that helps show loading, empty and error layout.

This is a simplified library to track the user location and address corresponding to it.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes