Just like instant coffee, saves 78% of your time on Android's Custom Adapters.

Overview

Notice

Instant Adapter is now part of an even more awesome Adapter Kit project!

Instant Adapter

Just like instant coffee, saves 78%* of your time on Android's Custom Adapters.

*Based on internal assessments, this information is subjective.

Quick Start I - InstantAdapter

Step 1 - Annotate methods in your model

class Book {
    ...

    @InstantText(viewId = R.id.title)
    public String getTitle() {
         return title;
    }

    @InstantText(viewId = R.id.author, formatString = "Author: %s")
    public String getAuthor() {
         return author;
    }
}

Step 2 - Instantiate and set an InstantAdapter to your ListView

InstantAdapter<Book> bookAdapter = new InstantAdapter<Book>(context, R.layout.book_item, Book.class, books);
bookListView.setAdapter(bookAdapter);

Quick Start II - InstantCursorAdapter

Step 1 - Annotate methods in your model

Step 2 - Extend InstantCursorAdapter<T>

class BookCursorAdapter extends InstantCursorAdapter<Book> {

    public BookCursorAdapter(Context context, Cursor cursor) {
        super(context, R.layout.book_item, Book.class, cursor);
    }

    @Override
    public Book getInstance(Cursor cursor) {
        String title = cursor.getString(cursor.getColumnIndex("title"));
        String author = cursor.getString(cursor.getColumnIndex("author"));
        return new Book(title, author);
    }
}

Step 3 - Instantiate and set an InstantCursorAdapter to your ListView

BookCursorAdapter bookCursorAdapter = new BookCursorAdapter(this, booksCursor);
bookListView.setAdapter(bookCursorAdapter);

License

Copyright 2013 Mobs and Geeks

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.

Bitdeli Badge

You might also like...
⌨️ A tool that gives you a massive head start when building Compose based apps. It saves you from time-consuming setup and configuration
⌨️ A tool that gives you a massive head start when building Compose based apps. It saves you from time-consuming setup and configuration

⌨️ A tool that gives you a massive head start when building Compose based apps. It saves you from time-consuming setup and configuration

A simple app to showcase Androids Material Design and some of the cool new cool stuff in Android Lollipop. RecyclerView, CardView, ActionBarDrawerToggle, DrawerLayout, Animations, Android Compat Design, Toolbar
A simple app to showcase Androids Material Design and some of the cool new cool stuff in Android Lollipop. RecyclerView, CardView, ActionBarDrawerToggle, DrawerLayout, Animations, Android Compat Design, Toolbar

#Android-LollipopShowcase This is a simple showcase to show off Android's all new Material Design and some other cool new stuff which is (new) in Andr

Androids EditText that animates the typed text. EditText is extended to create AnimatedEditText and a PinEntryEditText.
Androids EditText that animates the typed text. EditText is extended to create AnimatedEditText and a PinEntryEditText.

AnimatedEditText for Android This repository contains AnimatedEditText and TextDrawable all of which extend the behaviour of EditText and implement fe

A simple app to showcase Androids Material Design and some of the cool new cool stuff in Android Lollipop. RecyclerView, CardView, ActionBarDrawerToggle, DrawerLayout, Animations, Android Compat Design, Toolbar
A simple app to showcase Androids Material Design and some of the cool new cool stuff in Android Lollipop. RecyclerView, CardView, ActionBarDrawerToggle, DrawerLayout, Animations, Android Compat Design, Toolbar

#Android-LollipopShowcase This is a simple showcase to show off Android's all new Material Design and some other cool new stuff which is (new) in Andr

A simple app to showcase Androids Material Design and some of the cool new cool stuff in Android Lollipop. RecyclerView, CardView, ActionBarDrawerToggle, DrawerLayout, Animations, Android Compat Design, Toolbar
A simple app to showcase Androids Material Design and some of the cool new cool stuff in Android Lollipop. RecyclerView, CardView, ActionBarDrawerToggle, DrawerLayout, Animations, Android Compat Design, Toolbar

#Android-LollipopShowcase This is a simple showcase to show off Android's all new Material Design and some other cool new stuff which is (new) in Andr

A smart colored time selector. Users can select just free time with a handy colorful range selector.
A smart colored time selector. Users can select just free time with a handy colorful range selector.

Colored Time Range Selector A smart colored time range selector. Users can select just free time with a handy colorful range selector. Screen Shots Fe

find the top coffee shop near by a given location
find the top coffee shop near by a given location

YelpCoffee&Tea 2 Different Activities (Screens): coffee shop List, coffee shop detail View Android app displays coffee shop locations in specified loc

Kotlin Multiplatform Coffee Machine
Kotlin Multiplatform Coffee Machine

Expressus KMM sample project acting as a playground to illustrate what's discussed in these articles: Details Shared Model-View-Intent architecture Fi

A Clean Architecture App that uses clean Architecture (app, presentation, domain, data) packages to use coffee items API using MVVM Architecture, Coroutines, Retrofit2, Pagination, Live Data, Data Binding, Hilt , SOLID Principles , Navigation Component , RoomDb. :seedling: A custom loading view for android, just like alipay.
:seedling: A custom loading view for android, just like alipay.

#SmileyLoadingView A custom loading view, just like alipay. Usage Edit your layout XML: cn.refactor.smileyloadingview.lib.SmileyLoadingView

A view that allows to paint and saves the result as a bitmap
A view that allows to paint and saves the result as a bitmap

Android Drawable View Sample app: An Android view that allows to paint with a finger in the screen and saves the result as a Bitmap. Importing to your

