Skip to content

Pyuming/BaseRecyclerViewAdapterHelper

 
 

Repository files navigation

BaseRecyclerViewAdapterHelper

Custom.gif AlphaIn_ScaleIn.gif SlideInBottom_SlideInLeft.gif

Get it

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

BaseQuickAdapter

  • setOnRecyclerViewItemClickListener()
  • openLoadAnimation()
  • setFirstOnly()

BaseViewHolder

  • 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()

About

Easy to use ,Powerful and flexible RecyclerAdapter for loading animation

Resources

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages

  • Java 100.0%