package com.epson.cameracopy.p006ui;

import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.DashPathEffect;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathEffect;
import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Region;
import android.graphics.drawable.BitmapDrawable;
import android.os.Debug;
import android.os.Handler;
import android.os.Message;
import android.support.p000v4.internal.view.SupportMenu;
import android.support.p000v4.view.InputDeviceCompat;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
import java.util.ArrayList;
import java.util.List;

/* renamed from: com.epson.cameracopy.ui.ImageCollectView */
public class ImageCollectView extends View {
    private static final float DRAG_EDGE_STROKE_WIDTH = 1.0f;
    private static final float MESSAGE_TEXT_SIZE = 10.0f;
    private static final float RADIUS_CROP_CIRCLE = 16.0f;
    private static final float SCALE_RANGE_MAX = 4.0f;
    private static final float SCALE_RANGE_MIN = 1.0f;
    private static final float STROKE_WIDTH_DRAG_PATH = 20.0f;
    private static final int TOUCH_STATE_DOWN_MOVE = 0;
    private static final int TOUCH_STATE_IDOLE = -1;
    private static final int TOUCH_STATE_UP = 1;
    private static final float VIEW_MARGINE = 6.0f;
    public static final int VIEW_MODE_COLOR_ADJUSTMENT_ALL = 2;
    public static final int VIEW_MODE_COLOR_ADJUSTMENT_PART = 3;
    public static final int VIEW_MODE_CROP_IMAGE = 0;
    public static final int VIEW_MODE_ENHANCE_TEXT = 1;
    private int[] INVERT = {1, 0};
    private Bitmap mBitmapImage = null;
    private Bitmap mBitmapMask = null;
    private Canvas mCanvasMask = null;
    private Context mContext = null;
    /* access modifiers changed from: private */
    public Data mData = null;
    private GestureDetector mGestureDetector = null;
    private boolean mGetCropPoint = false;
    private Handler mHandlerAvtivity = null;
    /* access modifiers changed from: private */
    public int mOrient = 0;
    private PathEffectData mPathEffectData = null;
    private ScaleGestureDetector mScaleGestureDetector = null;
    private int mViewMode = 0;
    private final GestureDetector.SimpleOnGestureListener onGestureDetectorListener = new GestureDetector.SimpleOnGestureListener() {
        public boolean onDoubleTap(MotionEvent motionEvent) {
            ImageCollectView.this.ResetScalePos(true);
            ImageCollectView.this.invalidate();
            return super.onDoubleTap(motionEvent);
        }

        public boolean onDoubleTapEvent(MotionEvent motionEvent) {
            return super.onDoubleTapEvent(motionEvent);
        }

        public boolean onDown(MotionEvent motionEvent) {
            return super.onDown(motionEvent);
        }

        public void onLongPress(MotionEvent motionEvent) {
            super.onLongPress(motionEvent);
        }

        public void onShowPress(MotionEvent motionEvent) {
            super.onShowPress(motionEvent);
        }

        public boolean onSingleTapConfirmed(MotionEvent motionEvent) {
            return super.onSingleTapConfirmed(motionEvent);
        }

        public boolean onSingleTapUp(MotionEvent motionEvent) {
            return super.onSingleTapUp(motionEvent);
        }

        public boolean onFling(MotionEvent motionEvent, MotionEvent motionEvent2, float f, float f2) {
            return super.onFling(motionEvent, motionEvent2, f, f2);
        }

        public boolean onScroll(MotionEvent motionEvent, MotionEvent motionEvent2, float f, float f2) {
            return super.onScroll(motionEvent, motionEvent2, f, f2);
        }
    };
    private final ScaleGestureDetector.SimpleOnScaleGestureListener onScaleGestureDetector = new ScaleGestureDetector.SimpleOnScaleGestureListener() {
        public boolean onScaleBegin(ScaleGestureDetector scaleGestureDetector) {
            return super.onScaleBegin(scaleGestureDetector);
        }

        public boolean onScale(ScaleGestureDetector scaleGestureDetector) {
            ImageCollectView.this.SetScale(scaleGestureDetector.getScaleFactor());
            ImageCollectView.this.invalidate();
            return true;
        }

        public void onScaleEnd(ScaleGestureDetector scaleGestureDetector) {
            ImageCollectView.this.SetScale(scaleGestureDetector.getScaleFactor());
            ImageCollectView.this.invalidate();
            super.onScaleEnd(scaleGestureDetector);
        }
    };

    private void TouchEventColorAdjustmentAll(MotionEvent motionEvent) {
    }

    /* renamed from: com.epson.cameracopy.ui.ImageCollectView$DataCropImage */
    class DataCropImage {
        public PointF[] mPointPreviewCrop;
        public PointF mPointPreviewTouch;
        public RectF[] mRectCropMovableArea;
        public RectF[] mRectCropTapArea;
        public int mSelectArea;

        DataCropImage() {
            this.mRectCropTapArea = null;
            this.mRectCropMovableArea = null;
            this.mPointPreviewCrop = null;
            this.mPointPreviewTouch = null;
            this.mRectCropTapArea = new RectF[5];
            this.mRectCropTapArea[0] = new RectF();
            this.mRectCropTapArea[1] = new RectF();
            this.mRectCropTapArea[2] = new RectF();
            this.mRectCropTapArea[3] = new RectF();
            this.mRectCropTapArea[4] = new RectF();
            this.mRectCropMovableArea = new RectF[4];
            this.mRectCropMovableArea[0] = new RectF();
            this.mRectCropMovableArea[1] = new RectF();
            this.mRectCropMovableArea[2] = new RectF();
            this.mRectCropMovableArea[3] = new RectF();
            this.mPointPreviewCrop = new PointF[4];
            this.mPointPreviewCrop[0] = new PointF();
            this.mPointPreviewCrop[1] = new PointF();
            this.mPointPreviewCrop[2] = new PointF();
            this.mPointPreviewCrop[3] = new PointF();
            this.mPointPreviewTouch = new PointF();
            this.mSelectArea = -1;
        }
    }

    /* renamed from: com.epson.cameracopy.ui.ImageCollectView$DataEnhanceText */
    class DataEnhanceText {
        DataEnhanceText() {
        }
    }

    /* renamed from: com.epson.cameracopy.ui.ImageCollectView$DataColorAdjust */
    class DataColorAdjust {
        public List<List<PointF>> mPointArray;
        public List<List<PointF>> mPointEdgeArray;
        public List<PointF> mPointMoveArray;

        DataColorAdjust() {
            this.mPointArray = null;
            this.mPointMoveArray = null;
            this.mPointEdgeArray = null;
            this.mPointArray = new ArrayList();
            this.mPointMoveArray = new ArrayList();
            this.mPointEdgeArray = new ArrayList();
        }
    }

    /* renamed from: com.epson.cameracopy.ui.ImageCollectView$DataDrawPreview */
    class DataDrawPreview {
        public BitmapDrawable mBitmapDrawable;
        public Matrix mMatrixBitmap;
        public PointF mPointInitOffset;
        public PointF[] mPointMoveDeff;
        public PointF mPointMovePoint;
        public RectF mRectBitmap;
        public RectF mRectDrawScale;
        public float[] mScale;

        DataDrawPreview() {
            this.mBitmapDrawable = null;
            this.mMatrixBitmap = null;
            this.mRectBitmap = null;
            this.mRectDrawScale = null;
            this.mPointInitOffset = null;
            this.mPointMovePoint = null;
            this.mPointMoveDeff = null;
            this.mMatrixBitmap = new Matrix();
            this.mRectBitmap = new RectF(0.0f, 0.0f, 0.0f, 0.0f);
            this.mRectDrawScale = new RectF(0.0f, 0.0f, 0.0f, 0.0f);
            this.mPointInitOffset = new PointF();
            this.mPointMovePoint = new PointF(0.0f, 0.0f);
            this.mPointMoveDeff = new PointF[2];
            this.mPointMoveDeff[0] = new PointF(0.0f, 0.0f);
            this.mPointMoveDeff[1] = new PointF(0.0f, 0.0f);
            this.mScale = new float[2];
            float[] fArr = this.mScale;
            fArr[0] = 1.0f;
            fArr[1] = 1.0f;
        }
    }

    /* renamed from: com.epson.cameracopy.ui.ImageCollectView$Data */
    class Data {

