// Path: customerlib/src/main/java/com/desperado/customerlib/view/autolayout/AutoRelativeLayout.java
// public class AutoRelativeLayout extends RelativeLayout
// {
//     private final AutoLayoutHelper mHelper = new AutoLayoutHelper(this);
// 
//     public AutoRelativeLayout(Context context)
//     {
//         super(context);
//     }
// 
//     public AutoRelativeLayout(Context context, AttributeSet attrs)
//     {
//         super(context, attrs);
//     }
// 
//     public AutoRelativeLayout(Context context, AttributeSet attrs, int defStyle)
//     {
//         super(context, attrs, defStyle);
//     }
// 
//     @TargetApi(Build.VERSION_CODES.LOLLIPOP)
//     public AutoRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
//         super(context, attrs, defStyleAttr, defStyleRes);
//     }
// 
//     @Override
//     public LayoutParams generateLayoutParams(AttributeSet attrs)
//     {
//         return new LayoutParams(getContext(), attrs);
//     }
// 
//     @Override
//     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
//     {
//         if (!isInEditMode())
//             mHelper.adjustChildren();
//         super.onMeasure(widthMeasureSpec, heightMeasureSpec);
//     }
// 
//     @Override
//     protected void onLayout(boolean changed, int left, int top, int right, int bottom)
//     {
//         super.onLayout(changed, left, top, right, bottom);
//     }
// 
// 
//     public static class LayoutParams extends RelativeLayout.LayoutParams
//             implements AutoLayoutHelper.AutoLayoutParams
//     {
//         private AutoLayoutInfo mAutoLayoutInfo;
// 
//         public LayoutParams(Context c, AttributeSet attrs)
//         {
//             super(c, attrs);
//             mAutoLayoutInfo = AutoLayoutHelper.getAutoLayoutInfo(c, attrs);
//         }
// 
//         public LayoutParams(int width, int height)
//         {
//             super(width, height);
//         }
// 
//         public LayoutParams(ViewGroup.LayoutParams source)
//         {
//             super(source);
//         }
// 
//         public LayoutParams(MarginLayoutParams source)
//         {
//             super(source);
//         }
// 
//         @Override
//         public AutoLayoutInfo getAutoLayoutInfo()
//         {
//             return mAutoLayoutInfo;
//         }
// 
// 
//     }
// }
// 
// Path: customerlib/src/main/java/com/desperado/customerlib/view/looprotaryswitchview/listener/OnItemClickListener.java
// public interface OnItemClickListener {
//      void onItemClick(int item, View view);
// }
// 
// Path: customerlib/src/main/java/com/desperado/customerlib/view/looprotaryswitchview/listener/OnItemSelectedListener.java
// public interface OnItemSelectedListener {
//      void selected(int item, View view);
// }
// 
// Path: customerlib/src/main/java/com/desperado/customerlib/view/looprotaryswitchview/listener/OnLoopViewTouchListener.java
// public interface OnLoopViewTouchListener {
//      void onTouch(MotionEvent event);
// }


import android.animation.Animator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.DecelerateInterpolator;
import com.desperado.customerlib.view.autolayout.AutoRelativeLayout;
import com.desperado.customerlib.view.looprotaryswitchview.listener.OnItemClickListener;
import com.desperado.customerlib.view.looprotaryswitchview.listener.OnItemSelectedListener;
import com.desperado.customerlib.view.looprotaryswitchview.listener.OnLoopViewTouchListener;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
package com.desperado.customerlib.view.looprotaryswitchview.view;




/***
 * 水平旋转轮播控件
 */
public class LoopRotarySwitchView extends AutoRelativeLayout {

    private final static int LoopR = 200;

    private Context con;

    private ValueAnimator restAnimator = null;//回位动画

    private ValueAnimator rAnimation = null;//半径动画

    private GestureDetector mGestureDetector = null;//手势类

    private int selectItem = 0;//当前选择项

    private int size = 0;//个数

    private float r = LoopR;//半径

    private float BEISHU = 2.5f;//倍数

    private float distance = BEISHU * r;//camera和观察的旋转物体距离， 距离越长,最大物体和最小物体比例越不明显

    private float angle = 0;//角度

    private float last_angle = 0;

    private boolean autoRotation = false;//自动旋转

    private boolean touching = false;//正在触摸

