Atelier


Source link: https://github.com/Musenkishi/Atelier

Atelier

Every artist needs a place where he can paint in peace and store his tools such as palette and swatches.

This is a library aiming to simplify the use of Palette, especially in lists such as ListView, GridView, or RecyclerView.

Download

Add the Jitpack repository to your project-level or module-level build.gradle:

repositories {
  maven {

url "https://jitpack.io"
  
}
 
}

Now, you can add the Atelier dependency:

compile 'com.github.Musenkishi:Atelier:1.3.1'

Usage

Currently Atelier supports classes (and extensions of):

  • View
  • ImageView (masking and background)
  • TextView
  • Floating Action Button (icon masking and background)
  • CardView

If the supplied view is or extends View, Atelier will apply the color to the background. If view extends ImageView and you use .mask(), Atelier will apply the color to the image, not the background. This is also true for Floating Action Button. And if view is, or extends TextView, the color will be applied to the text, not the background. If view is or extends CardView, Atelier will apply the color through .setCardBackgroundColor().

Atelier.with(context, uniqueStringForBitmap) //For reuse purposes uniqueStringForBitmap could be the url for the image.

.load(bitmap)

.swatch(new DarkVibrantSwatch(ColorType.BACKGROUND))

.into(view, view2, ...);
 //Single or multiple views supported

Example

In this example Glide is used. Picasso example can be found in the sample project:

RequestListener<String, GlideDrawable> glideDrawableRequestListener = new RequestListener<String, GlideDrawable>() {

  @Override
  public boolean onResourceReady(GlideDrawable resource,

String model,

Target<GlideDrawable> target,

boolean isFromMemoryCache,

boolean isFirstResource) {

Bitmap bitmap = ((GlideBitmapDrawable) resource).getBitmap();

if (bitmap != null) {

 Context context = viewHolder.bottomBar.getContext();

  //Set color to a View's background

 Atelier.with(context, model)

 .load(bitmap)

 .swatch(new VibrantSwatch(ColorType.BACKGROUND))

 .into(viewHolder.bottomBar);

  //Set color to text in a TextView

 Atelier.with(context, model)

 .load(bitmap)

 .swatch(new VibrantSwatch(ColorType.TEXT_TITLE))

 .into(viewHolder.textViewResolution);

  //Colorize an ImageView/ImageButton with .mask().

 //Best result is accomplished with a white image (transparent bakground).

 Atelier.with(context, model)

 .load(bitmap)

 .fallbackColor(viewHolder.textViewResolution.getCurrentTextColor())

 .swatch(new VibrantSwatch(ColorType.TEXT_TITLE))

 .mask()

 .into(viewHolder.imageButton);

 
}

 return false;

}

  
}
;

Glide.with(viewHolder.bottomBar.getContext())

 .load(imageUrl)

 .fitCenter()

 .placeholder(R.color.Transparent)

 .listener(glideDrawableRequestListener)

 .into(viewHolder.imageView);

Atelier will generate the palette in a separate thread (up to 5 threads on post-lollipop) and apply the color in the assigned view.

License

Copyright 2015 Freddie Lust-Hed  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. 

Resources

RapidJSON is a JSON parser and generator for C++. It was inspired by RapidXml.

Features:

  • Small but complete. It supports both SAX and DOM style API.
  • Fast. Its performance can be comparable to strlen().
  • Self-contained. It does not depend on external libraries.
  • Memory friendly. Each JSON value occupies exactly 16/20 bytes.
  • Unicode friendly.

EdgeEffectOverride is library designed to help override the blue overscroll_edge and overscroll_glow effects used by the the EdgeEffect class.

Simply import the project into your library, replace existing references to ScrollView, ListView, ExpandableListView, GridView & ViewPager with references to the the classes found in this library.

No need to edit any graphics, simply colorize the edge effect dynamically or via the layout xml, easy!

A Reactive wrapper around Google's YouTube Data API.

material-dialogs library allows you to use a consistently Material themed dialog on all versions of Android, along with specific customizations that make it easier to brand the dialog.

Navigation Drawer Activity with material design style and simplified methods.

Every major open-source project has its own style guide: a set of conventions (sometimes arbitrary) about how to write code for that project. It is much easier to understand a large codebase when all the code in it is in a consistent style.

"Style" covers a lot of ground, from "use camelCase for variable names" to "never use global variables" to "never use exceptions." This project holds the style guidelines we use for Google code. If you are modifying a project that originated at Google, you may be pointed to this page to see the style guides that apply to that project.

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