gt:             animatorSet.addListener(new AnimatorListenerAdapter() {
context: package com.like;
  
  import android.animation.Animator;
  import android.animation.AnimatorListenerAdapter;
  import android.animation.AnimatorSet;
  import android.animation.ObjectAnimator;
  import android.content.Context;
  import android.content.res.TypedArray;
  import android.graphics.drawable.Drawable;
  import android.support.annotation.ColorRes;
  import android.support.annotation.DrawableRes;
  import android.support.v4.content.ContextCompat;
  import android.util.AttributeSet;
  import android.view.LayoutInflater;
  import android.view.MotionEvent;
  import android.view.View;
  import android.view.animation.AccelerateDecelerateInterpolator;
  import android.view.animation.DecelerateInterpolator;
  import android.view.animation.OvershootInterpolator;
  import android.widget.FrameLayout;
  import android.widget.ImageView;
  
  import com.like.view.R;
  
  import java.util.List;
  
  
  public class LikeButton extends FrameLayout implements View.OnClickListener {
      private static final DecelerateInterpolator DECCELERATE_INTERPOLATOR = new DecelerateInterpolator();
      private static final AccelerateDecelerateInterpolator ACCELERATE_DECELERATE_INTERPOLATOR = new AccelerateDecelerateInterpolator();
      private static final OvershootInterpolator OVERSHOOT_INTERPOLATOR = new OvershootInterpolator(4);
  
      private ImageView icon;
      private DotsView dotsView;
      private CircleView circleView;
      private Icon currentIcon;
      private OnLikeListener likeListener;
      private int dotPrimaryColor;
      private int dotSecondaryColor;
      private int circleStartColor;
      private int circleEndColor;
      private int iconSize;
  
  
      private float animationScaleFactor;
  
      private boolean isChecked;
  
  
      private boolean isEnabled;
      private AnimatorSet animatorSet;
  
      private Drawable likeDrawable;
      private Drawable unLikeDrawable;
  
      public LikeButton(Context context) {
          this(context, null);
      }
  
      public LikeButton(Context context, AttributeSet attrs) {
          this(context, attrs, 0);
      }
  
      public LikeButton(Context context, AttributeSet attrs, int defStyleAttr) {
          super(context, attrs, defStyleAttr);
          init(context, attrs, defStyleAttr);
      }
  
      /**
       * Does all the initial setup of the button such as retrieving all the attributes that were
       * set in xml and inflating the like button's view and initial state.
       * @param context
       * @param attrs
       * @param defStyle
       */
      private void init(Context context, AttributeSet attrs, int defStyle) {
          LayoutInflater.from(getContext()).inflate(R.layout.likeview, this, true);
          icon = (ImageView) findViewById(R.id.icon);
          dotsView = (DotsView) findViewById(R.id.dots);
          circleView = (CircleView) findViewById(R.id.circle);
  
          final TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.LikeButton, defStyle, 0);
  
          iconSize = array.getDimensionPixelSize(R.styleable.LikeButton_icon_size, -1);
          if (iconSize == -1)
              iconSize = 40;
  
          String iconType = array.getString(R.styleable.LikeButton_icon_type);
  
          likeDrawable = array.getDrawable(R.styleable.LikeButton_like_drawable);
  
          if(likeDrawable!=null)
              setLikeDrawable(likeDrawable);
  
          unLikeDrawable = array.getDrawable(R.styleable.LikeButton_unlike_drawable);
  
          if(unLikeDrawable !=null)
              setUnlikeDrawable(unLikeDrawable);
  
          if (iconType != null)
              if (!iconType.isEmpty())
                  currentIcon = parseIconType(iconType);
  
  
          circleStartColor = array.getColor(R.styleable.LikeButton_circle_start_color, 0);
  
          if (circleStartColor != 0)
              circleView.setStartColor(circleStartColor);
  
          circleEndColor = array.getColor(R.styleable.LikeButton_circle_end_color, 0);
  
          if (circleEndColor != 0)
              circleView.setEndColor(circleEndColor);
  
          dotPrimaryColor = array.getColor(R.styleable.LikeButton_dots_primary_color, 0);
          dotSecondaryColor = array.getColor(R.styleable.LikeButton_dots_secondary_color, 0);
  
          if (dotPrimaryColor != 0 && dotSecondaryColor != 0) {
              dotsView.setColors(dotPrimaryColor, dotSecondaryColor);
          }
  
  
          if (likeDrawable == null && unLikeDrawable == null) {
              if (currentIcon != null) {
  
                  setLikeDrawableRes(currentIcon.getOnIconResourceId());
                  setUnlikeDrawableRes(currentIcon.getOffIconResourceId());
              } else {
                  currentIcon = parseIconType(IconType.Heart);
                  setLikeDrawableRes(currentIcon.getOnIconResourceId());
                  setUnlikeDrawableRes(currentIcon.getOffIconResourceId());
  
              }
          }
  
          setEnabled(array.getBoolean(R.styleable.LikeButton_enabled,true));
          Boolean status = array.getBoolean(R.styleable.LikeButton_liked,false);
          setAnimationScaleFactor(array.getFloat(R.styleable.LikeButton_anim_scale_factor,3));
          setLiked(status);
          setOnClickListener(this);
          array.recycle();
      }
  
      /**
       * This triggers the entire functionality of the button such as icon changes,
       * animations, listeners etc.
       * @param v
       */
      @Override
      public void onClick(View v) {
  
          if(!isEnabled)
              return;
  
          isChecked = !isChecked;
  
          icon.setImageDrawable(isChecked ? likeDrawable : unLikeDrawable);
  
          if (likeListener != null) {
              if (isChecked) {
                  likeListener.liked(this);
              } else {
                  likeListener.unLiked(this);
              }
          }
  
          if (animatorSet != null) {
              animatorSet.cancel();
          }
  
          if (isChecked) {
              icon.animate().cancel();
              icon.setScaleX(0);
              icon.setScaleY(0);
              circleView.setInnerCircleRadiusProgress(0);
              circleView.setOuterCircleRadiusProgress(0);
              dotsView.setCurrentProgress(0);
  
              animatorSet = new AnimatorSet();
  
              ObjectAnimator outerCircleAnimator = ObjectAnimator.ofFloat(circleView, CircleView.OUTER_CIRCLE_RADIUS_PROGRESS, 0.1f, 1f);
              outerCircleAnimator.setDuration(250);
              outerCircleAnimator.setInterpolator(DECCELERATE_INTERPOLATOR);
  
              ObjectAnimator innerCircleAnimator = ObjectAnimator.ofFloat(circleView, CircleView.INNER_CIRCLE_RADIUS_PROGRESS, 0.1f, 1f);
              innerCircleAnimator.setDuration(200);
              innerCircleAnimator.setStartDelay(200);
              innerCircleAnimator.setInterpolator(DECCELERATE_INTERPOLATOR);
  
              ObjectAnimator starScaleYAnimator = ObjectAnimator.ofFloat(icon, ImageView.SCALE_Y, 0.2f, 1f);
              starScaleYAnimator.setDuration(350);
              starScaleYAnimator.setStartDelay(250);
              starScaleYAnimator.setInterpolator(OVERSHOOT_INTERPOLATOR);
  
              ObjectAnimator starScaleXAnimator = ObjectAnimator.ofFloat(icon, ImageView.SCALE_X, 0.2f, 1f);
              starScaleXAnimator.setDuration(350);
              starScaleXAnimator.setStartDelay(250);
              starScaleXAnimator.setInterpolator(OVERSHOOT_INTERPOLATOR);
  
              ObjectAnimator dotsAnimator = ObjectAnimator.ofFloat(dotsView, DotsView.DOTS_PROGRESS, 0, 1f);
              dotsAnimator.setDuration(900);
              dotsAnimator.setStartDelay(50);
              dotsAnimator.setInterpolator(ACCELERATE_DECELERATE_INTERPOLATOR);
  
              animatorSet.playTogether(
                      outerCircleAnimator,
                      innerCircleAnimator,
                      starScaleYAnimator,
                      starScaleXAnimator,
                      dotsAnimator
              );
  
  