Colorful


Source link: https://github.com/garretyoder/Colorful

Colorful

Colorful is a dynamic theme library allowing you to change your apps' color schemes easily.

License

Colorful is licensed under the Apache 2.0 License, in common Android style.

Copyright 2016 Garret Yoder

Installation

Add jitpack to your maven sources

allprojects {

  repositories {

...

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

  
}
 
}

Add Colorful as a dependency to your build.gradle

dependencies {

  compile 'com.github.garretyoder:Colorful:1.1' 
}

Usage

In your Application class, you must initialize Colorful

public class SampleApp extends Application {

  @Override
  public void onCreate() {

super.onCreate();

Colorful.init(this);

  
}
 
}

Any Activity you wish to be themed must extend from CActivity

public class MainActivity extends CActivity

Alternatively you can call the following method after super.onCreate(savedInstanceState); and before setContentView();

Colorful.applyTheme(Activity activity);

You can also use Colorful.applyTheme(Activity activity, Boolean overrideBase); where overrideBase defines whether you want Colorful to override your base theme as well, or simply set the primary and accent colors. This allows you to use Colorful with your own pre-defined style, but will break light/dark functionality.

You can set the default theme colors Colorful will use with the defaults() method

public class SampleApp extends Application {

  @Override
  public void onCreate() {

super.onCreate();

Colorful.defaults()

  .primaryColor(Colorful.ThemeColor.RED)

  .accentColor(Colorful.ThemeColor.BLUE)

  .translucent(false)

  .dark(true);

Colorful.init(this);

  
}
 
}

You can set the colors at any time using the config method

Colorful.config(this)

  .primaryColor(Colorful.ThemeColor.RED)

  .accentColor(Colorful.ThemeColor.BLUE)

  .translucent(false)

  .dark(true)

  .apply();

After which you must call apply(); to save your changes

Colorful will handle saving and loading your theme preferences for you.

Color Chooser

Colorful has a inbuilt color chooser dialog that will return a ThemeColor object you can pass directly to Colorful

public class MainActivity extends CActivity {

@Override
  protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

setSupportActionBar(((Toolbar) findViewById(R.id.toolbar)));

 ColorPickerDialog dialog = new ColorPickerDialog(this);

dialog.setOnColorSelectedListener(new ColorPickerDialog.OnColorSelectedListener() {

 @Override

 public void onColorSelected(Colorful.ThemeColor color) {

  //TODO: Do something with the color

 
}

}
);

dialog.show();

  
}
 
}

Preference Item

Colorful has a inbuilt preference item that will automatically set Colorful's colors.

Use colorpicker:primary_color and colorpicker:accent_color to tell Colorful which value to set.


  <org.polaric.colorful.ColorPickerPreference

 android:title="@string/primary_color"

 android:summary="@string/primary_color_desc"

 colorpicker:primary_color="true"/>

 <org.polaric.colorful.ColorPickerPreference

 android:title="@string/accent_color"

 android:summary="@string/accent_color_desc"

 colorpicker:accent_color="true"/>

Screenshots

Resources

Rosetta is an Android library that helps your app supporting multiple languages and switching between them without causing any headaches.

A better Android credit/debit card interactive form without writing a lot of code

CardForm can be used as a simple credit card validation form with any credit card form and any payment API (without you changing anything).

The goal of this library is to help you in your development of validation forms.

Atmosphere is a black-box testing framework for Android applications.

Some of the capabilities that Atmosphere offers are:

  • Gestures simulation
  • Sensors Simulation
  • Simulating calls and messages
  • Simulating low battery

This library is extremely powerful since you can custom your own swipe effects "No limits for your imagination".

This example basically includes:

  • Intent sharing between activities of views with animation
  • Swipe layout on item details and blur background like whatspp on sliding
  • Float action Menu
  • UI with searching functionality

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