AndroidUniversalAdapter


Source link: https://github.com/lliepmah/AndroidUniversalAdapter

Android Universal Adapter

Integration

  1. Implement your view holder, by extending DefaultViewHolder<SomeModelClass>
  2. Annotate it by @HolderBuilder(R.layout.some_layout) annotation
  3. Library generates view holder builder
  4. You can use it with your custom adapter, or with UniversalAdapter

Example

View holder builder implementation:

@HolderBuilder(R.layout.li_label) class LabelHolder extends DefaultViewHolder<String> {

private final String mValue;

@BindView(R.id.li_label_tv_text)
  TextView mTvText;

@HolderConstructor
  LabelHolder(View view, String value) {

super(view);

ButterKnife.bind(this, view);

mValue = value;
  
}

public LabelHolder(View itemView) {

super(itemView);

mValue = "";
  
}

@Override
  public void bind(String text) {

mTvText.setText(mValue + text);

  
}
 
}

Usage holder builder:

  UniversalAdapter adapter = new UniversalAdapter(new ScreenHolderBuilder(this),

  new LabelHolderBuilder("example "));

 adapter.add(getString(R.string.menu));

adapter.addAll(getScreens());

mRecyclerView.setAdapter(adapter);

Gradle

 def universalAdapterVersion = 'x.x.x'
  ...
  dependencies {

 provided "com.github.lliepmah:annotations:$universalAdapterVersion"

 compile "com.github.lliepmah:library:$universalAdapterVersion"

 annotationProcessor "com.github.lliepmah:compiler:$universalAdapterVersion"
  ...
  
}

Kotlin

 def universalAdapterVersion = 'x.x.x'
  ...
  dependencies {

 provided "com.github.lliepmah:annotations:$universalAdapterVersion"

 compile "com.github.lliepmah:library:$universalAdapterVersion"

 kapt "com.github.lliepmah:compiler:$universalAdapterVersion"
  ...
  
}

ProGuard

No special ProGuard rules required.

License

Copyright 2016 Arthur Korchagin  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

SugarLoader is a small library that adds sugar to Android Loader API.

Even when you rotate screen, tap home button, or anything, there is no risk to crash it or miss the callback, data will be loaded only once, then rendered to the restored activity/fragment, because there is Android Loader API under the hood.

A simple progress indicator (or chart widget) for Android.

Simple, Tiny, Extendable Android MVP library. No complex Base Activity, Base Fragment or Base View. Just base Presenters and View interface for you to extend from.

Extension of Android standard ImageView that lets the user scale the represented image and drag it around a pivot point defined as a fraction or a percentage.

A clean and easy to use Animated Progress View in a Square.

This project aims to implement FloatingActionButton's speed dial animation in material design guideline.

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