Thrift for Android that saves you methods

Thrifty Thrifty is an implementation of the Apache Thrift software stack for Android, which uses 1/4 of the method count taken by the Apache Thrift co

H4SGTAG MANAGER - CRUD that saves hashtags for social media

H4SGTAG_MANAGER CRUD that saves hashtags for social media made using android stu

Android NTP time library. Get the true current time impervious to device clock time changes
Android NTP time library. Get the true current time impervious to device clock time changes

TrueTime for Android Make sure to check out our counterpart too: TrueTime, an NTP library for Swift. NTP client for Android. Calculate the date and ti

This is a work-in-progress (🔧️) ultraviolet index viewer app for demonstrating Instant Apps + Kotlin + Dagger + MVP
This is a work-in-progress (🔧️) ultraviolet index viewer app for demonstrating Instant Apps + Kotlin + Dagger + MVP

UV Index A simple ultraviolet index viewer app for demonstrating: Instant Apps + Kotlin + Dagger + MVP Built With Weatherbit as weather API Android In

A super fast build tool for Android, an alternative to Instant Run
A super fast build tool for Android, an alternative to Instant Run

Freeline Freeline is a super fast build tool for Android and an alternative to Instant Run. Caching reusable class files and resource indices, it enab

This is a work-in-progress (🔧️) ultraviolet index viewer app for demonstrating Instant Apps + Kotlin + Dagger + MVP
This is a work-in-progress (🔧️) ultraviolet index viewer app for demonstrating Instant Apps + Kotlin + Dagger + MVP

UV Index A simple ultraviolet index viewer app for demonstrating: Instant Apps + Kotlin + Dagger + MVP Built With Weatherbit as weather API Android In

Email-based instant messaging for Android.
Email-based instant messaging for Android.

Delta Chat Android Client This is the Android client for Delta Chat. It is available on F-Droid and the Google Play Store. The APK can also be downloa

SayHi! is an instant messaging app that allows users to send text messages to other people using the app
SayHi! is an instant messaging app that allows users to send text messages to other people using the app

SayHi SayHi! is an instant messaging app that allows users to send text messages to other people using the app 📷 Screen Shots 🔥 Features OTP Verific

Comments
  • App does not support views inherited from TextView

    App does not support views inherited from TextView

    I found that adapter does not support classes inherited from TextView (eg. RobotoTextView).

    Fortunately fix is easy.

    In class InstantAdapterCore (around line 300) you simply change this fragment of code from

    Class<? extends View> viewType = holder.view.getClass();
    if (viewType.isAssignableFrom(TextView.class)) {
          updateTextView(holder, returnValue);
    }
    

    to

    Class<? extends View> viewType = holder.view.getClass();
    if (TextView.class.isAssignableFrom(viewType)) {
          updateTextView(holder, returnValue);
    }
    
    opened by thubalek 1
Owner
Ragunath Jawahar
Ragunath Jawahar
[] Easy Adapters library for Android

Deprecated Due to the growing use of the RecyclerView and the RecyclerView.Adapter provided adapter class, Easy-Adapter is now deprecated. Whilst the

ribot 425 Nov 25, 2022
Adapter Kit is a set of useful adapters for Android.

Adapter Kit Adapter Kit is a set of useful adapters for Android. The kit currently includes, Instant Adapter Instant Cursor Adapter Simple Section Ada

Ragunath Jawahar 368 Nov 25, 2022
Generate data-view-binding adapters of android recycler view.

Items 这个库可以为 Android 的 RecyclerView 生成基于 Data-View-Binding 的 Adapter。 对比其他一些类似的开源库,它有以下的一些优势: 更好的拓展性。这个库不需要你继承特定的 Adapter 或 ViewHolder 类,你可以继承任何第三方提供的

nekocode 253 Nov 11, 2022
This library provides Easy Android ListView Adapters(EasyListAdapter & EasyCursorAdapter) which makes designing Multi-Row-Type ListView very simple & cleaner, It also provides many useful features for ListView.

EasyListViewAdapters Whenever you want to display custom items in listview, then only way to achieve this is to implement your own subclass of BaseAda

Biraj Patel 132 Nov 25, 2022
The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...

FastAdapter The FastAdapter is here to simplify creating adapters for RecyclerViews. Don't worry about the adapter anymore. Just write the logic for h

Mike Penz 3.7k Jan 8, 2023
Simplify Adapter creation for your Android ListViews.

FunDapter takes the pain and hassle out of creating a new Adapter class for each ListView you have in your Android app. It is a new approach to custom

Ami Goldenberg 287 Dec 22, 2022
This library provides GridAdapters(ListGridAdapter & CursorGridAdapter) which enable you to bind your data in grid card fashion within android.widget.ListView, Also provides many other features related to GridListView.

GridListViewAdapters This libarary enables you to implement GridView like card layout within ListView with added capabilites like Paginations, Additio

Biraj Patel 270 Nov 25, 2022
⌨️ A tool that gives you a massive head start when building Compose Desktop apps. It saves you from time-consuming setup and configuration

?? create-compose-app A tool that gives you a massive head start when building Compose based apps. It saves you from time-consuming setup and configur

theapache64 466 Dec 21, 2022
⌨️ A tool that gives you a massive head start when building Compose Desktop apps. It saves you from time-consuming setup and configuration

?? create-compose-app A tool that gives you a massive head start when building Compose based apps. It saves you from time-consuming setup and configur

theapache64 468 Dec 30, 2022