    private List<View> views = new ArrayList<View>();//子view引用列表

// Path: customerlib/src/main/java/com/desperado/customerlib/view/autolayout/AutoRelativeLayout.java
// public class AutoRelativeLayout extends RelativeLayout
// {
//     private final AutoLayoutHelper mHelper = new AutoLayoutHelper(this);
// 
//     public AutoRelativeLayout(Context context)
//     {
//         super(context);
//     }
// 
//     public AutoRelativeLayout(Context context, AttributeSet attrs)
//     {
//         super(context, attrs);
//     }
// 
//     public AutoRelativeLayout(Context context, AttributeSet attrs, int defStyle)
//     {
//         super(context, attrs, defStyle);
//     }
// 
//     @TargetApi(Build.VERSION_CODES.LOLLIPOP)
//     public AutoRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
//         super(context, attrs, defStyleAttr, defStyleRes);
//     }
// 
//     @Override
//     public LayoutParams generateLayoutParams(AttributeSet attrs)
//     {
//         return new LayoutParams(getContext(), attrs);
//     }
// 
//     @Override
//     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
//     {
//         if (!isInEditMode())
//             mHelper.adjustChildren();
//         super.onMeasure(widthMeasureSpec, heightMeasureSpec);
//     }
// 
//     @Override
//     protected void onLayout(boolean changed, int left, int top, int right, int bottom)
//     {
//         super.onLayout(changed, left, top, right, bottom);
//     }
// 
// 
//     public static class LayoutParams extends RelativeLayout.LayoutParams
//             implements AutoLayoutHelper.AutoLayoutParams
//     {
//         private AutoLayoutInfo mAutoLayoutInfo;
// 
//         public LayoutParams(Context c, AttributeSet attrs)
//         {
//             super(c, attrs);
//             mAutoLayoutInfo = AutoLayoutHelper.getAutoLayoutInfo(c, attrs);
//         }
// 
//         public LayoutParams(int width, int height)
//         {
//             super(width, height);
//         }
// 
//         public LayoutParams(ViewGroup.LayoutParams source)
//         {
//             super(source);
//         }
// 
//         public LayoutParams(MarginLayoutParams source)
//         {
//             super(source);
//         }
// 
//         @Override
//         public AutoLayoutInfo getAutoLayoutInfo()
//         {
//             return mAutoLayoutInfo;
//         }
// 
// 
//     }
// }
// 
// Path: customerlib/src/main/java/com/desperado/customerlib/view/looprotaryswitchview/listener/OnItemClickListener.java
// public interface OnItemClickListener {
//      void onItemClick(int item, View view);
// }
// 
// Path: customerlib/src/main/java/com/desperado/customerlib/view/looprotaryswitchview/listener/OnItemSelectedListener.java
// public interface OnItemSelectedListener {
//      void selected(int item, View view);
// }
// 
// Path: customerlib/src/main/java/com/desperado/customerlib/view/looprotaryswitchview/listener/OnLoopViewTouchListener.java
// public interface OnLoopViewTouchListener {
//      void onTouch(MotionEvent event);
// }


// Path: customerlib/src/main/java/com/desperado/customerlib/view/looprotaryswitchview/view/LoopRotarySwitchView.java
import android.animation.Animator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.DecelerateInterpolator;
import com.desperado.customerlib.view.autolayout.AutoRelativeLayout;
import com.desperado.customerlib.view.looprotaryswitchview.listener.OnItemClickListener;
import com.desperado.customerlib.view.looprotaryswitchview.listener.OnItemSelectedListener;
import com.desperado.customerlib.view.looprotaryswitchview.listener.OnLoopViewTouchListener;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

package com.desperado.customerlib.view.looprotaryswitchview.view;




/***
 * 水平旋转轮播控件
 */
public class LoopRotarySwitchView extends AutoRelativeLayout {

    private final static int LoopR = 200;

    private Context con;

    private ValueAnimator restAnimator = null;//回位动画

    private ValueAnimator rAnimation = null;//半径动画

    private GestureDetector mGestureDetector = null;//手势类

    private int selectItem = 0;//当前选择项

    private int size = 0;//个数

    private float r = LoopR;//半径

    private float BEISHU = 2.5f;//倍数

    private float distance = BEISHU * r;//camera和观察的旋转物体距离， 距离越长,最大物体和最小物体比例越不明显

    private float angle = 0;//角度

    private float last_angle = 0;

    private boolean autoRotation = false;//自动旋转

    private boolean touching = false;//正在触摸

    private List<View> views = new ArrayList<View>();//子view引用列表

    private OnItemSelectedListener onItemSelectedListener = null;//选择事件接口