点赞按钮 - LikeView

2017-05-27      79      Android
项目简介

LikeView

LikeView(Just like Twitter)

How to use

1.Add naturalloadingview in your xml layout:

<com.jaren.lib.view.LikeView
      android:id="@+id/lv"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      app:cirRadius="10dp"
      app:cycleTime="2000"
      app:defaultColor="#ff657487" />

2.Add OnClickListener in your Java file:

lv = (LikeView) findViewById(R.id.lv);
      lv.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              Log.i("LikeView", "onClick"+lv.getState());
          }
      });

LikeView has the following xml attributes

You can customize the look and behavior of theLikeViewin xml. Use the following attributes in xml.

  • defaultColor
  • cirRadius
  • cycleTime