Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
Add the dependency
dependencies {
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:v1.3'
}
#Use it
public class QuickAdapter extends BaseQuickAdapter<Status> {
public QuickAdapter(Context context) {
super(context, R.layout.tweet, DataServer.getSampleData());
}
@Override
protected void convert(BaseViewHolder helper, Status item) {
helper.setText(R.id.tweetName, item.getUserName())
.setText(R.id.tweetText, item.getText())
.setText(R.id.tweetDate, item.getCreatedAt())
.setImageUrl(R.id.tweetAvatar, item.getUserAvatar())
.setVisible(R.id.tweetRT, item.isRetweet())
.linkify(R.id.tweetText);
}
}
#Use Animation
// Turn animation
quickAdapter.openLoadAnimation();
// Turn animation and set animate
quickAdapter.openLoadAnimation(BaseQuickAdapter.ALPHAIN);
// Turn animation and set custom animate
quickAdapter.openLoadAnimation(new BaseAnimation() {
@Override
public Animator[] getAnimators(View view) {
return new Animator[]{
ObjectAnimator.ofFloat(view, "scaleY", 1, 1.1f, 1),
ObjectAnimator.ofFloat(view, "scaleX", 1, 1.1f, 1)
};
}
});
#Features
setOnRecyclerViewItemClickListener()openLoadAnimation()setFirstOnly()
setText()CallssetText(String)on any TextView.setAlpha()CallssetAlpha(float)on any View.setVisible()CallssetVisibility(int)on any View.linkify()CallsLinkify.addLinks(view, ALL)on any TextView.setTypeface()CallssetTypeface(Typeface)on any TextView.setProgress()CallssetProgress(int)on any ProgressBar.setMax()CallssetMax(int)on any ProgressBar.setRating()CallssetRating(int)on any RatingBar.setImageResource()CallssetImageResource(int)on any ImageView.setImageDrawable()CallssetImageDrawable(Drawable)on any ImageView.setImageBitmap()CallssetImageBitmap(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()


