ButterKnifeLite


Source link: https://github.com/janishar/ButterKnifeLite

ButterKnifeLite

##Android View initializer and Click Listener boiler plate code remover

####This library is based on the ideas of removing boilerplate code like ButterKnife but with use cases targeted for view binding of xml. Resulting is a vey tiny library.

## @BindView annotation to refer any view defined in XML

 @BindView(R.id.txtView)  public TextView textView1;

## @OnClick annotation to set onClick method for any view defined in XML

@OnClick(R.id.btn1) public void onBtn1Click(){

  textView1.setText("Btn 1 click");
 
}
 

## @OnLongClick annotation to set OnLongClick method for any view defined in XML

@OnLongClick(R.id.btn2) private void onBtn2LongClick(){

  txtView.setText("Btn 2 long click");
 
}
 

##For Any class with inflated view from XML can be used as described below ##For example in a Fragment

public class MyFragment extends Fragment {

@BindView(R.id.txtView)
  public TextView txtView;

@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

View promptsView = inflater.inflate(R.layout.my_fragment, container, false);

ButterKnifeLite.bind(this, promptsView);

return promptsView;
  
}

@OnClick(R.id.btn1)
  public void onBtn1Click(){

txtView.setText("Btn 1 frag click");

  
}

@OnClick(R.id.btn2)
  public void onBtn2Click(){

txtView.setText("Btn 2 frag click");

  
}
 
}
 

Note: In version 0.0.1 and 0.0.2 we had to call ButterKnifeLite.unbind(obj) to remove the binded class. It is not required from version 0.0.3

#Gradle

  compile 'com.mindorks:butterknifelite:0.0.3'

Proguard Note:

If you are using proguard, then add this rule in proguard-project.txt

  -keepattributes *Annotation*
-keepclassmembers class ** {

  @com.mindorks.butterknifelite.annotations.** <methods>;

}

Recent Libraries:

# PlaceHolderView

PlaceHolderView helps create views without any adapter in a very modular form. It uses the power of RecyclerView and enhances it to another level. For the first time with the list view comes card stack view.

# JPost

JPost is a pubsub library based on massages over a channel. It's very efficient and much powerful than other pubsub libraries. It prevents memory leak and increases code control. Also, provide a mechanism to run code asynchronously.

Why should you use JPost library

  1. In contrast to the existing pub-sub libraries, it hold the subscribers with weakreference. Thus it doesn't create memory leaks.
  2. Single message can be sent to selected subscribes. This avoids the problem of event getting received at undesirable places. Thus minimising the chances of abnormal application behaviour.
  3. The subscriber addition can be controlled by using private channels. It minimises the chances of adding subscribes by mistake to receive undesirable messages.
  4. It is a tiny library < 55kb . Thus not effecting the application overall size.
  5. It facilicates synchronous as well as asynchronous message delivery and processing.
  6. It provides a mechanism to run code asynchronously.

Resources

In-App Feedback and Bug Reporting for Mobile Apps

The top apps in the world rely on Instabug for beta testing, user engagement, and crash reporting. Gather feedback from your beta testers and have live conversations with your users.

Error Handle Of Rxjava.

LoggingInterceptor - An OkHttp Interceptor which pretty logs request and response data.

An arc based android color picker library.

Chrome CustomTabs for Android demystified. Simplifies development and provides higher level classes including fallback in case Chrome isn't available on device.

Color picker for v7 Preference Support Library.

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