        /* renamed from: d */
        public C0884D[] f133d;
        /* access modifiers changed from: private */
        public boolean mFlagScale;
        public Paint mPaintCropCircleDeselected;
        public Paint mPaintCropCircleSelect;
        public Paint mPaintCropLine;
        public Paint mPaintCropMovableArea;
        public Paint mPaintCropTapArea;
        public Paint mPaintDragEdge;
        public Paint mPaintDragMask;
        public Paint mPaintDragOff;
        public Paint mPaintDragOn;
        public Paint mPaintImageArea;
        public Paint mPaintMessageArea;
        public Paint mPaintPreviewImage;
        public Paint mPaintTextMessage;
        public Paint mPaintView;
        public PointF[] mPointCrop;
        public PointF[] mPointViewMargine;
        public float mRadiusCropCircle;
        public boolean mShowTextMessage;
        float mStrokeWidth;
        public String mTextMessage;
        public TimerCropImageCropCircle mTimerCropImageCropCircle;
        public int mTouchState;

        /* renamed from: com.epson.cameracopy.ui.ImageCollectView$Data$D */
        class C0884D {
            public DataColorAdjust dca = null;
            public DataCropImage dcm = null;
            public DataDrawPreview[] ddp = null;
            public DataEnhanceText det = null;
            public float[] mBaseScale;
            public PointF mPointPreviewImageOffset = null;
            public RectF mRectImageArea = null;
            public RectF mRectMessageArea = null;
            public RectF mRectPreviewImage = null;
            public RectF mRectView = null;

            public C0884D() {
                this.dcm = new DataCropImage();
                this.det = new DataEnhanceText();
                this.dca = new DataColorAdjust();
                this.ddp = new DataDrawPreview[4];
                this.ddp[0] = new DataDrawPreview();
                this.ddp[1] = new DataDrawPreview();
                this.ddp[2] = new DataDrawPreview();
                this.ddp[3] = new DataDrawPreview();
                this.mRectView = new RectF();
                this.mRectImageArea = new RectF();
                this.mRectPreviewImage = new RectF();
                this.mRectMessageArea = new RectF();
                this.mPointPreviewImageOffset = new PointF();
                this.mBaseScale = new float[2];
                float[] fArr = this.mBaseScale;
                fArr[0] = 1.0f;
                fArr[1] = 1.0f;
            }
        }

        public Data() {
            this.f133d = null;
            this.mPointCrop = null;
            this.mPaintView = null;
            this.mPaintPreviewImage = null;
            this.mPaintImageArea = null;
            this.mPaintCropLine = null;
            this.mPaintCropCircleSelect = null;
            this.mPaintCropCircleDeselected = null;
            this.mPaintDragOn = null;
            this.mPaintDragOff = null;
            this.mPaintDragMask = null;
            this.mPaintDragEdge = null;
            this.mPaintCropTapArea = null;
            this.mPaintCropMovableArea = null;
            this.mPointViewMargine = null;
            this.mTimerCropImageCropCircle = null;
            this.mTextMessage = null;
            this.mPaintTextMessage = null;
            this.mPaintMessageArea = null;
            this.mFlagScale = false;
            this.f133d = new C0884D[2];
            this.f133d[0] = new C0884D();
            this.f133d[1] = new C0884D();
            this.mPointCrop = new PointF[4];
            this.mPointCrop[0] = new PointF();
            this.mPointCrop[1] = new PointF();
            this.mPointCrop[2] = new PointF();
            this.mPointCrop[3] = new PointF();
            this.mPaintView = new Paint();
            this.mPaintPreviewImage = new Paint();
            this.mPaintImageArea = new Paint();
            this.mPaintCropLine = new Paint();
            this.mPaintCropCircleSelect = new Paint();
            this.mPaintCropCircleDeselected = new Paint();
            this.mPaintDragOn = new Paint();
            this.mPaintDragOff = new Paint();
            this.mPaintDragMask = new Paint();
            this.mPaintDragEdge = new Paint();
            this.mPaintCropTapArea = new Paint();
            this.mPaintCropMovableArea = new Paint();
            this.mPointViewMargine = new PointF[4];
            this.mTextMessage = "";
            this.mPaintTextMessage = new Paint();
            this.mPaintMessageArea = new Paint();
            this.mTouchState = -1;
        }
    }

    public ImageCollectView(Context context) {
        super(context);
        if (!isInEditMode()) {
            init(context);
        }
    }

