// Path: magicindicator/src/main/java/net/lucode/hackware/magicindicator/buildins/UIUtil.java
// public final class UIUtil {
// 
//     public static int dip2px(Context context, double dpValue) {
//         float density = context.getResources().getDisplayMetrics().density;
//         return (int) (dpValue * density + 0.5);
//     }
// 
//     public static int getScreenWidth(Context context) {
//         return context.getResources().getDisplayMetrics().widthPixels;
//     }
// }
// 
// Path: magicindicator/src/main/java/net/lucode/hackware/magicindicator/buildins/commonnavigator/abs/IMeasurablePagerTitleView.java
// public interface IMeasurablePagerTitleView extends IPagerTitleView {
//     int getContentLeft();
// 
//     int getContentTop();
// 
//     int getContentRight();
// 
//     int getContentBottom();
// }


import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.view.View;
import net.lucode.hackware.magicindicator.buildins.UIUtil;
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IMeasurablePagerTitleView;
package net.lucode.hackware.magicindicator.buildins.commonnavigator.titles;



/**
 * 类似今日头条切换效果的指示器标题
 * 博客: http://hackware.lucode.net
 * Created by hackware on 2016/6/26.
 */
public class ClipPagerTitleView extends View implements IMeasurablePagerTitleView {
    private String mText;
    private int mTextColor;
    private int mClipColor;
    private boolean mLeftToRight;
    private float mClipPercent;

    private Paint mPaint;
    private Rect mTextBounds = new Rect();

    public ClipPagerTitleView(Context context) {
        super(context);
        init(context);
    }

    private void init(Context context) {
// Path: magicindicator/src/main/java/net/lucode/hackware/magicindicator/buildins/UIUtil.java
// public final class UIUtil {
// 
//     public static int dip2px(Context context, double dpValue) {
//         float density = context.getResources().getDisplayMetrics().density;
//         return (int) (dpValue * density + 0.5);
//     }
// 
//     public static int getScreenWidth(Context context) {
//         return context.getResources().getDisplayMetrics().widthPixels;
//     }
// }
// 
// Path: magicindicator/src/main/java/net/lucode/hackware/magicindicator/buildins/commonnavigator/abs/IMeasurablePagerTitleView.java
// public interface IMeasurablePagerTitleView extends IPagerTitleView {
//     int getContentLeft();
// 
//     int getContentTop();
// 
//     int getContentRight();
// 
//     int getContentBottom();
// }


// Path: magicindicator/src/main/java/net/lucode/hackware/magicindicator/buildins/commonnavigator/titles/ClipPagerTitleView.java
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.view.View;
import net.lucode.hackware.magicindicator.buildins.UIUtil;
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IMeasurablePagerTitleView;

package net.lucode.hackware.magicindicator.buildins.commonnavigator.titles;



/**
 * 类似今日头条切换效果的指示器标题
 * 博客: http://hackware.lucode.net
 * Created by hackware on 2016/6/26.
 */
public class ClipPagerTitleView extends View implements IMeasurablePagerTitleView {
    private String mText;
    private int mTextColor;
    private int mClipColor;
    private boolean mLeftToRight;
    private float mClipPercent;

    private Paint mPaint;
    private Rect mTextBounds = new Rect();

    public ClipPagerTitleView(Context context) {
        super(context);
        init(context);
    }

    private void init(Context context) {
        int textSize = UIUtil.dip2px(context, 16);