Abstraction for the usual BaseAdapter "ViewHolder" pattern
Abstraction for the usual BaseAdapter "ViewHolder" pattern
BaseAdapterHelper aims to make BaseAdapter's
getView()method much more readable, getting rid of the ViewHolder pattern boilerplate code.
QuickAdapter allows you to shorten the code of most usual
BaseAdapter, taking care of implementing everything for you based on your data list. You only need to focus on the mapping between your view and your model.
BaseAdapter Helper is now available on Maven Central.
<dependency>
<groupId>com.joanzapata.android</groupId>
<artifactId>base-adapter-helper</artifactId>
<version>1.1.11</version>
</dependency>or
compile 'com.joanzapata.android:base-adapter-helper:1.1.11'setText() Calls setText(String) on any TextView.setAlpha() Calls setAlpha(float) on any View.setVisible() Calls setVisibility(int) on any View.linkify() Calls Linkify.addLinks(view, ALL) on any TextView.setTypeface() Calls setTypeface(Typeface) on any TextView.setProgress() Calls setProgress(int) on any ProgressBar.setMax() Calls setMax(int) on any ProgressBar.setRating() Calls setRating(int) on any RatingBar.setImageResource() Calls setImageResource(int) on any ImageView.setImageDrawable() Calls setImageDrawable(Drawable) on any ImageView.setImageBitmap() Calls setImageBitmap(Bitmap) on any ImageView.setImageUrl() Uses Square's Picasso to download the image and put it in an ImageView.setImageBuilder() Associates a Square's Picasso RequestBuilder to an ImageView.setOnClickListener()setOnTouchListener()setOnLongClickListener()setTag()setChecked()setAdapter()getView(id)on the adapter to do custom operations.showIndeterminateProgress(boolean) Shows/hides an indeterminate progress at the end of the list.The performances using the BaseAdapter Helper are equivalent to the ones of the ViewHolder pattern.
It has been tested on thousands items list of complex item structure with more than 30 views to be adapted on each item, and the getView() method has shown similar execution times.
…No open issues yet, or sync has not completed.