Skip to content
This repository has been archived by the owner on Sep 9, 2019. It is now read-only.

[Deprecated] Blanket is a ​simple library to help you bind your views and use a fluent interface to ​access their methods. No boilerplate code, I ​promise.

Notifications You must be signed in to change notification settings

marcellogalhardo/android-blanket

Repository files navigation

Blanket

Blanket is a simple library to help you bind your views and use a fluent interface to access their methods.

Why Create Blanket? The main goal to create Blanket has an issue #100 from the great Butterknife library. Basically, I need to convert a android.application to android.library, but the project has developed with Butterknife and I wanted a good code. Then I create Blanket to solve the bind problem and maintain my code elegant.

Download

Step 1. Add it in your root build.gradle at the end of repositories:

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

Step 2. Add the dependency

dependencies {
	compile 'com.github.marcellogalhardo:Blanket:0.1.0'
}

That's it!

Using

Simple Usage

Blanket blanket = Blanket.with(this);
blanket.textView(R.id.textviewHelloWorld)
    .text("teste")
    .textColor(ContextCompat.getColor(this, R.color.colorAccent))
    .textSize(50)
    .allCaps(true)
    .enabled(true);

Container Support:

  • Activity;
  • Fragment;
  • Dialog.

View Support:

  • Button;
  • CheckBox;
  • CompoundButton;
  • EditText;
  • ImageButton;
  • ImageView;
  • ProgressBar;
  • RadioButton;
  • SeekBar;
  • Switch;
  • TextView;
  • ToggleButton;
  • View.

BlanketBag Usage

BlanketBag.wrap(new EditText()) // or a reference
    .text("teste")
    .textColor(ContextCompat.getColor(this, R.color.colorAccent))
    .textSize(50)
    .allCaps(true)
    .enabled(true);

ViewBinder Usage

ViewBinder viewBinder = ViewBinderFactory.create(this);
TextView textView = viewBinder.findById(R.id.textView);

Credits

License

Copyright 2016 Marcello Galhardo

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: here.

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.

About

[Deprecated] Blanket is a ​simple library to help you bind your views and use a fluent interface to ​access their methods. No boilerplate code, I ​promise.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages