// 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.Paint;
import android.graphics.Rect;
import android.text.TextUtils;
import android.view.Gravity;
import android.widget.TextView;
import net.lucode.hackware.magicindicator.buildins.UIUtil;
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IMeasurablePagerTitleView;

    @Override
    public void onSelected(int index, int totalCount) {
        setTextColor(mSelectedColor);
    }

    @Override
    public void onDeselected(int index, int totalCount) {
        setTextColor(mNormalColor);
    }

    @Override
    public void onLeave(int index, int totalCount, float leavePercent, boolean leftToRight) {
    }

    @Override
    public void onEnter(int index, int totalCount, float enterPercent, boolean leftToRight) {
    }

    @Override
    public int getContentLeft() {
        Rect bound = new Rect();
        getPaint().getTextBounds(getText().toString(), 0, getText().length(), bound);
        int contentWidth = bound.width();
        return getLeft() + getWidth() / 2 - contentWidth / 2;
    }

    @Override
    public int getContentTop() {
        Paint.FontMetrics metrics = getPaint().getFontMetrics();
// 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/SimplePagerTitleView.java
import android.content.Context;
import android.graphics.Paint;
import android.graphics.Rect;
import android.text.TextUtils;
import android.view.Gravity;
import android.widget.TextView;
import net.lucode.hackware.magicindicator.buildins.UIUtil;
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IMeasurablePagerTitleView;


    @Override
    public void onSelected(int index, int totalCount) {
        setTextColor(mSelectedColor);
    }

    @Override
    public void onDeselected(int index, int totalCount) {
        setTextColor(mNormalColor);
    }

    @Override
    public void onLeave(int index, int totalCount, float leavePercent, boolean leftToRight) {
    }

    @Override
    public void onEnter(int index, int totalCount, float enterPercent, boolean leftToRight) {
    }

    @Override
    public int getContentLeft() {
        Rect bound = new Rect();
        getPaint().getTextBounds(getText().toString(), 0, getText().length(), bound);
        int contentWidth = bound.width();
        return getLeft() + getWidth() / 2 - contentWidth / 2;
    }

    @Override
    public int getContentTop() {
        Paint.FontMetrics metrics = getPaint().getFontMetrics();
        float contentHeight = metrics.bottom - metrics.top;