Shade-Melange


Source link: https://github.com/devikamehra/Shade-Melange

Shade-Melange

Shade Melange is a library that contains a colour palette with a wide range of pre-defined colours with their names. The implementation of the grid has been done using RecyclerView for memory efficient performance. The library consists of two main classes:

  • ShadeMelangeFragment.java - Fragment that can be used directly by attaching it with your activity.

  • ShadeMelangeDialog.java - Dialog that beyond it's basic implementation contains a colour palatte.

Including in your project

Add JitPack to repositories in your project's root build.gradle file:

allprojects {

  repositories {

...

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

  
}
 
}
 

Add the dependency to your module's build.gradle file:

dependencies {

  ...
  compile 'com.github.devikamehra:Shade-Melange:v2.0' 
}
 

Usage

ShadeMelangeFragment

Just like another fragment, this fragment can be attached to your activity by using your default Fragment Manager

ShadeMelangeFragment fragment = new ShadeMelangeFragment();

 fragment.with(this)

  .columns(2)

  // gridview columns

  .setTextColor(Color.RED)

 // name of the colour textColor

  .applyDecoration(DecorationEnum.SIMPLE_GRID_DECORATION) // recyclerview item decoration. Can be customized. 

  .showRectangularShell(true)

  // Shape of shell (Circular or Rectangular)  

  .setSelectionMode(SelectionModeEnum.SINGLE_SELECTION_MODE) // To change selection mode from multi to single

  .setShadeType(ShadeTypeEnum.MATERIAL_SHADES)

  // Defines the type of Shades

  .setOnShadeSelectListener(new OnShadeSelectedListener() {
 // onClickShades Listener 

@Override

public void onShadeSelected(int color, String name) {

 Toast.makeText(MainActivity.this, "You selected " + name + " shade." , Toast.LENGTH_SHORT).show();

}

  
}
);

 getSupportFragmentManager()

  // easily add it using Fragment Manager

  .beginTransaction()

  .add(R.id.container, fragment, "frag")

  .commit();
 

ShadeMelangeDialog

The Dialog contains a colour palatte which can be customized according to your specifications

ShadeMelangeDialog dialog = new ShadeMelangeDialog(this);

 dialog.title("Shade Melange Dialog")

.setOnShadeSelectListener(new OnShadeSelectedListener() {

 // onShadeClick Listener

 @Override

 public void onShadeSelected(int color, String name) {

  Toast.makeText(MainActivity.this, "You selected " + name + " shade.", Toast.LENGTH_SHORT).show();

 
}

}
)

.setPositiveButton("Select", new OnDialogButtonClickListener() {

// add various buttons 

 @Override

 public void onButtonClicked(ShadeMelangeDialog shadeMelangeDialog) {

Toast.makeText(getBaseContext(), "Shade Selected!!", Toast.LENGTH_SHORT).show();

  
}

}
);

 dialog.showMelange();

 // Remember to use showMelange() and not the default show() 

Refer to the sample to appreciate the simplistic implementation of the library.

License

Copyright 2016 Devika Mehra

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

A tool for mocking HTTP services.

Features:

  • HTTP response stubbing, matchable on URL, header and body content patterns
  • Request verification
  • Runs in unit tests, as a standalone process or as a WAR app
  • Configurable via a fluent Java API, JSON files and JSON over HTTP
  • Record/playback of stubs
  • Fault injection
  • Per-request conditional proxying
  • Browser proxying for request inspection and replacement
  • Stateful behaviour simulation
  • Configurable response delays

Mock your HTTP responses to test your REST API.

Mocky is a simple app which allows to generate custom HTTP responses. It's helpful when you have to request a build-in-progress WS, when you want to mock the backend response in a single app, or when you want to test your WS client.

Get a full fake REST API with zero coding in less than 30 seconds.

Java tool for mocking HTTP server behaviours for testing HTTP client code.

Fixd is an HTTP server fixture for testing web clients. Unlike a mock web server, it is backed by a fully functional HTTP server, bound to a port of your choosing. Its fluent interface allows you to quickly and easily script responses to client requests. Its clear, declarative interface also makes the setup portion of your unit tests easy to read and understand.

MockServer is a mock HTTP server that enables easy mocking of any system you integrate with via HTTP or HTTPS (i.e. services, web sites, etc).

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