// Path: app/src/main/kotlin/me/sweetll/tucao/widget/BubbleUtils.java
// static int dp2px(int dp) {
//     return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp,
//             Resources.getSystem().getDisplayMetrics());
// }
// 
// Path: app/src/main/kotlin/me/sweetll/tucao/widget/BubbleUtils.java
// static int sp2px(int sp) {
//     return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp,
//             Resources.getSystem().getDisplayMetrics());
// }


import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Bundle;
import android.os.Parcelable;
import androidx.annotation.IntDef;
import androidx.core.content.ContextCompat;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.view.animation.LinearInterpolator;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.math.BigDecimal;
import me.sweetll.tucao.R;
import static me.sweetll.tucao.widget.BubbleSeekBar.TextPosition.BELOW_SECTION_MARK;
import static me.sweetll.tucao.widget.BubbleSeekBar.TextPosition.BOTTOM_SIDES;
import static me.sweetll.tucao.widget.BubbleSeekBar.TextPosition.SIDES;
import static me.sweetll.tucao.widget.BubbleUtils.dp2px;
import static me.sweetll.tucao.widget.BubbleUtils.sp2px;
        if (!isThumbOnDragging) {
            mThumbCenterX = mTrackLength / mDelta * (mProgress - mMin) + xLeft;
        }

        // draw thumbText
        if (isShowThumbText && !isThumbOnDragging && isTouchToSeekAnimEnd) {
            mPaint.setColor(mThumbTextColor);
            mPaint.setTextSize(mThumbTextSize);
            mPaint.getTextBounds("0123456789", 0, "0123456789".length(), mRectText); // compute solid height
            float y_ = yTop + mRectText.height() + mThumbRadiusOnDragging + mTextSpace;

            if (isFloatType || (isShowProgressInFloat && mSectionTextPosition == BOTTOM_SIDES &&
                    mProgress != mMin && mProgress != mMax)) {
                canvas.drawText(String.valueOf(getProgressFloat()), mThumbCenterX, y_, mPaint);
            } else {
                canvas.drawText(String.valueOf(getProgress()), mThumbCenterX, y_, mPaint);
            }
        }

        // draw track
        mPaint.setColor(mSecondTrackColor);
        mPaint.setStrokeWidth(mSecondTrackSize);
        canvas.drawLine(xLeft, yTop, mThumbCenterX, yTop, mPaint);

        // draw second track
        mPaint.setColor(mTrackColor);
        mPaint.setStrokeWidth(mTrackSize);
        canvas.drawLine(mThumbCenterX, yTop, xRight, yTop, mPaint);

        // draw thumb
// Path: app/src/main/kotlin/me/sweetll/tucao/widget/BubbleUtils.java
// static int dp2px(int dp) {
//     return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp,
//             Resources.getSystem().getDisplayMetrics());
// }
// 
// Path: app/src/main/kotlin/me/sweetll/tucao/widget/BubbleUtils.java
// static int sp2px(int sp) {
//     return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp,
//             Resources.getSystem().getDisplayMetrics());
// }


// Path: app/src/main/kotlin/me/sweetll/tucao/widget/BubbleSeekBar.java
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Bundle;
import android.os.Parcelable;
import androidx.annotation.IntDef;
import androidx.core.content.ContextCompat;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.view.animation.LinearInterpolator;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.math.BigDecimal;
import me.sweetll.tucao.R;
import static me.sweetll.tucao.widget.BubbleSeekBar.TextPosition.BELOW_SECTION_MARK;
import static me.sweetll.tucao.widget.BubbleSeekBar.TextPosition.BOTTOM_SIDES;
import static me.sweetll.tucao.widget.BubbleSeekBar.TextPosition.SIDES;
import static me.sweetll.tucao.widget.BubbleUtils.dp2px;
import static me.sweetll.tucao.widget.BubbleUtils.sp2px;

        if (!isThumbOnDragging) {
            mThumbCenterX = mTrackLength / mDelta * (mProgress - mMin) + xLeft;
        }

        // draw thumbText
        if (isShowThumbText && !isThumbOnDragging && isTouchToSeekAnimEnd) {
            mPaint.setColor(mThumbTextColor);
            mPaint.setTextSize(mThumbTextSize);
            mPaint.getTextBounds("0123456789", 0, "0123456789".length(), mRectText); // compute solid height
            float y_ = yTop + mRectText.height() + mThumbRadiusOnDragging + mTextSpace;

            if (isFloatType || (isShowProgressInFloat && mSectionTextPosition == BOTTOM_SIDES &&
                    mProgress != mMin && mProgress != mMax)) {
                canvas.drawText(String.valueOf(getProgressFloat()), mThumbCenterX, y_, mPaint);
            } else {
                canvas.drawText(String.valueOf(getProgress()), mThumbCenterX, y_, mPaint);
            }
        }

        // draw track
        mPaint.setColor(mSecondTrackColor);
        mPaint.setStrokeWidth(mSecondTrackSize);
        canvas.drawLine(xLeft, yTop, mThumbCenterX, yTop, mPaint);

        // draw second track
        mPaint.setColor(mTrackColor);
        mPaint.setStrokeWidth(mTrackSize);
        canvas.drawLine(mThumbCenterX, yTop, xRight, yTop, mPaint);

        // draw thumb
        mPaint.setColor(mThumbColor);