    public ImageCollectView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        if (!isInEditMode()) {
            init(context);
        }
    }

    public ImageCollectView(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        if (!isInEditMode()) {
            init(context);
        }
    }

    private void init(Context context) {
        this.mContext = context;
        DisplayMetrics displayMetrics = new DisplayMetrics();
        ((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
        float f = displayMetrics.density;
        float f2 = RADIUS_CROP_CIRCLE * f;
        float f3 = VIEW_MARGINE * f;
        float f4 = 20.0f * f;
        this.mData = new Data();
        Data data = this.mData;
        data.mStrokeWidth = f4;
        data.mRadiusCropCircle = f2;
        float f5 = f2 + f3;
        data.mPointViewMargine[0] = new PointF(f5, f5);
        this.mData.mPointViewMargine[1] = new PointF(f3, f3);
        this.mData.mPointViewMargine[2] = new PointF(f3, f3);
        this.mData.mPointViewMargine[3] = new PointF(f3, f3);
        this.mData.mPaintView.setStyle(Paint.Style.STROKE);
        this.mData.mPaintView.setColor(-65281);
        this.mData.mPaintView.setStrokeWidth(2.0f);
        this.mData.mPaintImageArea.setStyle(Paint.Style.STROKE);
        this.mData.mPaintImageArea.setColor(InputDeviceCompat.SOURCE_ANY);
        this.mData.mPaintPreviewImage.setStyle(Paint.Style.STROKE);
        this.mData.mPaintPreviewImage.setColor(-16776961);
        this.mData.mPaintCropLine.setStyle(Paint.Style.STROKE);
        this.mData.mPaintCropLine.setColor(-16711936);
        this.mData.mPaintCropLine.setStrokeWidth(2.0f);
        this.mData.mPaintCropCircleSelect.setStyle(Paint.Style.STROKE);
        this.mData.mPaintCropCircleSelect.setColor(SupportMenu.CATEGORY_MASK);
        this.mData.mPaintCropCircleDeselected.setStyle(Paint.Style.FILL);
        this.mData.mPaintCropCircleDeselected.setColor(Color.argb(76, 255, 0, 0));
        this.mData.mPaintDragOn.setStyle(Paint.Style.STROKE);
        this.mData.mPaintDragOn.setColor(Color.argb(76, 0, 255, 0));
        this.mData.mPaintDragOn.setStrokeWidth(f4);
        this.mData.mPaintDragOn.setStrokeCap(Paint.Cap.ROUND);
        this.mData.mPaintDragOff.setStyle(Paint.Style.STROKE);
        this.mData.mPaintDragOff.setColor(Color.argb(76, 0, 0, 255));
        this.mData.mPaintDragOff.setStrokeWidth(f4);
        this.mData.mPaintDragOff.setStrokeCap(Paint.Cap.ROUND);
        this.mData.mPaintDragMask.setStyle(Paint.Style.STROKE);
        this.mData.mPaintDragMask.setColor(-1);
        this.mData.mPaintDragMask.setStrokeWidth(f4);
        this.mData.mPaintDragMask.setStrokeCap(Paint.Cap.ROUND);
        this.mData.mPaintDragEdge.setStyle(Paint.Style.STROKE);
        this.mData.mPaintDragEdge.setColor(SupportMenu.CATEGORY_MASK);
        this.mData.mPaintDragEdge.setStrokeWidth(1.0f * f);
        this.mData.mPaintCropTapArea.setStyle(Paint.Style.STROKE);
        this.mData.mPaintCropTapArea.setColor(-1147154);
        this.mData.mPaintCropTapArea.setStrokeWidth(3.0f);
        this.mData.mPaintCropMovableArea.setStyle(Paint.Style.STROKE);
        this.mData.mPaintCropMovableArea.setColor(-16711681);
        this.mData.mPaintTextMessage.setTextAlign(Paint.Align.CENTER);
        this.mData.mPaintTextMessage.setTextSize(f * MESSAGE_TEXT_SIZE);
        this.mData.mPaintTextMessage.setColor(SupportMenu.CATEGORY_MASK);
        this.mData.mPaintTextMessage.setAntiAlias(true);
        this.mData.mPaintMessageArea.setStyle(Paint.Style.FILL_AND_STROKE);
        this.mData.mPaintMessageArea.setColor(-855638017);
        this.mData.mTimerCropImageCropCircle = new TimerCropImageCropCircle();
        this.mGestureDetector = new GestureDetector(context, this.onGestureDetectorListener);
        this.mScaleGestureDetector = new ScaleGestureDetector(context, this.onScaleGestureDetector);
        this.mPathEffectData = new PathEffectData(this);
    }

    public void SetViewMode(int i) {
        this.mViewMode = i;
        if (this.mViewMode == 3) {
            if (this.mData.f133d[this.mOrient].dca.mPointArray != null) {
                for (List<PointF> clear : this.mData.f133d[this.mOrient].dca.mPointArray) {
                    clear.clear();
                }
                this.mData.f133d[this.mOrient].dca.mPointArray.clear();
            }
            if (this.mBitmapImage != null) {
                Bitmap bitmap = this.mBitmapMask;
                if (bitmap != null) {
                    bitmap.recycle();
                }
                this.mBitmapMask = Bitmap.createBitmap(this.mBitmapImage.getWidth(), this.mBitmapImage.getHeight(), Bitmap.Config.ARGB_8888);
                this.mCanvasMask = new Canvas(this.mBitmapMask);
            }
        }
    }

    public void SetMessage(String str) {
        this.mData.mTextMessage = new String(str);
    }

    public void SetHandler(Handler handler) {
        this.mHandlerAvtivity = handler;
    }

    public void SetPreviewBitmapAndCropData(Bitmap bitmap, PointF[] pointFArr) {
        this.mGetCropPoint = true;
        if (pointFArr == null || pointFArr.length != 4) {
            for (int i = 0; i < 4; i++) {
                this.mData.mPointCrop[i].set(0.0f, 0.0f);
            }
        } else {
            this.mData.mPointCrop[0].set(pointFArr[0]);
            this.mData.mPointCrop[1].set(pointFArr[3]);
            this.mData.mPointCrop[2].set(pointFArr[2]);
            this.mData.mPointCrop[3].set(pointFArr[1]);
        }
        SetPreviewBitmap(bitmap);
    }

    public void SetPreviewBitmapAndCropData(Bitmap bitmap) {
        for (int i = 0; i < 4; i++) {
            this.mData.mPointCrop[i].set(0.0f, 0.0f);
        }
        SetPreviewBitmap(bitmap);
    }

    private void SetPreviewBitmap(Bitmap bitmap) {
        if (this.mBitmapImage != null) {
            ReleaseBitmap();
        }
        this.mBitmapImage = bitmap;
        ResetScalePos(false);
        invalidate();
    }

    public List<List<PointF>> GetBcscPointArray() {
        return ClontPointArray(this.mData.f133d[this.mOrient].dca.mPointArray);
    }

    public float GetBcscScale() {
        return this.mData.f133d[this.mOrient].mBaseScale[1];
    }

    public float GetBcscStrokeWidth() {
        return this.mData.mStrokeWidth;
    }

    public Bitmap GetMaskImage() {
        return this.mBitmapMask;
    }

    public void SetMaskEdge(List<List<PointF>> list) {
        this.mData.f133d[this.mOrient].dca.mPointEdgeArray.clear();
        for (List<PointF> next : list) {
            if (next.size() > 0) {
                ArrayList arrayList = new ArrayList();
                for (PointF pointF : next) {
                    arrayList.add(new PointF(pointF.x * this.mData.f133d[this.mOrient].mBaseScale[1], pointF.y * this.mData.f133d[this.mOrient].mBaseScale[1]));
                }
                this.mData.f133d[this.mOrient].dca.mPointEdgeArray.add(arrayList);
            }
        }
        invalidate();
    }

    public void MessageOff() {
        this.mData.mTimerCropImageCropCircle.TimerOff();
    }

    public void ReleaseResource() {
        ReleaseBitmap();
        ReleaseMask();
        PathEffectData pathEffectData = this.mPathEffectData;
        if (pathEffectData != null) {
            pathEffectData.Cleanup();
        }
    }

    public void ReleaseBitmap() {
        for (int i = 0; i < 2; i++) {
            for (int i2 = 0; i2 < this.mData.f133d[i].ddp.length; i2++) {
                if (this.mData.f133d[i].ddp[i2].mBitmapDrawable != null) {
                    this.mData.f133d[i].ddp[i2].mBitmapDrawable = null;
                }
            }
        }
        this.mBitmapImage = null;
    }

    public void ReleaseMask() {
        Bitmap bitmap = this.mBitmapMask;
        if (bitmap != null) {
            bitmap.recycle();
            this.mBitmapMask = null;
            this.mCanvasMask = null;
        }
    }

    public PointF[] GetCropPoint() {
        PointF[] pointFArr = new PointF[4];
        PointF[] pointFArr2 = new PointF[4];
        for (int i = 0; i < 4; i++) {
            pointFArr2[i] = new PointF();
            pointFArr2[i].x = (this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[i].x - this.mData.f133d[this.mOrient].mPointPreviewImageOffset.x) / this.mData.f133d[this.mOrient].mBaseScale[1];
            pointFArr2[i].y = (this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[i].y - this.mData.f133d[this.mOrient].mPointPreviewImageOffset.y) / this.mData.f133d[this.mOrient].mBaseScale[1];
        }
        float width = (float) this.mBitmapImage.getWidth();
        float height = (float) this.mBitmapImage.getHeight();
        if (pointFArr2[0].x < 0.0f) {
            pointFArr2[0].x = 0.0f;
        }
        if (pointFArr2[0].y < 0.0f) {
            pointFArr2[0].y = 0.0f;
        }
        if (pointFArr2[1].x > width) {
            pointFArr2[1].x = width;
        }
        if (pointFArr2[1].y < 0.0f) {
            pointFArr2[1].y = 0.0f;
        }
        if (pointFArr2[2].x > width) {
            pointFArr2[2].x = width;
        }
        if (pointFArr2[2].y > height) {
            pointFArr2[2].y = height;
        }
        if (pointFArr2[3].x < 0.0f) {
            pointFArr2[3].x = 0.0f;
        }
        if (pointFArr2[3].y > height) {
            pointFArr2[3].y = height;
        }
        pointFArr[0] = pointFArr2[0];
        pointFArr[1] = pointFArr2[3];
        pointFArr[2] = pointFArr2[2];
        pointFArr[3] = pointFArr2[1];
        return pointFArr;
    }

    protected void onSizeChanged(int i, int i2, int i3, int i4) {
        int i5;
        Context context = this.mContext;
        if (context != null) {
            int rotation = ((Activity) context).getWindowManager().getDefaultDisplay().getRotation();
            i5 = (rotation == 1 || rotation == 3) ? 1 : 0;
        } else {
            i5 = 0;
        }
        boolean z = (i3 == 0 || this.mOrient == i5) ? false : true;
        this.mOrient = i5;
        Data data = this.mData;
        if (data != null && data.f133d != null && this.mData.f133d[this.mOrient].mRectView != null) {
            boolean z2 = (!z && this.mData.f133d[this.mOrient].mRectView.right == ((float) i) && this.mData.f133d[this.mOrient].mRectView.bottom == ((float) i2)) ? false : true;
            this.mData.f133d[this.mOrient].mRectView.set(0.0f, 0.0f, (float) i, (float) i2);
            float f = this.mData.mPointViewMargine[this.mViewMode].x;
            float f2 = this.mData.mPointViewMargine[this.mViewMode].y;
            this.mData.f133d[this.mOrient].mRectImageArea.set(this.mData.f133d[this.mOrient].mRectView.left + f, this.mData.f133d[this.mOrient].mRectView.top + f2, this.mData.f133d[this.mOrient].mRectView.right - f, this.mData.f133d[this.mOrient].mRectView.bottom - f2);
            float f3 = this.mData.f133d[z ? this.INVERT[this.mOrient] : this.mOrient].mBaseScale[1];
            GetPreviewImage();
            float f4 = this.mData.f133d[this.mOrient].mBaseScale[1] / f3;
            if (z) {
                int i6 = this.mViewMode;
                if (i6 == 0) {
                    if (this.mGetCropPoint && this.mData.f133d[this.INVERT[this.mOrient]].dcm.mPointPreviewCrop[3].y != 0.0f) {
                        for (int i7 = 0; i7 < 4; i7++) {
                            this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[i7].x = ((this.mData.f133d[this.INVERT[this.mOrient]].dcm.mPointPreviewCrop[i7].x - this.mData.f133d[this.INVERT[this.mOrient]].mPointPreviewImageOffset.x) * f4) + this.mData.f133d[this.mOrient].mPointPreviewImageOffset.x;
                            this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[i7].y = ((this.mData.f133d[this.INVERT[this.mOrient]].dcm.mPointPreviewCrop[i7].y - this.mData.f133d[this.INVERT[this.mOrient]].mPointPreviewImageOffset.y) * f4) + this.mData.f133d[this.mOrient].mPointPreviewImageOffset.y;
                        }
                        DataCropImage dataCropImage = this.mData.f133d[this.mOrient].dcm;
                        this.mData.f133d[this.INVERT[this.mOrient]].dcm.mSelectArea = -1;
                        dataCropImage.mSelectArea = -1;
                    }
                } else if (i6 == 1) {
                    this.mData.f133d[this.mOrient].ddp[this.mViewMode].mScale[1] = this.mData.f133d[this.INVERT[this.mOrient]].ddp[this.mViewMode].mScale[1];
                    this.mData.f133d[this.mOrient].ddp[this.mViewMode].mScale[0] = this.mData.f133d[this.INVERT[this.mOrient]].ddp[this.mViewMode].mScale[0];
                    this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[1].x = this.mData.f133d[this.INVERT[this.mOrient]].ddp[this.mViewMode].mPointMoveDeff[1].x * f4;
                    this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[1].y = this.mData.f133d[this.INVERT[this.mOrient]].ddp[this.mViewMode].mPointMoveDeff[1].y * f4;
                    this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[0].x = this.mData.f133d[this.INVERT[this.mOrient]].ddp[this.mViewMode].mPointMoveDeff[0].x * f4;
                    this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[0].y = this.mData.f133d[this.INVERT[this.mOrient]].ddp[this.mViewMode].mPointMoveDeff[0].y * f4;
                    DrawPreviewImageCalcMatrix(new Matrix());
                    DrawPreviewImagePointCheck(true);
                }
            }
            if (z2 && f4 != 0.0f && this.mViewMode == 3) {
                if (z) {
                    this.mData.f133d[this.mOrient].dca.mPointArray = ClontPointArray(this.mData.f133d[this.INVERT[this.mOrient]].dca.mPointArray);
                    this.mData.f133d[this.mOrient].dca.mPointEdgeArray = ClontPointArray(this.mData.f133d[this.INVERT[this.mOrient]].dca.mPointEdgeArray);
                }
                if (this.mData.f133d[this.mOrient].dca.mPointArray != null) {
                    for (List<PointF> it : this.mData.f133d[this.mOrient].dca.mPointArray) {
                        for (PointF pointF : it) {
                            pointF.x *= f4;
                            pointF.y *= f4;
                        }
                    }
                }
                if (this.mData.f133d[this.mOrient].dca.mPointEdgeArray != null) {
                    for (List<PointF> it2 : this.mData.f133d[this.mOrient].dca.mPointEdgeArray) {
                        for (PointF pointF2 : it2) {
                            pointF2.x *= f4;
                            pointF2.y *= f4;
                        }
                    }
                }
            }
        }
    }

    private List<List<PointF>> ClontPointArray(List<List<PointF>> list) {
        ArrayList arrayList = new ArrayList();
        if (list != null) {
            for (List<PointF> it : list) {
                ArrayList arrayList2 = new ArrayList();
                for (PointF add : it) {
                    arrayList2.add(add);
                }
                arrayList.add(arrayList2);
            }
        }
        return arrayList;
    }

    public void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        Data data = this.mData;
        if (data != null && data.f133d != null) {
            GetPreviewImage();
            int i = this.mViewMode;
            if (i == 0) {
                DrawCropImage(canvas);
            } else if (i == 1) {
                DrawEnhanceText(canvas);
            } else if (i == 2) {
                DrawColorAdjustmentAll(canvas);
            } else if (i == 3) {
                DrawColorAdjustmentPart(canvas);
            }
        }
    }

    private void DrawCropImage(Canvas canvas) {
        DrawPreviewImage(canvas);
        GetPreviewCropPoint();
        if (this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[3].y != 0.0f) {
            canvas.drawLine(this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[0].x, this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[0].y, this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[1].x, this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[1].y, this.mData.mPaintCropLine);
            canvas.drawLine(this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[1].x, this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[1].y, this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[2].x, this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[2].y, this.mData.mPaintCropLine);
            canvas.drawLine(this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[2].x, this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[2].y, this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[3].x, this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[3].y, this.mData.mPaintCropLine);
            canvas.drawLine(this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[3].x, this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[3].y, this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[0].x, this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[0].y, this.mData.mPaintCropLine);
            for (int i = 0; i < 4; i++) {
                if (i == this.mData.f133d[this.mOrient].dcm.mSelectArea) {
                    canvas.drawCircle(this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[i].x, this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[i].y, this.mData.mRadiusCropCircle, this.mData.mPaintCropCircleSelect);
                } else {
                    canvas.drawCircle(this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[i].x, this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[i].y, this.mData.mRadiusCropCircle, this.mData.mPaintCropCircleDeselected);
                }
            }
        }
    }

    private void DrawEnhanceText(Canvas canvas) {
        DrawPreviewImage(canvas);
    }

    private void DrawColorAdjustmentAll(Canvas canvas) {
        DrawPreviewImage(canvas);
        this.mData.mPaintDragEdge.setPathEffect(this.mPathEffectData.BlinkingIndex((RectF) null));
        canvas.drawRect(this.mData.f133d[this.mOrient].mRectPreviewImage, this.mData.mPaintDragEdge);
    }

    private void DrawColorAdjustmentPart(Canvas canvas) {
        DrawPreviewImage(canvas);
        float f = this.mData.f133d[this.mOrient].mRectPreviewImage.left;
        float f2 = this.mData.f133d[this.mOrient].mRectPreviewImage.top;
        float f3 = this.mData.f133d[this.mOrient].mBaseScale[1];
        Path path = new Path();
        Path path2 = new Path();
        this.mData.mPaintDragOn.setStrokeWidth(this.mData.mStrokeWidth * f3);
        for (List next : this.mData.f133d[this.mOrient].dca.mPointArray) {
            if (next.size() > 0) {
                PointF pointF = (PointF) next.get(0);
                if (next.size() > 1) {
                    path.moveTo(pointF.x + f, pointF.y + f2);
                    path2.moveTo(pointF.x / f3, pointF.y / f3);
                    for (int i = 1; i < next.size(); i++) {
                        PointF pointF2 = (PointF) next.get(i);
                        path.lineTo(pointF2.x + f, pointF2.y + f2);
                        path2.lineTo(pointF2.x / f3, pointF2.y / f3);
                    }
                }
            }
        }
        if (this.mData.mTouchState == 0) {
            int size = this.mData.f133d[this.mOrient].dca.mPointMoveArray.size();
            if (size > 0) {
                PointF pointF3 = this.mData.f133d[this.mOrient].dca.mPointMoveArray.get(0);
                if (size > 1) {
                    path.moveTo(pointF3.x + f, pointF3.y + f2);
                    for (int i2 = 1; i2 < size; i2++) {
                        PointF pointF4 = this.mData.f133d[this.mOrient].dca.mPointMoveArray.get(i2);
                        path.lineTo(pointF4.x + f, pointF4.y + f2);
                    }
                }
            }
            if (!path.isEmpty()) {
                canvas.drawPath(path, this.mData.mPaintDragOn);
            }
        } else if (path.isEmpty()) {
        } else {
            if (this.mData.mTouchState == 1) {
                this.mData.mTouchState = -1;
                if (this.mCanvasMask != null) {
                    if (!path2.isEmpty()) {
                        this.mCanvasMask.drawPath(path2, this.mData.mPaintDragMask);
                    }
                    this.mHandlerAvtivity.sendEmptyMessage(301);
                }
            } else if (this.mData.f133d[this.mOrient].dca.mPointEdgeArray != null && !this.mData.f133d[this.mOrient].dca.mPointEdgeArray.isEmpty()) {
                Path path3 = new Path();
                this.mData.mPaintDragEdge.setPathEffect(this.mPathEffectData.BlinkingIndex((RectF) null));
                for (List next2 : this.mData.f133d[this.mOrient].dca.mPointEdgeArray) {
                    if (next2.size() > 0) {
                        PointF pointF5 = (PointF) next2.get(0);
                        float f4 = pointF5.x + f;
                        float f5 = pointF5.y + f2;
                        path3.moveTo(f4, f5);
                        for (int i3 = 1; i3 < next2.size(); i3++) {
                            PointF pointF6 = (PointF) next2.get(i3);
                            path3.lineTo(pointF6.x + f, pointF6.y + f2);
                        }
                        path3.lineTo(f4, f5);
                    }
                    canvas.drawPath(path3, this.mData.mPaintDragEdge);
                    path3.reset();
                }
            }
        }
    }

    private void DrawPreviewImage(Canvas canvas) {
        if (this.mBitmapImage != null) {
            BitmapDrawable bitmapDrawable = this.mData.f133d[this.mOrient].ddp[this.mViewMode].mBitmapDrawable;
            if (bitmapDrawable == null) {
                bitmapDrawable = DrawPreviewImageGetDrawable(this.mBitmapImage, this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectBitmap);
                this.mData.f133d[this.mOrient].ddp[this.mViewMode].mBitmapDrawable = bitmapDrawable;
            }
            if (bitmapDrawable != null && DrawPreviewImageGetMatrix(this.mData.f133d[this.mOrient].ddp[this.mViewMode].mMatrixBitmap)) {
                canvas.save();
                canvas.concat(this.mData.f133d[this.mOrient].ddp[this.mViewMode].mMatrixBitmap);
                bitmapDrawable.draw(canvas);
                canvas.restore();
            }
        }
    }

    private BitmapDrawable DrawPreviewImageGetDrawable(Bitmap bitmap, RectF rectF) {
        if (bitmap == null) {
            return null;
        }
        BitmapDrawable bitmapDrawable = new BitmapDrawable(getResources(), bitmap);
        rectF.set(0.0f, 0.0f, (float) bitmap.getWidth(), (float) bitmap.getHeight());
        bitmapDrawable.setBounds(new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()));
        return bitmapDrawable;
    }

    private boolean DrawPreviewImageGetMatrix(Matrix matrix) {
        DrawPreviewImageCalcMatrix(matrix);
        if (this.mViewMode == 1 && DrawPreviewImagePointCheck(this.mData.mFlagScale)) {
            DrawPreviewImageCalcMatrix(matrix);
        }
        return true;
    }

    private boolean DrawPreviewImagePointCheck(boolean z) {
        boolean z2;
        boolean z3;
        boolean z4;
        float f;
        float f2;
        if (z) {
            if (this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.width() < this.mData.f133d[this.mOrient].mRectView.width()) {
                f = (this.mData.f133d[this.mOrient].mRectView.left + ((this.mData.f133d[this.mOrient].mRectView.width() - this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.width()) / 2.0f)) - this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.left;
            } else {
                f = this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.left > this.mData.f133d[this.mOrient].mRectView.left ? this.mData.f133d[this.mOrient].mRectView.left - this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.left : 0.0f;
                if (this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.right < this.mData.f133d[this.mOrient].mRectView.right) {
                    f = this.mData.f133d[this.mOrient].mRectView.right - this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.right;
                }
            }
            if (this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.height() < this.mData.f133d[this.mOrient].mRectView.height()) {
                f2 = (this.mData.f133d[this.mOrient].mRectView.top + ((this.mData.f133d[this.mOrient].mRectView.height() - this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.height()) / 2.0f)) - this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.top;
            } else {
                f2 = this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.top > this.mData.f133d[this.mOrient].mRectView.top ? this.mData.f133d[this.mOrient].mRectView.top - this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.top : 0.0f;
                if (this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.bottom < this.mData.f133d[this.mOrient].mRectView.bottom) {
                    f2 = this.mData.f133d[this.mOrient].mRectView.bottom - this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.bottom;
                }
            }
            if (f == 0.0f && f2 == 0.0f) {
                return false;
            }
            PointF pointF = this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[0];
            PointF pointF2 = this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[1];
            float f3 = this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[1].x + f;
            pointF2.x = f3;
            pointF.x = f3;
            PointF pointF3 = this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[0];
            PointF pointF4 = this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[1];
            float f4 = this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[1].y + f2;
            pointF4.y = f4;
            pointF3.y = f4;
            return true;
        }
        if (this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.width() < this.mData.f133d[this.mOrient].mRectView.width()) {
            this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[0].x = 0.0f;
            z2 = true;
        } else {
            z2 = this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.left > this.mData.f133d[this.mOrient].mRectView.left;
            if (this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.right < this.mData.f133d[this.mOrient].mRectView.right) {
                z2 = true;
            }
        }
        if (this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.height() < this.mData.f133d[this.mOrient].mRectView.height()) {
            this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[0].y = 0.0f;
            z3 = true;
        } else {
            z3 = this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.top > this.mData.f133d[this.mOrient].mRectView.top;
            if (this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.bottom < this.mData.f133d[this.mOrient].mRectView.bottom) {
                z3 = true;
            }
        }
        if (z2) {
            this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[1].x = this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[0].x;
            z4 = true;
        } else {
            this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[0].x = this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[1].x;
            z4 = false;
        }
        if (z3) {
            this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[1].y = this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[0].y;
            return true;
        }
        this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[0].y = this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[1].y;
        return z4;
    }

    private void DrawPreviewImageCalcMatrix(Matrix matrix) {
        matrix.reset();
        float f = this.mData.f133d[this.mOrient].ddp[this.mViewMode].mScale[1] * this.mData.f133d[this.mOrient].mBaseScale[1];
        matrix.postScale(f, f);
        matrix.postTranslate(this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointInitOffset.x, this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointInitOffset.y);
        this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.set(0.0f, 0.0f, this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectBitmap.width(), this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectBitmap.height());
        matrix.mapRect(this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale);
        float f2 = -(((this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.height() - this.mData.f133d[this.mOrient].mRectImageArea.height()) / 2.0f) - (this.mData.f133d[this.mOrient].mRectImageArea.top - this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.top));
        matrix.postTranslate(this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[1].x + (-(((this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.width() - this.mData.f133d[this.mOrient].mRectImageArea.width()) / 2.0f) - (this.mData.f133d[this.mOrient].mRectImageArea.left - this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.left))), this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[1].y + f2);
        this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale.set(0.0f, 0.0f, this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectBitmap.width(), this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectBitmap.height());
        matrix.mapRect(this.mData.f133d[this.mOrient].ddp[this.mViewMode].mRectDrawScale);
    }

    public boolean onTouchEvent(MotionEvent motionEvent) {
        int i = this.mViewMode;
        if (i == 0) {
            TouchEventCropImage(motionEvent);
        } else if (i == 1) {
            TouchEventEnhanceText(motionEvent);
        } else if (i == 2) {
            TouchEventColorAdjustmentAll(motionEvent);
        } else if (i == 3) {
            TouchEventColorAdjustmentPart(motionEvent);
        }
        return true;
    }

    private void TouchEventCropImage(MotionEvent motionEvent) {
        int TouchEventCropImageHitCheck;
        switch (motionEvent.getAction() & 255) {
            case 0:
                float x = motionEvent.getX();
                float y = motionEvent.getY();
                this.mData.mTimerCropImageCropCircle.TimerOff();
                int TouchEventCropImageHitCheck2 = TouchEventCropImageHitCheck(x, y, true);
                if (TouchEventCropImageHitCheck2 > -1) {
                    this.mData.f133d[this.mOrient].dcm.mPointPreviewTouch.set(x, y);
                    this.mData.f133d[this.mOrient].dcm.mSelectArea = TouchEventCropImageHitCheck2;
                    return;
                } else if (this.mData.f133d[this.mOrient].dcm.mSelectArea > -1 && (TouchEventCropImageHitCheck = TouchEventCropImageHitCheck(x, y, false)) > -1) {
                    this.mData.mTimerCropImageCropCircle.TimerOn(this);
                    this.mData.f133d[this.mOrient].dcm.mPointPreviewTouch.set(x, y);
                    this.mData.f133d[this.mOrient].dcm.mSelectArea = TouchEventCropImageHitCheck;
                    return;
                } else {
                    return;
                }
            case 1:
            case 3:
                if (this.mData.f133d[this.mOrient].dcm.mSelectArea > -1) {
                    this.mData.mTimerCropImageCropCircle.TimerOn(this);
                    return;
                }
                return;
            case 2:
                int i = this.mData.f133d[this.mOrient].dcm.mSelectArea;
                if (i > -1) {
                    float x2 = motionEvent.getX();
                    float y2 = motionEvent.getY();
                    float f = this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[i].x + (x2 - this.mData.f133d[this.mOrient].dcm.mPointPreviewTouch.x);
                    float f2 = this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[i].y + (y2 - this.mData.f133d[this.mOrient].dcm.mPointPreviewTouch.y);
                    if (!this.mData.f133d[this.mOrient].dcm.mRectCropMovableArea[i].contains(f, f2)) {
                        if (f < this.mData.f133d[this.mOrient].dcm.mRectCropMovableArea[i].left) {
                            f = this.mData.f133d[this.mOrient].dcm.mRectCropMovableArea[i].left;
                        }
                        if (f2 < this.mData.f133d[this.mOrient].dcm.mRectCropMovableArea[i].top) {
                            f2 = this.mData.f133d[this.mOrient].dcm.mRectCropMovableArea[i].top;
                        }
                        if (f > this.mData.f133d[this.mOrient].dcm.mRectCropMovableArea[i].right) {
                            f = this.mData.f133d[this.mOrient].dcm.mRectCropMovableArea[i].right;
                        }
                        if (f2 > this.mData.f133d[this.mOrient].dcm.mRectCropMovableArea[i].bottom) {
                            f2 = this.mData.f133d[this.mOrient].dcm.mRectCropMovableArea[i].bottom;
                        }
                    }
                    this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[i].x = f;
                    this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[i].y = f2;
                    this.mData.f133d[this.mOrient].dcm.mPointPreviewTouch.x = x2;
                    this.mData.f133d[this.mOrient].dcm.mPointPreviewTouch.y = y2;
                    invalidate();
                    return;
                }
                return;
            default:
                return;
        }
    }

    private int TouchEventCropImageHitCheck(float f, float f2, boolean z) {
        int i = 3;
        while (i > -1) {
            RectF rectF = new RectF();
            Path path = new Path();
            path.addCircle(this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[i].x, this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[i].y, this.mData.mRadiusCropCircle, Path.Direction.CW);
            path.computeBounds(rectF, true);
            Region region = new Region();
            region.setPath(path, new Region((int) rectF.left, (int) rectF.top, (int) rectF.right, (int) rectF.bottom));
            boolean contains = region.contains(Math.round(f), Math.round(f2));
            if (!contains) {
                if (z) {
                    contains = this.mData.f133d[this.mOrient].dcm.mRectCropMovableArea[i].contains(f, f2);
                } else {
                    contains = this.mData.f133d[this.mOrient].dcm.mRectCropTapArea[i].contains(f, f2);
                }
            }
            if (contains) {
                break;
            }
            i--;
        }
        return i;
    }

    private void TouchEventEnhanceText(MotionEvent motionEvent) {
        int action = motionEvent.getAction() & 255;
        int pointerCount = motionEvent.getPointerCount();
        if (action != 5) {
            switch (action) {
                case 0:
                    if (!this.mData.mFlagScale) {
                        this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMovePoint.set(motionEvent.getX(), motionEvent.getY());
                        break;
                    }
                    break;
                case 1:
                case 3:
                    boolean unused = this.mData.mFlagScale = false;
                    break;
                case 2:
                    if (!this.mData.mFlagScale) {
                        float x = motionEvent.getX();
                        float y = motionEvent.getY();
                        this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[1].x += x - this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMovePoint.x;
                        this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[1].y += y - this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMovePoint.y;
                        this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMovePoint.x = x;
                        this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMovePoint.y = y;
                        invalidate();
                        break;
                    }
                    break;
            }
        } else {
            boolean unused2 = this.mData.mFlagScale = true;
        }
        if (pointerCount == 1) {
            this.mGestureDetector.onTouchEvent(motionEvent);
        }
        if (pointerCount >= 2) {
            try {
                this.mScaleGestureDetector.onTouchEvent(motionEvent);
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            }
        }
    }

    private void TouchEventColorAdjustmentPart(MotionEvent motionEvent) {
        int action = motionEvent.getAction() & 255;
        float x = motionEvent.getX();
        float y = motionEvent.getY();
        float f = this.mData.f133d[this.mOrient].mRectPreviewImage.left;
        float f2 = this.mData.f133d[this.mOrient].mRectPreviewImage.top;
        float f3 = x - f;
        float f4 = y - f2;
        switch (action) {
            case 0:
                Data data = this.mData;
                data.mTouchState = 0;
                data.f133d[this.mOrient].dca.mPointMoveArray.clear();
                this.mData.f133d[this.mOrient].dca.mPointMoveArray.add(new PointF(f3, f4));
                return;
            case 1:
            case 3:
                if (this.mData.f133d[this.mOrient].dca.mPointMoveArray.size() > 0) {
                    ArrayList arrayList = new ArrayList();
                    for (PointF next : this.mData.f133d[this.mOrient].dca.mPointMoveArray) {
                        if (this.mData.f133d[this.mOrient].mRectPreviewImage.contains(next.x + f, next.y + f2)) {
                            arrayList.add(next);
                        }
                    }
                    if (arrayList.size() > 0) {
                        if (arrayList.size() == 1) {
                            float f5 = ((PointF) arrayList.get(0)).x;
                            float f6 = ((PointF) arrayList.get(0)).y;
                            arrayList.clear();
                            float f7 = f5 - 1.0f;
                            float f8 = f6 - 1.0f;
                            arrayList.add(new PointF(f7, f8));
                            arrayList.add(new PointF(f5, f8));
                            float f9 = f5 + 1.0f;
                            arrayList.add(new PointF(f9, f8));
                            arrayList.add(new PointF(f9, f6));
                            float f10 = 1.0f + f6;
                            arrayList.add(new PointF(f9, f10));
                            arrayList.add(new PointF(f5, f10));
                            arrayList.add(new PointF(f7, f10));
                            arrayList.add(new PointF(f7, f6));
                        }
                        this.mData.f133d[this.mOrient].dca.mPointArray.add(arrayList);
                    }
                    this.mData.f133d[this.mOrient].dca.mPointMoveArray.clear();
                }
                this.mData.mTouchState = 1;
                invalidate();
                return;
            case 2:
                this.mData.f133d[this.mOrient].dca.mPointMoveArray.add(new PointF(f3, f4));
                invalidate();
                return;
            default:
                return;
        }
    }

    /* access modifiers changed from: private */
    public void SetScale(float f) {
        this.mData.f133d[this.mOrient].ddp[this.mViewMode].mScale[0] = this.mData.f133d[this.mOrient].ddp[this.mViewMode].mScale[1];
        float f2 = this.mData.f133d[this.mOrient].ddp[this.mViewMode].mScale[1] * f;
        if (f2 < 1.0f) {
            this.mData.f133d[this.mOrient].ddp[this.mViewMode].mScale[1] = 1.0f;
        } else if (f2 > SCALE_RANGE_MAX) {
            this.mData.f133d[this.mOrient].ddp[this.mViewMode].mScale[1] = 4.0f;
        } else {
            this.mData.f133d[this.mOrient].ddp[this.mViewMode].mScale[1] = f2;
        }
    }

    /* access modifiers changed from: private */
    public void ResetScalePos(boolean z) {
        if (z || this.mViewMode != 1) {
            this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[0].set(0.0f, 0.0f);
            this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointMoveDeff[1].set(0.0f, 0.0f);
            float[] fArr = this.mData.f133d[this.mOrient].ddp[this.mViewMode].mScale;
            this.mData.f133d[this.mOrient].ddp[this.mViewMode].mScale[1] = 1.0f;
            fArr[0] = 1.0f;
        }
        if (this.mViewMode == 0) {
            this.mData.f133d[this.mOrient].ddp[1].mPointMoveDeff[0].set(0.0f, 0.0f);
            this.mData.f133d[this.mOrient].ddp[1].mPointMoveDeff[1].set(0.0f, 0.0f);
            float[] fArr2 = this.mData.f133d[this.mOrient].ddp[1].mScale;
            this.mData.f133d[this.mOrient].ddp[1].mScale[1] = 1.0f;
            fArr2[0] = 1.0f;
        }
    }

    private void GetPreviewImage() {
        Bitmap bitmap;
        Data data = this.mData;
        if (data != null && data.f133d != null && (bitmap = this.mBitmapImage) != null) {
            float width = (float) bitmap.getWidth();
            float height = (float) this.mBitmapImage.getHeight();
            float width2 = this.mData.f133d[this.mOrient].mRectImageArea.width() / width;
            float height2 = this.mData.f133d[this.mOrient].mRectImageArea.height() / height;
            if (width2 >= height2) {
                width2 = height2;
            }
            this.mData.f133d[this.mOrient].mBaseScale[1] = width2;
            this.mData.f133d[this.mOrient].mRectPreviewImage.set(0.0f, 0.0f, width * width2, height * width2);
            this.mData.f133d[this.mOrient].mPointPreviewImageOffset.set(this.mData.f133d[this.mOrient].mRectImageArea.left + ((this.mData.f133d[this.mOrient].mRectImageArea.width() - this.mData.f133d[this.mOrient].mRectPreviewImage.width()) / 2.0f), this.mData.f133d[this.mOrient].mRectImageArea.top + ((this.mData.f133d[this.mOrient].mRectImageArea.height() - this.mData.f133d[this.mOrient].mRectPreviewImage.height()) / 2.0f));
            this.mData.f133d[this.mOrient].mRectPreviewImage.offset(this.mData.f133d[this.mOrient].mPointPreviewImageOffset.x, this.mData.f133d[this.mOrient].mPointPreviewImageOffset.y);
            float width3 = this.mData.f133d[this.mOrient].mRectPreviewImage.width() / 2.0f;
            float height3 = this.mData.f133d[this.mOrient].mRectPreviewImage.height() / 2.0f;
            float width4 = this.mData.f133d[this.mOrient].mRectPreviewImage.width() * 0.05f;
            float f = this.mData.f133d[this.mOrient].mRectPreviewImage.left + width3;
            float f2 = this.mData.f133d[this.mOrient].mRectPreviewImage.top + height3;
            this.mData.f133d[this.mOrient].dcm.mRectCropMovableArea[0].set(this.mData.f133d[this.mOrient].mRectPreviewImage.left, this.mData.f133d[this.mOrient].mRectPreviewImage.top, (this.mData.f133d[this.mOrient].mRectPreviewImage.left + width3) - width4, (this.mData.f133d[this.mOrient].mRectPreviewImage.top + height3) - width4);
            this.mData.f133d[this.mOrient].dcm.mRectCropMovableArea[1].set((this.mData.f133d[this.mOrient].mRectPreviewImage.right - width3) + width4, this.mData.f133d[this.mOrient].mRectPreviewImage.top, this.mData.f133d[this.mOrient].mRectPreviewImage.right, (this.mData.f133d[this.mOrient].mRectPreviewImage.top + height3) - width4);
            this.mData.f133d[this.mOrient].dcm.mRectCropMovableArea[2].set((this.mData.f133d[this.mOrient].mRectPreviewImage.right - width3) + width4, (this.mData.f133d[this.mOrient].mRectPreviewImage.bottom - height3) + width4, this.mData.f133d[this.mOrient].mRectPreviewImage.right, this.mData.f133d[this.mOrient].mRectPreviewImage.bottom);
            this.mData.f133d[this.mOrient].dcm.mRectCropMovableArea[3].set(this.mData.f133d[this.mOrient].mRectPreviewImage.left, (this.mData.f133d[this.mOrient].mRectPreviewImage.bottom - height3) + width4, (this.mData.f133d[this.mOrient].mRectPreviewImage.left + width3) - width4, this.mData.f133d[this.mOrient].mRectPreviewImage.bottom);
            this.mData.f133d[this.mOrient].dcm.mRectCropTapArea[0].set(this.mData.f133d[this.mOrient].mRectView.left, this.mData.f133d[this.mOrient].mRectView.top, (this.mData.f133d[this.mOrient].mRectPreviewImage.left + width3) - width4, (this.mData.f133d[this.mOrient].mRectPreviewImage.top + height3) - width4);
            this.mData.f133d[this.mOrient].dcm.mRectCropTapArea[1].set((this.mData.f133d[this.mOrient].mRectPreviewImage.right - width3) + width4, this.mData.f133d[this.mOrient].mRectView.top, this.mData.f133d[this.mOrient].mRectView.right, (this.mData.f133d[this.mOrient].mRectPreviewImage.top + height3) - width4);
            this.mData.f133d[this.mOrient].dcm.mRectCropTapArea[2].set((this.mData.f133d[this.mOrient].mRectPreviewImage.right - width3) + width4, (this.mData.f133d[this.mOrient].mRectPreviewImage.bottom - height3) + width4, this.mData.f133d[this.mOrient].mRectView.right, this.mData.f133d[this.mOrient].mRectView.bottom);
            this.mData.f133d[this.mOrient].dcm.mRectCropTapArea[3].set(this.mData.f133d[this.mOrient].mRectView.left, (this.mData.f133d[this.mOrient].mRectPreviewImage.bottom - height3) + width4, (this.mData.f133d[this.mOrient].mRectPreviewImage.left + width3) - width4, this.mData.f133d[this.mOrient].mRectView.bottom);
            this.mData.f133d[this.mOrient].dcm.mRectCropTapArea[4].set(f - width4, f2 - width4, f + width4, f2 + width4);
            this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointInitOffset.x = this.mData.f133d[this.mOrient].mPointPreviewImageOffset.x;
            this.mData.f133d[this.mOrient].ddp[this.mViewMode].mPointInitOffset.y = this.mData.f133d[this.mOrient].mPointPreviewImageOffset.y;
        }
    }

    private void GetPreviewCropPoint() {
        boolean z;
        Data data = this.mData;
        if (data != null && data.f133d != null && this.mData.f133d[this.mOrient].dcm != null && this.mBitmapImage != null && this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[3].y == 0.0f) {
            if (this.mData.mPointCrop[3].y != 0.0f) {
                for (int i = 0; i < 4; i++) {
                    this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[i].x = (this.mData.mPointCrop[i].x * this.mData.f133d[this.mOrient].mBaseScale[1]) + this.mData.f133d[this.mOrient].mPointPreviewImageOffset.x;
                    this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[i].y = (this.mData.mPointCrop[i].y * this.mData.f133d[this.mOrient].mBaseScale[1]) + this.mData.f133d[this.mOrient].mPointPreviewImageOffset.y;
                }
                int i2 = 0;
                while (true) {
                    if (i2 >= 4) {
                        z = false;
                        break;
                    } else if (!this.mData.f133d[this.mOrient].dcm.mRectCropMovableArea[i2].contains(this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[i2].x, this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[i2].y)) {
                        z = true;
                        break;
                    } else {
                        i2++;
                    }
                }
            } else {
                z = true;
            }
            if (this.mGetCropPoint && z) {
                this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[0].x = this.mData.f133d[this.mOrient].mRectPreviewImage.left;
                this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[0].y = this.mData.f133d[this.mOrient].mRectPreviewImage.top;
                this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[1].x = this.mData.f133d[this.mOrient].mRectPreviewImage.right;
                this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[1].y = this.mData.f133d[this.mOrient].mRectPreviewImage.top;
                this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[2].x = this.mData.f133d[this.mOrient].mRectPreviewImage.right;
                this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[2].y = this.mData.f133d[this.mOrient].mRectPreviewImage.bottom;
                this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[3].x = this.mData.f133d[this.mOrient].mRectPreviewImage.left;
                this.mData.f133d[this.mOrient].dcm.mPointPreviewCrop[3].y = this.mData.f133d[this.mOrient].mRectPreviewImage.bottom;
            }
        }
    }

    /* renamed from: com.epson.cameracopy.ui.ImageCollectView$TimerCropImageTextMessage */
    class TimerCropImageTextMessage {
        private static final int CROP_IMAGE_TIMER_LIMIT = 5000;
        private static final int CROP_IMAGE_TIMER_TIME = 200;
        private static final int MSG_TIMER_CROP_IMAGE_TEXT_MESSAGE_TIMEOUT = 501;
        /* access modifiers changed from: private */
        public boolean mBreak = false;
        /* access modifiers changed from: private */
        public Handler mHandlerTimerCropImageTextMessage = new Handler() {
            public void handleMessage(Message message) {
                if (message.what == 501) {
                    ImageCollectView.this.mData.mShowTextMessage = false;
                    if (TimerCropImageTextMessage.this.mView != null) {
                        TimerCropImageTextMessage.this.mView.invalidate();
                    }
                }
            }
        };
        private Thread mThreadTimer = null;
        /* access modifiers changed from: private */
        public View mView = null;

        TimerCropImageTextMessage() {
        }

        public void TimerOff() {
            Thread thread = this.mThreadTimer;
            if (thread != null && thread.isAlive()) {
                this.mBreak = true;
                do {
                } while (this.mThreadTimer.isAlive());
            }
        }

        public void Timer(View view) {
            this.mView = view;
            if (this.mThreadTimer == null) {
                this.mThreadTimer = new Thread(new Runnable() {
                    public void run() {
                        int i = 0;
                        while (true) {
                            if (i >= 25) {
                                break;
                            }
                            try {
                                if (TimerCropImageTextMessage.this.mBreak) {
                                    break;
                                }
                                Thread.sleep(200);
                                i++;
                            } catch (InterruptedException e) {
                                e.printStackTrace();
                            }
                        }
                        if (TimerCropImageTextMessage.this.mHandlerTimerCropImageTextMessage != null) {
                            TimerCropImageTextMessage.this.mHandlerTimerCropImageTextMessage.sendEmptyMessage(501);
                        }
                    }
                });
                this.mThreadTimer.start();
            }
        }
    }

    /* renamed from: com.epson.cameracopy.ui.ImageCollectView$TimerCropImageCropCircle */
    class TimerCropImageCropCircle {
        private static final int MSG_TIMER_CROP_IMAGE_CROP_CIRCLE_TIMEOUT = 500;
        /* access modifiers changed from: private */
        public boolean mBreak = false;
        /* access modifiers changed from: private */
        public Handler mHandlerTimerCropImageCropCircle = new Handler() {
            public void handleMessage(Message message) {
                if (message.what == 500) {
                    ImageCollectView.this.mData.f133d[ImageCollectView.this.mOrient].dcm.mSelectArea = -1;
                    if (TimerCropImageCropCircle.this.mView != null) {
                        TimerCropImageCropCircle.this.mView.invalidate();
                    }
                }
            }
        };
        /* access modifiers changed from: private */
        public long mNewTime;
        /* access modifiers changed from: private */
        public long mStartTime;
        private Thread mTimer = null;
        /* access modifiers changed from: private */
        public View mView = null;

        TimerCropImageCropCircle() {
        }

        public void TimerOn(View view) {
            Thread thread;
            this.mView = view;
            Thread thread2 = this.mTimer;
            if ((thread2 != null && !thread2.isAlive()) || (thread = this.mTimer) == null) {
                this.mStartTime = System.currentTimeMillis();
                Timer(2000);
            } else if (thread != null && thread.isAlive()) {
                this.mStartTime = System.currentTimeMillis();
            }
        }

        public void TimerOff() {
            Thread thread = this.mTimer;
            if (thread != null && thread.isAlive()) {
                this.mBreak = true;
                do {
                } while (this.mTimer.isAlive());
            }
        }

        private void Timer(final int i) {
            this.mBreak = false;
            this.mTimer = new Thread(new Runnable() {
                public void run() {
                    while (!TimerCropImageCropCircle.this.mBreak) {
                        try {
                            Thread.sleep(100);
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }
                        long unused = TimerCropImageCropCircle.this.mNewTime = System.currentTimeMillis();
                        if (TimerCropImageCropCircle.this.mStartTime + ((long) i) <= TimerCropImageCropCircle.this.mNewTime) {
                            break;
                        }
                    }
                    if (!TimerCropImageCropCircle.this.mBreak && TimerCropImageCropCircle.this.mHandlerTimerCropImageCropCircle != null) {
                        TimerCropImageCropCircle.this.mHandlerTimerCropImageCropCircle.sendEmptyMessage(500);
                    }
                }
            });
            this.mTimer.start();
        }
    }

    /* renamed from: com.epson.cameracopy.ui.ImageCollectView$PathEffectData */
    private class PathEffectData {
        private static final int BLINKING_TIME = 500;
        private static final int DEFAULT_BLINKING_DELAYTIMES = 200;
        private static final int MSG_INVALIDATE_VIEW = 901;
        private long mBlinkingDelayTimes = 200;
        /* access modifiers changed from: private */
        public boolean mBreak = false;
        /* access modifiers changed from: private */
        public Handler mHandlerPathEffectData = new Handler() {
            public void handleMessage(Message message) {
                if (message.what != PathEffectData.MSG_INVALIDATE_VIEW || PathEffectData.this.mView == null) {
                    return;
                }
                if (PathEffectData.this.mRectDirty.isEmpty()) {
                    PathEffectData.this.mView.invalidate();
                } else {
                    PathEffectData.this.mView.invalidate(PathEffectData.this.mRectDirty);
                }
            }
        };
        /* access modifiers changed from: private */
        public long mNewTime;
        private int mPathEffectBlinkingIndex = 0;
        private long mPathEffectBlinkingTime = 0;
        private PathEffect[] mPathEffectList = new PathEffect[5];
        /* access modifiers changed from: private */
        public Rect mRectDirty = new Rect(0, 0, 0, 0);
        /* access modifiers changed from: private */
        public long mStartTime;
        private Thread mTimer = null;
        /* access modifiers changed from: private */
        public View mView = null;

        public PathEffectData(View view) {
            this.mPathEffectList[0] = new DashPathEffect(new float[]{5.0f, 5.0f}, 8.0f);
            this.mPathEffectList[1] = new DashPathEffect(new float[]{5.0f, 5.0f}, ImageCollectView.VIEW_MARGINE);
            this.mPathEffectList[2] = new DashPathEffect(new float[]{5.0f, 5.0f}, ImageCollectView.SCALE_RANGE_MAX);
            this.mPathEffectList[3] = new DashPathEffect(new float[]{5.0f, 5.0f}, 2.0f);
            this.mPathEffectList[4] = new DashPathEffect(new float[]{5.0f, 5.0f}, 0.0f);
            this.mView = view;
        }

        public PathEffect BlinkingIndex(RectF rectF) {
            long currentTimeMillis = System.currentTimeMillis();
            if (this.mPathEffectBlinkingTime == 0) {
                this.mPathEffectBlinkingTime = currentTimeMillis;
                if (rectF != null) {
                    this.mRectDirty.left = (int) rectF.left;
                    this.mRectDirty.top = (int) rectF.top;
                    this.mRectDirty.right = (int) (rectF.right + 1.0f);
                    this.mRectDirty.bottom = (int) (rectF.bottom + 1.0f);
                } else {
                    this.mRectDirty.setEmpty();
                }
            }
            BlinkOn(0);
            if (this.mPathEffectBlinkingTime + this.mBlinkingDelayTimes < currentTimeMillis) {
                int i = this.mPathEffectBlinkingIndex;
                if (i < this.mPathEffectList.length - 1) {
                    this.mPathEffectBlinkingIndex = i + 1;
                } else {
                    this.mPathEffectBlinkingIndex = 0;
                }
                this.mPathEffectBlinkingTime = currentTimeMillis;
            }
            return this.mPathEffectList[this.mPathEffectBlinkingIndex];
        }

        public void Cleanup() {
            Thread thread = this.mTimer;
            if (thread == null || !thread.isAlive()) {
                this.mTimer = null;
                this.mView = null;
                this.mPathEffectList = null;
            }
            this.mBreak = true;
            do {
            } while (this.mTimer.isAlive());
            this.mTimer = null;
            this.mView = null;
            this.mPathEffectList = null;
        }

        private void BlinkOn(int i) {
            Thread thread;
            Thread thread2 = this.mTimer;
            if ((thread2 != null && !thread2.isAlive()) || (thread = this.mTimer) == null) {
                this.mStartTime = System.currentTimeMillis();
                Timer(500);
            } else if (thread != null && thread.isAlive()) {
                this.mStartTime = System.currentTimeMillis();
            }
        }

        private void Timer(final int i) {
            this.mBreak = false;
            this.mTimer = new Thread(new Runnable() {
                public void run() {
                    while (!PathEffectData.this.mBreak) {
                        try {
                            Thread.sleep(100);
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }
                        long unused = PathEffectData.this.mNewTime = System.currentTimeMillis();
                        PathEffectData.this.mHandlerPathEffectData.sendEmptyMessage(PathEffectData.MSG_INVALIDATE_VIEW);
                        if (PathEffectData.this.mStartTime + ((long) i) <= PathEffectData.this.mNewTime) {
                            return;
                        }
                    }
                }
            });
            this.mTimer.start();
        }
    }

    /* renamed from: com.epson.cameracopy.ui.ImageCollectView$EPxLog */
    static class EPxLog {
        EPxLog() {
        }

        /* renamed from: d */
        public static final void m63d(String str, String str2) {
            Log.d(str, str2);
        }

        /* renamed from: e */
        public static final void m64e(String str, String str2) {
            if (Debug.isDebuggerConnected()) {
                Log.e(str, str2);
            }
        }

        /* renamed from: i */
        public static final void m65i(String str, String str2) {
            if (Debug.isDebuggerConnected()) {
                Log.i(str, str2);
            }
        }

        /* renamed from: v */
        public static final void m66v(String str, String str2) {
            if (Debug.isDebuggerConnected()) {
                Log.v(str, str2);
            }
        }

        /* renamed from: w */
        public static final void m67w(String str, String str2) {
            if (Debug.isDebuggerConnected()) {
                Log.w(str, str2);
            }
        }
    }
}
