玖星尚缘 v1.2.7版本的 MD5 值为:a5d3a854f0a33133433102e91a1193e3

以下内容为反编译后的 g.java 源代码,内容仅作参考


package io.dcloud.common.core.ui;

import android.content.Context;
import android.graphics.Rect;
import android.os.Build;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.ViewTreeObserver;
import android.webkit.WebView;
import android.widget.AbsoluteLayout;
import android.widget.FrameLayout;
import com.alibaba.android.bindingx.core.internal.BindingXConstants;
import com.taobao.weex.common.Constants;
import com.taobao.weex.performance.WXInstanceApm;
import com.taobao.weex.ui.view.gesture.WXGesture;
import io.dcloud.common.DHInterface.IFrameView;
import io.dcloud.common.DHInterface.IMgr;
import io.dcloud.common.DHInterface.INativeView;
import io.dcloud.common.adapter.util.DragBean;
import io.dcloud.common.constant.AbsoluteConst;
import io.dcloud.common.util.BaseInfo;
import io.dcloud.common.util.Deprecated_JSUtil;
import io.dcloud.common.util.JSONUtil;
import io.dcloud.common.util.JSUtil;
import io.dcloud.common.util.PdrUtil;
import io.dcloud.common.util.StringUtil;
import io.dcloud.nineoldandroids.animation.Animator;
import io.dcloud.nineoldandroids.animation.ValueAnimator;
import io.dcloud.nineoldandroids.view.ViewHelper;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.regex.Pattern;
import org.json.JSONObject;
public class g {
    private static boolean a = false;
    private String B;
    private String D;
    private String E;
    private IFrameView K;
    private String L;
    private String M;
    private String N;
    private int O;
    private boolean P;
    private float Q;
    private int R;
    private int S;
    private int X;
    private DisplayMetrics Y;
    private float a0;
    private float b0;
    private float c0;
    private float d0;
    private float e0;
    private float f0;
    private VelocityTracker g;
    boolean h0;
    private int i;
    private float j;
    private Pattern j0;
    private float k;
    private float l;
    private int m;
    private io.dcloud.common.core.ui.b r;
    private io.dcloud.common.core.ui.b s;
    private View u;
    private String x;
    private String z;
    private boolean b = false;
    private boolean c = false;
    private boolean d = false;
    private boolean e = false;
    private boolean f = false;
    private boolean h = true;
    private int n = 0;
    private int o = 0;
    private int p = 0;
    private int q = 0;
    private View t = null;
    private boolean v = false;
    private int w = Integer.MAX_VALUE;
    private int y = Integer.MAX_VALUE;
    private int A = Integer.MAX_VALUE;
    private int C = Integer.MAX_VALUE;
    private boolean F = false;
    private boolean G = true;
    private boolean H = true;
    private boolean I = true;
    private int J = -1;
    private boolean T = false;
    private boolean U = false;
    private boolean V = false;
    private int W = Integer.MAX_VALUE;
    private float Z = 20.0f;
    boolean g0 = true;
    private String i0 = "^([1-9]|[1-9]\\d|100)$";

    public class a implements ViewTreeObserver.OnGlobalLayoutListener {
        a() {
        }

        @Override
        public void onGlobalLayout() {
            int i;
            if (Build.VERSION.SDK_INT >= 16) {
                g.this.u.getViewTreeObserver().removeOnGlobalLayoutListener(this);
            }
            g gVar = g.this;
            boolean z = true;
            if (gVar.d(gVar.M)) {
                i = g.this.q;
            } else {
                g gVar2 = g.this;
                int b = gVar2.b(gVar2.u) / 2;
                Rect rect = new Rect();
                g.this.u.getGlobalVisibleRect(rect);
                if (rect.right - rect.left >= b) {
                    i = g.this.q;
                } else {
                    i = g.this.p;
                    z = false;
                }
            }
            g gVar3 = g.this;
            int a = gVar3.a(gVar3.u);
            g gVar4 = g.this;
            ValueAnimator a2 = gVar4.a(gVar4.u, a, i, z);
            if (a2 != null) {
                a2.start();
            }
        }
    }

    public class b implements ViewTreeObserver.OnGlobalLayoutListener {
        b() {
        }

        @Override
        public void onGlobalLayout() {
            int i;
            boolean z;
            int i2;
            boolean z2;
            boolean z3;
            ValueAnimator a;
            if (Build.VERSION.SDK_INT >= 16) {
                g.this.t.getViewTreeObserver().removeOnGlobalLayoutListener(this);
            }
            g gVar = g.this;
            boolean z4 = true;
            if (gVar.d(gVar.M)) {
                i = g.this.o;
            } else {
                if (g.this.u != null) {
                    g gVar2 = g.this;
                    int b = gVar2.b(gVar2.u) / 2;
                    Rect rect = new Rect();
                    g.this.u.getGlobalVisibleRect(rect);
                    Rect rect2 = new Rect();
                    g.this.t.getGlobalVisibleRect(rect2);
                    int i3 = rect.left;
                    if (i3 != 0) {
                        if (rect.right == g.this.R) {
                            int i4 = rect.right - rect2.right;
                            if ("right".equals(g.this.M)) {
                                if (i4 <= b) {
                                    i = g.this.o;
                                } else {
                                    i = g.this.n;
                                    z = false;
                                }
                            } else if ("left".equals(g.this.M)) {
                                if (i4 >= b) {
                                    i = g.this.o;
                                } else {
                                    i = g.this.n;
                                    z = false;
                                }
                            }
                        }
                        i = 0;
                        z = false;
                    } else {
                        int i5 = rect2.left - i3;
                        if (!"right".equals(g.this.M)) {
                            if ("left".equals(g.this.M)) {
                                if (i5 <= b) {
                                    i = g.this.o;
                                } else {
                                    i = g.this.n;
                                    z = false;
                                }
                            }
                            i = 0;
                            z = false;
                        } else if (i5 >= b) {
                            i = g.this.o;
                        } else {
                            i = g.this.n;
                            z = false;
                        }
                    }
                } else {
                    Rect rect3 = new Rect();
                    g.this.t.getGlobalVisibleRect(rect3);
                    int i6 = rect3.right - rect3.left;
                    int width = g.this.t.getWidth() / 2;
                    if (!"right".equals(g.this.M) || g.this.n >= 0) {
                        if (!"left".equals(g.this.M) || g.this.o < 0) {
                            if (i6 <= width) {
                                i = g.this.o;
                            } else {
                                i = g.this.n;
                                z = false;
                            }
                        } else if (i6 >= width) {
                            i = g.this.o;
                        } else {
                            i = g.this.n;
                            z = false;
                        }
                    } else if (i6 >= width) {
                        i = g.this.o;
                    } else {
                        i = g.this.n;
                        z = false;
                    }
                }
                if (g.this.u != null) {
                    Rect rect4 = new Rect();
                    g.this.u.getGlobalVisibleRect(rect4);
                    if (rect4.left != 0) {
                    }
                    if ("bounce".equalsIgnoreCase(g.this.E)) {
                        int i7 = g.this.n;
                        g.this.E = null;
                        i2 = i7;
                        z3 = false;
                        z2 = false;
                    } else {
                        i2 = i;
                        z2 = z4;
                        z3 = z;
                    }
                    g gVar3 = g.this;
                    int a2 = gVar3.a(gVar3.t);
                    g gVar4 = g.this;
                    a = gVar4.a(gVar4.t, a2, i2, z3, z2);
                    if (a != null) {
                        a.start();
                        return;
                    }
                    return;
                }
                z4 = false;
                if ("bounce".equalsIgnoreCase(g.this.E)) {
                }
                g gVar32 = g.this;
                int a22 = gVar32.a(gVar32.t);
                g gVar42 = g.this;
                a = gVar42.a(gVar42.t, a22, i2, z3, z2);
                if (a != null) {
                }
            }
            z = true;
            if (g.this.u != null) {
            }
            z4 = false;
            if ("bounce".equalsIgnoreCase(g.this.E)) {
            }
            g gVar322 = g.this;
            int a222 = gVar322.a(gVar322.t);
            g gVar422 = g.this;
            a = gVar422.a(gVar422.t, a222, i2, z3, z2);
            if (a != null) {
            }
        }
    }

    public class c implements ViewTreeObserver.OnGlobalLayoutListener {
        c() {
        }

        @Override
        public void onGlobalLayout() {
            int i;
            int i2;
            int i3;
            int i4;
            int i5;
            ValueAnimator a;
            if (Build.VERSION.SDK_INT >= 16) {
                g.this.t.getViewTreeObserver().removeOnGlobalLayoutListener(this);
            }
            g gVar = g.this;
            boolean z = true;
            int i6 = 0;
            if (gVar.d(gVar.M)) {
                int i7 = g.this.o;
                int i8 = g.this.q;
                if ("bounce".equalsIgnoreCase(g.this.E)) {
                    i4 = g.this.n;
                    i5 = g.this.p;
                    g.this.E = null;
                    i6 = i4;
                    i3 = i5;
                } else {
                    i6 = i7;
                    i3 = i8;
                    g gVar2 = g.this;
                    int a2 = gVar2.a(gVar2.t);
                    g gVar3 = g.this;
                    a = gVar3.a(gVar3.t, a2, i6, z);
                    if (a != null) {
                        a.start();
                    }
                    g gVar4 = g.this;
                    int a3 = gVar4.a(gVar4.u);
                    if (g.this.u == null) {
                        g gVar5 = g.this;
                        ValueAnimator a4 = gVar5.a(gVar5.u, a3, i3, z);
                        if (a4 != null) {
                            a4.start();
                            return;
                        }
                        return;
                    }
                    return;
                }
            } else if ("bounce".equalsIgnoreCase(g.this.E)) {
                i4 = g.this.n;
                i5 = g.this.p;
                g.this.E = null;
                i6 = i4;
                i3 = i5;
            } else {
                int i9 = g.this.R;
                g gVar6 = g.this;
                int a5 = gVar6.a(gVar6.u);
                g gVar7 = g.this;
                int b = gVar7.b(gVar7.u) + a5;
                g gVar8 = g.this;
                gVar8.a(gVar8.t);
                g.this.t.getWidth();
                if (g.this.t.getWidth() >= g.this.R) {
                    if (a5 <= 0 && b > 0) {
                        int i10 = b - 0;
                        if (i10 > 0) {
                            g gVar9 = g.this;
                            if (i10 < gVar9.b(gVar9.u)) {
                                g gVar10 = g.this;
                                if (i10 >= gVar10.b(gVar10.u) / 2) {
                                    i6 = g.this.o;
                                    i3 = g.this.q;
                                    g gVar22 = g.this;
                                    int a22 = gVar22.a(gVar22.t);
                                    g gVar32 = g.this;
                                    a = gVar32.a(gVar32.t, a22, i6, z);
                                    if (a != null) {
                                    }
                                    g gVar42 = g.this;
                                    int a32 = gVar42.a(gVar42.u);
                                    if (g.this.u == null) {
                                    }
                                } else {
                                    i = g.this.n;
                                    i2 = g.this.p;
                                    i6 = i;
                                    i3 = i2;
                                }
                            }
                        }
                        g gVar11 = g.this;
                        if (i10 == gVar11.b(gVar11.u)) {
                            g.this.b(true);
                            g gVar12 = g.this;
                            gVar12.a(gVar12.t, g.this.o);
                            g gVar13 = g.this;
                            gVar13.a(gVar13.u, g.this.q);
                            boolean unused = g.a = false;
                            return;
                        }
                        g.this.b(false);
                        g gVar14 = g.this;
                        gVar14.a(gVar14.t, g.this.n);
                        g gVar15 = g.this;
                        gVar15.a(gVar15.u, g.this.p);
                        boolean unused2 = g.a = false;
                        return;
                    } else if (a5 >= i9 || i9 > b) {
                        g.this.b(false);
                        g gVar16 = g.this;
                        gVar16.a(gVar16.t, g.this.n);
                        g gVar17 = g.this;
                        gVar17.a(gVar17.u, g.this.p);
                        boolean unused3 = g.a = false;
                        return;
                    } else {
                        int i11 = i9 - a5;
                        if (i11 > 0) {
                            g gVar18 = g.this;
                            if (i11 < gVar18.b(gVar18.u)) {
                                g gVar19 = g.this;
                                if (i11 >= gVar19.b(gVar19.u) / 2) {
                                    i6 = g.this.o;
                                    i3 = g.this.q;
                                    g gVar222 = g.this;
                                    int a222 = gVar222.a(gVar222.t);
                                    g gVar322 = g.this;
                                    a = gVar322.a(gVar322.t, a222, i6, z);
                                    if (a != null) {
                                    }
                                    g gVar422 = g.this;
                                    int a322 = gVar422.a(gVar422.u);
                                    if (g.this.u == null) {
                                    }
                                } else {
                                    i = g.this.n;
                                    i2 = g.this.p;
                                    i6 = i;
                                    i3 = i2;
                                }
                            }
                        }
                        g gVar20 = g.this;
                        if (i11 == gVar20.b(gVar20.u)) {
                            g.this.b(true);
                            g gVar21 = g.this;
                            gVar21.a(gVar21.t, g.this.o);
                            g gVar23 = g.this;
                            gVar23.a(gVar23.u, g.this.q);
                            boolean unused4 = g.a = false;
                            return;
                        }
                        g.this.b(false);
                        g gVar24 = g.this;
                        gVar24.a(gVar24.t, g.this.n);
                        g gVar25 = g.this;
                        gVar25.a(gVar25.u, g.this.p);
                        boolean unused5 = g.a = false;
                        return;
                    }
                }
                Rect rect = new Rect();
                g.this.t.getGlobalVisibleRect(rect);
                int i12 = rect.right - rect.left;
                int width = g.this.t.getWidth() / 2;
                if (rect.left == 0) {
                    if (i12 <= width) {
                        i6 = g.this.o;
                        i3 = g.this.q;
                        g gVar2222 = g.this;
                        int a2222 = gVar2222.a(gVar2222.t);
                        g gVar3222 = g.this;
                        a = gVar3222.a(gVar3222.t, a2222, i6, z);
                        if (a != null) {
                        }
                        g gVar4222 = g.this;
                        int a3222 = gVar4222.a(gVar4222.u);
                        if (g.this.u == null) {
                        }
                    } else {
                        i = g.this.n;
                        i2 = g.this.p;
                        i6 = i;
                        i3 = i2;
                    }
                } else if (g.this.R != rect.right) {
                    i3 = 0;
                } else if (i12 <= width) {
                    i6 = g.this.o;
                    i3 = g.this.q;
                    g gVar22222 = g.this;
                    int a22222 = gVar22222.a(gVar22222.t);
                    g gVar32222 = g.this;
                    a = gVar32222.a(gVar32222.t, a22222, i6, z);
                    if (a != null) {
                    }
                    g gVar42222 = g.this;
                    int a32222 = gVar42222.a(gVar42222.u);
                    if (g.this.u == null) {
                    }
                } else {
                    i = g.this.n;
                    i2 = g.this.p;
                    i6 = i;
                    i3 = i2;
                }
            }
            z = false;
            g gVar222222 = g.this;
            int a222222 = gVar222222.a(gVar222222.t);
            g gVar322222 = g.this;
            a = gVar322222.a(gVar322222.t, a222222, i6, z);
            if (a != null) {
            }
            g gVar422222 = g.this;
            int a322222 = gVar422222.a(gVar422222.u);
            if (g.this.u == null) {
            }
        }
    }

    public class d implements Animator.AnimatorListener {
        final boolean a;
        final boolean b;
        final View c;
        final int d;

        d(boolean z, boolean z2, View view, int i) {
            this.a = z;
            this.b = z2;
            this.c = view;
            this.d = i;
        }

        @Override
        public void onAnimationCancel(Animator animator) {
        }

        @Override
        public void onAnimationEnd(Animator animator) {
            io.dcloud.common.core.ui.b bVar;
            String str;
            if (g.this.T) {
                g.this.T = false;
                g gVar = g.this;
                boolean z = this.a;
                gVar.a("end", z, this.b, z ? "100" : WXInstanceApm.VALUE_ERROR_CODE_DEFAULT);
            }
            if (this.a) {
                if (this.c == g.this.t && g.this.r != null) {
                    g gVar2 = g.this;
                    int a = gVar2.a(gVar2.t);
                    if (a <= (-g.this.t.getWidth()) || a >= g.this.R) {
                        g.this.r.popFromViewStack();
                    }
                }
            } else if (this.c == g.this.u) {
                g gVar3 = g.this;
                int a2 = gVar3.a(gVar3.u);
                if (a2 <= (-g.this.R) || a2 >= g.this.R) {
                    if (Integer.MAX_VALUE != g.this.W && g.this.W != a2) {
                        g gVar4 = g.this;
                        gVar4.b(gVar4.u, g.this.W);
                    }
                    g.this.W = Integer.MAX_VALUE;
                }
                if (!(this.c instanceof INativeView) && g.this.s != null) {
                    g gVar5 = g.this;
                    int a3 = gVar5.a(gVar5.u);
                    g gVar6 = g.this;
                    if (a3 <= (-gVar6.b(gVar6.u)) || a3 >= g.this.R) {
                        g.this.s.popFromViewStack();
                    }
                }
            }
            g.this.a(this.c, this.d);
            View view = this.c;
            if (view != null) {
                if (!this.b) {
                    if (view == g.this.t) {
                        bVar = g.this.r;
                        str = this.a ? g.this.x : g.this.z;
                    } else if (this.c == g.this.u) {
                        bVar = g.this.s;
                        str = this.a ? g.this.B : g.this.D;
                    }
                    if (!"hide".equalsIgnoreCase(str) || AbsoluteConst.EVENTS_CLOSE.equalsIgnoreCase(str)) {
                        View view2 = this.c;
                        if (view2 instanceof INativeView) {
                            String viewId = ((INativeView) view2).getViewId();
                            String viewUUId = ((INativeView) this.c).getViewUUId();
                            if (str.equalsIgnoreCase(AbsoluteConst.EVENTS_CLOSE)) {
                                str = "view_close";
                            }
                            g.this.r.obtainWindowMgr().processEvent(IMgr.MgrType.FeatureMgr, 1, new Object[]{g.this.r.obtainWebView(), "nativeobj", str, JSONUtil.createJSONArray("['" + viewId + "','" + viewUUId + "']")});
                        } else if (bVar != null) {
                            bVar.obtainWindowMgr().processEvent(IMgr.MgrType.FeatureMgr, 1, new Object[]{bVar.obtainWebView(), AbsoluteConst.F_UI, "execMethod", JSONUtil.createJSONArray("[\"NWindow\",\"" + str + "\",[\"" + bVar.obtainWebView().getWebviewUUID() + "\",[null,null,null]]]")});
                        }
                    }
                }
                bVar = null;
                str = null;
                if (!"hide".equalsIgnoreCase(str) || AbsoluteConst.EVENTS_CLOSE.equalsIgnoreCase(str)) {
                }
            }
            if (g.this.X <= 1) {
                boolean unused = g.a = false;
                g.this.u = null;
            }
            if (g.this.X >= 1) {
                g.h(g.this);
            }
        }

        @Override
        public void onAnimationRepeat(Animator animator) {
        }

        @Override
        public void onAnimationStart(Animator animator) {
            g.g(g.this);
        }
    }

    public class e implements ValueAnimator.AnimatorUpdateListener {
        final View a;

        e(View view) {
            this.a = view;
        }

        @Override
        public void onAnimationUpdate(ValueAnimator valueAnimator) {
            ViewGroup.LayoutParams layoutParams = this.a.getLayoutParams();
            View view = this.a;
            if (view instanceof INativeView) {
                g.this.b(view, ((Integer) valueAnimator.getAnimatedValue()).intValue());
                this.a.requestLayout();
                this.a.invalidate();
            } else if (layoutParams instanceof FrameLayout.LayoutParams) {
                ViewHelper.setX(view, ((Float) valueAnimator.getAnimatedValue()).floatValue());
            } else if (layoutParams instanceof AbsoluteLayout.LayoutParams) {
                try {
                    ViewHelper.setX(this.a, ((Integer) valueAnimator.getAnimatedValue()).intValue());
                } catch (Exception unused) {
                    ViewHelper.setX(this.a, ((Float) valueAnimator.getAnimatedValue()).floatValue());
                }
                this.a.requestLayout();
            }
        }
    }

    public class f implements ViewTreeObserver.OnGlobalLayoutListener {
        f() {
        }

        @Override
        public void onGlobalLayout() {
            int i;
            int b;
            int b2;
            int a;
            ValueAnimator a2;
            if (Build.VERSION.SDK_INT >= 16) {
                g.this.t.getViewTreeObserver().removeOnGlobalLayoutListener(this);
            }
            g gVar = g.this;
            boolean z = true;
            if (gVar.d(gVar.M)) {
                if ("right".equals(g.this.M)) {
                    b = g.this.R;
                } else if ("left".equals(g.this.M)) {
                    g gVar2 = g.this;
                    b2 = gVar2.b(gVar2.u);
                    b = -b2;
                } else {
                    b = 0;
                }
                i = 0;
                g gVar3 = g.this;
                a = gVar3.a(gVar3.t);
                if (a != 0) {
                    g gVar4 = g.this;
                    ValueAnimator a3 = gVar4.a(gVar4.t, a, i, z, true);
                    if (a3 != null) {
                        a3.start();
                    }
                }
                g gVar5 = g.this;
                int a4 = gVar5.a(gVar5.u);
                g gVar6 = g.this;
                a2 = gVar6.a(gVar6.u, a4, b, z, true);
                if (a2 == null) {
                    a2.start();
                    return;
                }
                return;
            }
            View view = (View) g.this.t.getParent();
            int[] iArr = new int[2];
            int[] iArr2 = new int[2];
            int[] iArr3 = new int[2];
            view.getLocationOnScreen(iArr);
            g.this.t.getLocationOnScreen(iArr2);
            g.this.u.getLocationOnScreen(iArr3);
            int width = iArr[0] + view.getWidth();
            int i2 = iArr2[0];
            g.this.t.getWidth();
            int i3 = iArr3[0];
            g gVar7 = g.this;
            int b3 = i3 + gVar7.b(gVar7.u);
            if (iArr3[0] <= iArr[0] && iArr[0] < b3) {
                int i4 = b3 - iArr[0];
                if (i4 > 0) {
                    g gVar8 = g.this;
                    if (i4 < gVar8.b(gVar8.u)) {
                        g gVar9 = g.this;
                        if (i4 <= gVar9.b(gVar9.u) / 2) {
                            g gVar10 = g.this;
                            b2 = gVar10.b(gVar10.u);
                            b = -b2;
                            i = 0;
                            g gVar32 = g.this;
                            a = gVar32.a(gVar32.t);
                            if (a != 0) {
                            }
                            g gVar52 = g.this;
                            int a42 = gVar52.a(gVar52.u);
                            g gVar62 = g.this;
                            a2 = gVar62.a(gVar62.u, a42, b, z, true);
                            if (a2 == null) {
                            }
                        } else {
                            g gVar11 = g.this;
                            i = gVar11.b(gVar11.u);
                            b = 0;
                        }
                    }
                }
                g gVar12 = g.this;
                if (i4 == gVar12.b(gVar12.u)) {
                    g.this.a(false, true);
                    g gVar13 = g.this;
                    View view2 = gVar13.t;
                    g gVar14 = g.this;
                    gVar13.a(view2, gVar14.b(gVar14.u));
                    g gVar15 = g.this;
                    gVar15.a(gVar15.u, 0);
                    boolean unused = g.a = false;
                    return;
                }
                g.this.a(true, true);
                g gVar16 = g.this;
                gVar16.a(gVar16.t, 0);
                g gVar17 = g.this;
                View view3 = gVar17.u;
                g gVar18 = g.this;
                gVar17.a(view3, -gVar18.b(gVar18.u));
                boolean unused2 = g.a = false;
                return;
            } else if (iArr3[0] >= width || width > b3) {
                g.this.a(true, true);
                g gVar19 = g.this;
                gVar19.a(gVar19.t, 0);
                g gVar20 = g.this;
                gVar20.a(gVar20.u, g.this.R);
                boolean unused3 = g.a = false;
                return;
            } else {
                int i5 = width - iArr3[0];
                if (i5 > 0) {
                    g gVar21 = g.this;
                    if (i5 < gVar21.b(gVar21.u)) {
                        g gVar22 = g.this;
                        if (i5 <= gVar22.b(gVar22.u) / 2) {
                            b = g.this.R;
                            i = 0;
                            g gVar322 = g.this;
                            a = gVar322.a(gVar322.t);
                            if (a != 0) {
                            }
                            g gVar522 = g.this;
                            int a422 = gVar522.a(gVar522.u);
                            g gVar622 = g.this;
                            a2 = gVar622.a(gVar622.u, a422, b, z, true);
                            if (a2 == null) {
                            }
                        } else {
                            g gVar23 = g.this;
                            int i6 = g.this.R;
                            g gVar24 = g.this;
                            i = -gVar23.b(gVar23.u);
                            b = i6 - gVar24.b(gVar24.u);
                        }
                    }
                }
                g gVar25 = g.this;
                if (i5 == gVar25.b(gVar25.u)) {
                    g.this.a(false, true);
                    g gVar26 = g.this;
                    View view4 = gVar26.t;
                    g gVar27 = g.this;
                    gVar26.a(view4, -gVar27.b(gVar27.u));
                    g gVar28 = g.this;
                    View view5 = gVar28.u;
                    int i7 = g.this.R;
                    g gVar29 = g.this;
                    gVar28.a(view5, i7 - gVar29.b(gVar29.u));
                    boolean unused4 = g.a = false;
                    return;
                }
                g.this.a(true, true);
                g gVar30 = g.this;
                gVar30.a(gVar30.t, 0);
                g gVar31 = g.this;
                gVar31.a(gVar31.u, g.this.R);
                boolean unused5 = g.a = false;
                return;
            }
            z = false;
            g gVar3222 = g.this;
            a = gVar3222.a(gVar3222.t);
            if (a != 0) {
            }
            g gVar5222 = g.this;
            int a4222 = gVar5222.a(gVar5222.u);
            g gVar6222 = g.this;
            a2 = gVar6222.a(gVar6222.u, a4222, b, z, true);
            if (a2 == null) {
            }
        }
    }

    public g(IFrameView iFrameView, Context context) {
        this.X = 0;
        a = false;
        this.X = 0;
        if (iFrameView instanceof io.dcloud.common.core.ui.b) {
            this.r = (io.dcloud.common.core.ui.b) iFrameView;
            if (this.Y == null) {
                DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
                this.Y = displayMetrics;
                int i = displayMetrics.widthPixels;
                this.R = i;
                this.S = i;
            }
        }
        this.i = ViewConfiguration.get(context).getScaledTouchSlop();
        this.j0 = Pattern.compile(this.i0);
    }

    static int g(g gVar) {
        int i = gVar.X;
        gVar.X = i + 1;
        return i;
    }

    static int h(g gVar) {
        int i = gVar.X;
        gVar.X = i - 1;
        return i;
    }

    private boolean d(MotionEvent motionEvent) {
        int i;
        float rawX = motionEvent.getRawX();
        int action = motionEvent.getAction();
        if (action != 1) {
            if (action == 2) {
                this.j = rawX;
                float a2 = a((int) (rawX - this.j));
                float a3 = a(this.t) + a2;
                float a4 = a2 + a(this.u);
                if ("right".equals(this.M)) {
                    int i2 = this.o;
                    if (a3 < i2) {
                        i2 = this.n;
                    }
                    a3 = i2;
                    i = this.q;
                    if (a4 < i) {
                        i = this.p;
                    }
                    a4 = i;
                    b(this.t, (int) a3);
                    b(this.u, (int) a4);
                } else {
                    if ("left".equals(this.M)) {
                        int i3 = this.n;
                        if (a3 < i3) {
                            i3 = this.o;
                        }
                        a3 = i3;
                        i = this.p;
                        if (a4 < i) {
                            i = this.q;
                        }
                        a4 = i;
                    }
                    b(this.t, (int) a3);
                    b(this.u, (int) a4);
                }
            }
            return true;
        }
        this.h = false;
        if (this.I) {
            a();
        }
        return false;
    }

    private boolean f(MotionEvent motionEvent) {
        int i;
        float rawX = motionEvent.getRawX();
        int action = motionEvent.getAction();
        if (action != 1) {
            if (action == 2) {
                float f2 = rawX - this.j;
                this.j = rawX;
                float a2 = a(this.u) + f2;
                if ("right".equals(this.M)) {
                    i = this.q;
                    if (a2 <= i) {
                        i = this.p;
                    }
                    a2 = i;
                    b(this.u, (int) a2);
                } else {
                    if ("left".equals(this.M)) {
                        i = this.p;
                        if (a2 <= i) {
                            i = this.q;
                        }
                        a2 = i;
                    }
                    b(this.u, (int) a2);
                }
            }
            return true;
        }
        this.h = false;
        if (this.I) {
            c();
        }
        return false;
    }

    private boolean g(MotionEvent motionEvent) {
        int i;
        float rawX = motionEvent.getRawX();
        int action = motionEvent.getAction();
        if (action != 1) {
            if (action == 2) {
                this.j = rawX;
                float a2 = a(this.t) + a(rawX - this.j);
                if ("right".equals(this.M)) {
                    i = this.o;
                    if (a2 <= i) {
                        i = this.n;
                    }
                    a2 = i;
                    b(this.t, (int) a2);
                } else {
                    if ("left".equals(this.M)) {
                        i = this.n;
                        if (a2 <= i) {
                            i = this.o;
                        }
                        a2 = i;
                    }
                    b(this.t, (int) a2);
                }
            }
            return true;
        }
        this.h = false;
        if (this.I) {
            d();
        }
        return false;
    }

    private boolean h() {
        this.n = a(this.t);
        if ("right".equals(this.M)) {
            int i = this.w;
            if (Integer.MAX_VALUE != i) {
                this.o = i;
                return this.n != i;
            }
            this.o = this.R;
            View view = this.u;
            if (view != null) {
                if ("bounce".equalsIgnoreCase(this.E)) {
                    this.o = this.n + (b(this.t) / 2);
                    return true;
                } else if (b(this.u) < this.R) {
                    int a2 = a(this.t);
                    int a3 = a(this.u);
                    int a4 = a(this.u) + b(this.u);
                    if (a3 == 0 && a4 == a2) {
                        return false;
                    }
                    boolean z = this.H;
                    if (!z && a3 == 0) {
                        this.o = b(this.u);
                        return true;
                    } else if (z && a4 == 0) {
                        this.o = b(this.u);
                        return true;
                    } else if (this.R == a4) {
                        this.o = 0;
                        return true;
                    } else {
                        return true;
                    }
                } else {
                    return true;
                }
            } else if (view != null || this.n >= 0) {
                return true;
            } else {
                this.o = 0;
                return true;
            }
        } else if ("left".equals(this.M)) {
            int i2 = this.w;
            if (Integer.MAX_VALUE != i2) {
                this.o = i2;
                return this.n != i2;
            }
            this.o = -b(this.t);
            View view2 = this.u;
            if (view2 != null) {
                if ("bounce".equalsIgnoreCase(this.E)) {
                    this.o = this.n - (b(this.t) / 2);
                    return true;
                } else if (b(this.u) < this.R) {
                    int a5 = a(this.t) + b(this.t);
                    int a6 = a(this.u);
                    int a7 = a(this.u) + b(this.u);
                    int i3 = this.R;
                    if (i3 == a7 && a6 == a5) {
                        return false;
                    }
                    boolean z2 = this.H;
                    if (!z2 && i3 == a7) {
                        this.o = -b(this.u);
                        return true;
                    } else if (z2 && i3 == a6) {
                        this.o = -b(this.u);
                        return true;
                    } else if (a6 == 0) {
                        this.o = 0;
                        return true;
                    } else {
                        return true;
                    }
                } else {
                    return true;
                }
            } else if (view2 != null || this.n <= 0) {
                return true;
            } else {
                this.o = 0;
                return true;
            }
        } else {
            return true;
        }
    }

    private void i() {
        float f2 = this.n;
        this.a0 = f2;
        float f3 = this.o;
        this.b0 = f3;
        this.d0 = f2;
        this.c0 = f2;
        float abs = Math.abs(f3 - f2);
        this.e0 = abs;
        this.f0 = (abs * this.Z) / 100.0f;
        this.g0 = true;
        this.h0 = false;
    }

    private boolean j() {
        return "right".equals(this.M) ? a(this.u) != 0 : ("left".equals(this.M) && a(this.u) + b(this.u) == this.R) ? false : true;
    }

    private void k() {
        float a2 = a(this.t);
        this.d0 = a2;
        if (this.g0) {
            float f2 = this.a0;
            if (a2 == f2) {
                this.h0 = true;
                this.g0 = false;
                this.c0 = f2;
                a(WXGesture.MOVE, false, WXInstanceApm.VALUE_ERROR_CODE_DEFAULT);
                return;
            }
        }
        if (Math.abs(a2 - this.c0) >= this.f0) {
            this.g0 = true;
            this.h0 = true;
            a(WXGesture.MOVE, false, "" + ((int) ((Math.abs(this.d0 - this.a0) / this.e0) * 100.0f)));
            this.c0 = this.d0;
        } else if (this.h0) {
            float f3 = this.d0;
            float f4 = this.b0;
            if (f3 == f4) {
                this.h0 = false;
                this.g0 = true;
                this.c0 = f4;
                a(WXGesture.MOVE, false, "100");
            }
        }
    }

    public HashMap<String, DragBean> e() {
        io.dcloud.common.core.ui.b bVar = this.r;
        if (bVar == null || bVar.obtainFrameOptions() == null) {
            return null;
        }
        return this.r.obtainFrameOptions().dragData;
    }

    public void c(boolean z) {
        this.b = z;
    }

    public boolean c(MotionEvent motionEvent) {
        View view;
        View view2;
        if (this.h) {
            if (motionEvent.getPointerCount() > 1) {
                return true;
            }
            if (BaseInfo.sDoingAnimation) {
                if (this.V) {
                    return false;
                }
                this.V = true;
                motionEvent.setAction(3);
            }
            if (!this.b || this.h) {
                if (this.g == null) {
                    this.g = VelocityTracker.obtain();
                }
                if (this.J == -1 || a) {
                    return false;
                }
                if (2 == motionEvent.getAction()) {
                    k();
                    if ("left".equals(this.M)) {
                        if (motionEvent.getRawX() < this.j) {
                            this.g.addMovement(motionEvent);
                        }
                    } else if ("right".equals(this.M) && motionEvent.getRawX() > this.j) {
                        this.g.addMovement(motionEvent);
                    }
                }
                if (1 == motionEvent.getAction() || 3 == motionEvent.getAction()) {
                    this.g.addMovement(motionEvent);
                }
                if (this.U) {
                    return e(motionEvent);
                }
                boolean z = this.F;
                if (z && this.G && this.H) {
                    if ((!a(this.r) && !a(this.s)) || ((view2 = this.u) != null && (view2 instanceof INativeView))) {
                        return d(motionEvent);
                    }
                } else if (z && !this.G && this.H) {
                    if ((!a(this.r) && !a(this.s)) || ((view = this.u) != null && (view instanceof INativeView))) {
                        return f(motionEvent);
                    }
                } else if (z && !this.H && this.G) {
                    if (!a(this.r) && !a(this.s)) {
                        return g(motionEvent);
                    }
                } else if (!z && this.G && !a(this.r)) {
                    return g(motionEvent);
                }
                return true;
            }
            return true;
        }
        return false;
    }

    private boolean e(String str) {
        JSONObject jSONObject;
        JSONObject jSONObject2;
        boolean z;
        this.t = this.r.obtainMainView();
        this.w = Integer.MAX_VALUE;
        this.y = Integer.MAX_VALUE;
        this.x = null;
        this.z = null;
        HashMap<String, DragBean> e2 = e();
        if (e2 == null || !e2.containsKey(str)) {
            return false;
        }
        DragBean dragBean = e2.get(str);
        if (dragBean != null) {
            this.L = dragBean.dragCbId;
            this.K = dragBean.dragCallBackWebView;
            JSONObject jSONObject3 = dragBean.dragCurrentViewOp;
            try {
                this.N = JSONUtil.getString(jSONObject3, "direction");
                if (jSONObject3.has("moveMode")) {
                    String string = JSONUtil.getString(jSONObject3, "moveMode");
                    this.E = string;
                    if (!"followFinger".equalsIgnoreCase(string) && !"follow".equalsIgnoreCase(this.E) && !"bounce".equalsIgnoreCase(this.E)) {
                        z = false;
                        this.G = z;
                    }
                    z = true;
                    this.G = z;
                }
                this.Z = 20.0f;
                if (jSONObject3.has("callbackStep")) {
                    try {
                        String string2 = jSONObject3.getString("callbackStep");
                        if (this.j0.matcher(string2).find()) {
                            this.Z = Integer.valueOf(string2).intValue();
                        }
                    } catch (Exception e3) {
                        e3.printStackTrace();
                    }
                }
                if (jSONObject3.has("over") && (jSONObject2 = JSONUtil.getJSONObject(jSONObject3, "over")) != null) {
                    if (jSONObject2.has("left")) {
                        this.w = PdrUtil.parseInt(JSONUtil.getString(jSONObject2, "left"), this.R, Integer.MAX_VALUE);
                    }
                    if (jSONObject2.has("action")) {
                        this.x = JSONUtil.getString(jSONObject2, "action");
                    }
                }
                if (jSONObject3.has(BindingXConstants.STATE_CANCEL) && (jSONObject = JSONUtil.getJSONObject(jSONObject3, BindingXConstants.STATE_CANCEL)) != null) {
                    if (jSONObject.has("left")) {
                        this.y = PdrUtil.parseInt(JSONUtil.getString(jSONObject, "left"), this.R, Integer.MAX_VALUE);
                    }
                    if (jSONObject.has("action")) {
                        this.z = JSONUtil.getString(jSONObject, "action");
                    }
                }
            } catch (Exception e4) {
                e4.printStackTrace();
                return false;
            }
        }
        return true;
    }

    public void b(MotionEvent motionEvent) {
        DisplayMetrics displayMetrics = this.Y;
        if (displayMetrics != null) {
            this.R = displayMetrics.widthPixels;
        }
        this.Q = motionEvent.getRawX();
        float rawX = motionEvent.getRawX();
        this.j = rawX;
        this.l = rawX;
        this.k = motionEvent.getRawY();
        this.h = false;
        this.F = false;
        this.v = false;
        this.V = false;
        this.J = -1;
        this.r.obtainWebView().loadUrl("javascript:window.__needNotifyNative__=true;");
        this.r.obtainWebView().setWebviewProperty("needTouchEvent", AbsoluteConst.FALSE);
        this.P = false;
        this.O = this.r.obtainWebView().obtainWindowView().getScrollY();
        if (this.g == null) {
            this.g = VelocityTracker.obtain();
        }
        this.g.addMovement(motionEvent);
    }

    public boolean a(MotionEvent motionEvent) {
        View view;
        View view2;
        if (this.b) {
            return true;
        }
        if (e() != null && !BaseInfo.sDoingAnimation && !a) {
            int actionMasked = motionEvent.getActionMasked();
            float rawX = motionEvent.getRawX();
            float rawY = motionEvent.getRawY();
            if (actionMasked != 0 || motionEvent.getEdgeFlags() == 0) {
                if (actionMasked == 0) {
                    b(motionEvent);
                } else if (actionMasked == 1) {
                    this.v = false;
                    this.J = -1;
                } else if (actionMasked == 2) {
                    if (this.O != this.r.obtainWebView().obtainWindowView().getScrollY()) {
                        this.P = true;
                    }
                    if (this.P) {
                        return false;
                    }
                    float f2 = rawX - this.j;
                    if (Math.abs(f2) >= Math.abs(rawY - this.k)) {
                        if (((float) (this.i * 3)) <= Math.abs(motionEvent.getRawX() - this.Q) && AbsoluteConst.FALSE.equals(this.r.obtainWebView().getWebviewProperty("needTouchEvent"))) {
                            String str = "right";
                            if (f2 >= 0.0f) {
                                if (!this.v && e("right")) {
                                    this.M = "right";
                                    this.h = true;
                                    this.v = true;
                                }
                            } else {
                                if (!this.v && e("left")) {
                                    this.M = "left";
                                    this.h = true;
                                    this.v = true;
                                }
                                str = "left";
                            }
                            if (-1 == this.J) {
                                this.j = rawX;
                                View a2 = a(str);
                                if (a2 != null) {
                                    HashMap<String, DragBean> e2 = e();
                                    String c2 = c(str);
                                    if (e2 != null && e2.containsKey(c2)) {
                                        a(e2.get(c2).dragBindViewOp);
                                    }
                                    this.M = str;
                                    this.h = true;
                                    this.u = a2;
                                    this.U = true;
                                    this.J = 1;
                                } else {
                                    b(this.M);
                                }
                            }
                        }
                    }
                }
                if (this.h) {
                    if (this.U) {
                        this.h = j();
                    } else {
                        boolean z = this.F;
                        if (z && this.G && this.H) {
                            if ((!a(this.r) && !a(this.s)) || ((view2 = this.u) != null && (view2 instanceof INativeView))) {
                                this.h = g();
                            }
                        } else if (z && !this.G && this.H) {
                            if ((!a(this.r) && !a(this.s)) || ((view = this.u) != null && (view instanceof INativeView))) {
                                this.h = f();
                            }
                        } else if (!z && this.G) {
                            if (!a(this.r)) {
                                h();
                            }
                        } else if (z && !this.H && this.G) {
                            if (!a(this.r) && !a(this.s)) {
                                this.h = h();
                            }
                        } else {
                            this.h = false;
                        }
                    }
                }
                if (this.h) {
                    if (!a(this.r)) {
                        this.c = this.r.obtainWebView().obtainWindowView().isVerticalScrollBarEnabled();
                        this.d = this.r.obtainWebView().obtainWindowView().isHorizontalScrollBarEnabled();
                        this.r.obtainWebView().obtainWindowView().setVerticalScrollBarEnabled(false);
                        this.r.obtainWebView().obtainWindowView().setHorizontalScrollBarEnabled(false);
                    }
                    View view3 = this.u;
                    if (view3 != null && (view3 instanceof com.dcloud.android.widget.AbsoluteLayout)) {
                        ((com.dcloud.android.widget.AbsoluteLayout) view3).getDrag().c(true);
                        if (!a(this.s)) {
                            this.e = this.s.obtainWebView().obtainWindowView().isVerticalScrollBarEnabled();
                            this.f = this.s.obtainWebView().obtainWindowView().isHorizontalScrollBarEnabled();
                            this.s.obtainWebView().obtainWindowView().setVerticalScrollBarEnabled(false);
                            this.s.obtainWebView().obtainWindowView().setHorizontalScrollBarEnabled(false);
                        }
                    }
                    a("start", false, WXInstanceApm.VALUE_ERROR_CODE_DEFAULT);
                    i();
                }
                return this.h;
            }
            return false;
        }
        this.h = false;
        return false;
    }

    private int b(String str) {
        View view;
        DragBean dragBean;
        int i = this.J;
        if (i != -1) {
            return i;
        }
        this.s = null;
        this.u = null;
        HashMap<String, DragBean> e2 = e();
        if (e2 != null && e2.containsKey(str) && (dragBean = e2.get(str)) != null) {
            a(dragBean.dragBindViewOp);
            IFrameView iFrameView = dragBean.dragBindWebView;
            if (iFrameView != null && (iFrameView instanceof io.dcloud.common.core.ui.b)) {
                this.F = true;
                io.dcloud.common.core.ui.b bVar = (io.dcloud.common.core.ui.b) iFrameView;
                this.s = bVar;
                this.u = bVar.obtainMainView();
            } else {
                View view2 = dragBean.nativeView;
                this.u = view2;
                if (view2 != null) {
                    this.F = true;
                }
            }
        }
        if (a(this.s) && ((view = this.u) == null || !(view instanceof INativeView))) {
            this.J = 0;
        } else if (this.u.getVisibility() != 0) {
            this.s = null;
            this.u = null;
            return 0;
        } else {
            if (this.u.getParent() == null && (this.t.getParent() instanceof FrameLayout) && !(this.u instanceof INativeView)) {
                this.s.pushToViewStack();
            }
            if (!a(this.t, this.u) && !(this.u instanceof INativeView)) {
                this.s = null;
                this.u = null;
                return 0;
            } else if (!(this.u instanceof INativeView) && this.H && this.t.getParent() != this.u.getParent()) {
                this.J = 0;
                return 0;
            } else {
                View view3 = this.u;
                if (view3 instanceof INativeView) {
                    view3.bringToFront();
                }
                int a2 = a(this.u);
                int a3 = a(this.t);
                if (a3 == 0) {
                    int width = this.t.getWidth();
                    int i2 = this.R;
                    if (width == i2 && (a2 >= i2 || a2 <= (-b(this.u)))) {
                        this.W = a2;
                        boolean z = this.G;
                        if (z && this.H) {
                            if ("right".equals(str)) {
                                this.m = a3 - b(this.u);
                            } else if ("left".equals(str)) {
                                this.m = a3 + this.t.getWidth();
                            }
                            b(this.u, this.m);
                        } else if (!z && this.H) {
                            if ("right".equals(str)) {
                                this.m = -b(this.u);
                            } else if ("left".equals(str)) {
                                this.m = this.t.getWidth();
                            }
                            b(this.u, this.m);
                        }
                    }
                }
                this.J = 1;
            }
        }
        return this.J;
    }

    private boolean f() {
        this.p = a(this.u);
        if ("right".equals(this.M)) {
            int i = this.A;
            if (Integer.MAX_VALUE != i) {
                this.q = i;
                return this.p != i;
            }
            this.q = b(this.u);
            int i2 = this.p;
            if (i2 == 0 || i2 == this.R) {
                return false;
            }
            if ("bounce".equalsIgnoreCase(this.E)) {
                this.q = this.p + (b(this.t) / 2);
                return true;
            } else if (this.p < 0) {
                this.q = 0;
                return true;
            } else {
                return true;
            }
        } else if ("left".equals(this.M)) {
            int i3 = this.A;
            if (Integer.MAX_VALUE != i3) {
                this.q = i3;
                return this.p != i3;
            }
            int b2 = b(this.u);
            this.q = -b2;
            if ("bounce".equalsIgnoreCase(this.E)) {
                this.q = this.p - (b(this.t) / 2);
                return true;
            }
            int i4 = this.R;
            if (b2 < i4) {
                int a2 = a(this.u) + b(this.u);
                if (a2 == this.R || a2 == 0) {
                    return false;
                }
                Rect rect = new Rect();
                this.u.getGlobalVisibleRect(rect);
                int i5 = this.R;
                if (i5 == rect.left) {
                    this.q = i5 - b2;
                    return true;
                } else if (rect.right == 0) {
                    this.q = 0;
                    return true;
                } else {
                    return true;
                }
            } else if (b2 != i4 || this.p <= 0) {
                return true;
            } else {
                this.q = 0;
                return true;
            }
        } else {
            return true;
        }
    }

    private boolean g() {
        return h() && f();
    }

    private void d() {
        this.T = true;
        a = true;
        this.t.requestLayout();
        this.t.getViewTreeObserver().addOnGlobalLayoutListener(new b());
    }

    public boolean d(String str) {
        VelocityTracker velocityTracker = this.g;
        if (velocityTracker != null) {
            velocityTracker.computeCurrentVelocity(1000, 1000.0f);
            float xVelocity = velocityTracker.getXVelocity();
            this.g.clear();
            this.g.recycle();
            this.g = null;
            return Math.abs(xVelocity) >= 200.0f;
        }
        return false;
    }

    private boolean e(MotionEvent motionEvent) {
        float f2;
        float f3;
        int i;
        int i2;
        View view;
        int width;
        int i3;
        int action = motionEvent.getAction();
        float rawX = motionEvent.getRawX();
        float rawY = motionEvent.getRawY();
        if (action != 0) {
            if (action != 1) {
                if (action == 2) {
                    float f4 = rawX - this.j;
                    this.j = rawX;
                    ViewGroup.LayoutParams layoutParams = this.t.getLayoutParams();
                    boolean z = layoutParams instanceof FrameLayout.LayoutParams;
                    if (z) {
                        f2 = ViewHelper.getX(this.t);
                    } else {
                        f2 = layoutParams instanceof AbsoluteLayout.LayoutParams ? ((AbsoluteLayout.LayoutParams) layoutParams).x : 0.0f;
                    }
                    View view2 = this.u;
                    if (view2 != null) {
                        ViewGroup.LayoutParams layoutParams2 = view2.getLayoutParams();
                        View view3 = this.u;
                        if (view3 instanceof INativeView) {
                            i = a(view3);
                        } else {
                            if (layoutParams2 instanceof FrameLayout.LayoutParams) {
                                f3 = ViewHelper.getX(view3);
                            } else if (layoutParams2 instanceof AbsoluteLayout.LayoutParams) {
                                i = ((AbsoluteLayout.LayoutParams) layoutParams2).x;
                            } else {
                                f3 = 0.0f;
                            }
                            i2 = (0.0f > f2 ? 1 : (0.0f == f2 ? 0 : -1));
                            if (i2 != 0) {
                                if ("right".equals(this.M)) {
                                    if (f2 + f4 < 0.0f) {
                                        width = (int) (this.t.getWidth() + f2);
                                        i3 = this.R;
                                    }
                                    f4 = -f2;
                                } else if ("left".equals(this.M)) {
                                    if (f2 + f4 > 0.0f) {
                                        width = (int) (this.t.getWidth() + f2);
                                        i3 = this.R;
                                    }
                                    f4 = -f2;
                                }
                            }
                            if (!"right".equals(this.M)) {
                                float f5 = this.R;
                                if (f3 + f4 >= f5) {
                                    f4 = f5 - f3;
                                } else {
                                    int b2 = (int) (f3 + b(this.u));
                                    int i4 = this.R;
                                    if (b2 + f4 <= i4) {
                                        f4 = i4 - b2;
                                    }
                                }
                            } else if ("left".equals(this.M)) {
                                int b3 = (int) (b(this.u) + f3);
                                if (b3 + f4 <= 0.0f) {
                                    f4 = -b3;
                                } else if (f3 + f4 >= 0.0f) {
                                    f4 = -f3;
                                }
                            }
                            if (i2 != 0) {
                                if (z) {
                                    View view4 = this.t;
                                    ViewHelper.setX(view4, ViewHelper.getX(view4) + f4);
                                } else if (layoutParams instanceof AbsoluteLayout.LayoutParams) {
                                    ((AbsoluteLayout.LayoutParams) layoutParams).x += (int) f4;
                                    this.t.requestLayout();
                                }
                            }
                            view = this.u;
                            if (!(view instanceof INativeView)) {
                                b(view, (int) (f2 + f4));
                                this.u.requestLayout();
                                this.u.invalidate();
                            } else if (layoutParams2 instanceof FrameLayout.LayoutParams) {
                                ViewHelper.setX(view, ViewHelper.getX(view) + f4);
                            } else if (layoutParams2 instanceof AbsoluteLayout.LayoutParams) {
                                ((AbsoluteLayout.LayoutParams) layoutParams2).x += (int) f4;
                                view.requestLayout();
                            }
                        }
                        f3 = i;
                        i2 = (0.0f > f2 ? 1 : (0.0f == f2 ? 0 : -1));
                        if (i2 != 0) {
                        }
                        if (!"right".equals(this.M)) {
                        }
                        if (i2 != 0) {
                        }
                        view = this.u;
                        if (!(view instanceof INativeView)) {
                        }
                    }
                }
            }
            this.U = false;
            this.h = false;
            if (this.I) {
                b();
            }
            return false;
        }
        this.j = rawX;
        this.k = rawY;
        return true;
    }

    private void c() {
        this.T = true;
        a = true;
        View view = this.u;
        if (view != null) {
            view.requestLayout();
            this.u.getViewTreeObserver().addOnGlobalLayoutListener(new a());
        }
    }

    private String c(String str) {
        if ("left".equals(str)) {
            return "right";
        }
        if ("right".equals(str)) {
            return "left";
        }
        return null;
    }

    public void b(boolean z) {
        if (this.T) {
            this.T = false;
            a("end", z, z ? "100" : WXInstanceApm.VALUE_ERROR_CODE_DEFAULT);
        }
    }

    private void b() {
        this.T = true;
        a = true;
        if (this.u != null) {
            this.t.requestLayout();
            this.t.getViewTreeObserver().addOnGlobalLayoutListener(new f());
        }
    }

    public int b(View view) {
        if (view != null) {
            if (view instanceof INativeView) {
                return ((INativeView) view).getStyleWidth();
            }
            return view.getWidth();
        }
        return 0;
    }

    public void b(View view, int i) {
        if (view != null) {
            if (view instanceof INativeView) {
                ((INativeView) view).setStyleLeft(i);
            } else if (view.getLayoutParams() instanceof AbsoluteLayout.LayoutParams) {
                AbsoluteLayout.LayoutParams layoutParams = (AbsoluteLayout.LayoutParams) view.getLayoutParams();
                layoutParams.height = view.getHeight();
                layoutParams.width = view.getWidth();
                ViewHelper.setX(view, i);
                view.requestLayout();
            } else if (view.getLayoutParams() instanceof FrameLayout.LayoutParams) {
                ViewHelper.setX(view, i);
            }
        }
    }

    private void a(JSONObject jSONObject) {
        JSONObject jSONObject2;
        JSONObject jSONObject3;
        if (jSONObject != null) {
            this.A = Integer.MAX_VALUE;
            this.C = Integer.MAX_VALUE;
            this.B = null;
            this.D = null;
            this.H = "follow".equalsIgnoreCase(JSONUtil.getString(jSONObject, "moveMode"));
            if (jSONObject.has("over") && (jSONObject3 = JSONUtil.getJSONObject(jSONObject, "over")) != null) {
                if (jSONObject3.has("left")) {
                    this.A = PdrUtil.parseInt(JSONUtil.getString(jSONObject3, "left"), this.R, Integer.MAX_VALUE);
                }
                if (jSONObject3.has("action")) {
                    this.B = JSONUtil.getString(jSONObject3, "action");
                }
            }
            if (!jSONObject.has(BindingXConstants.STATE_CANCEL) || (jSONObject2 = JSONUtil.getJSONObject(jSONObject, BindingXConstants.STATE_CANCEL)) == null) {
                return;
            }
            if (jSONObject2.has("left")) {
                this.C = PdrUtil.parseInt(JSONUtil.getString(jSONObject2, "left"), this.R, Integer.MAX_VALUE);
            }
            if (jSONObject2.has("action")) {
                this.D = JSONUtil.getString(jSONObject2, "action");
            }
        }
    }

    private boolean a(View view, View view2) {
        if (view != null && view2 != null) {
            ViewParent parent = view2.getParent();
            for (ViewParent parent2 = view.getParent(); parent2 != null && parent2 != view2; parent2 = parent2.getParent()) {
                while (parent != null) {
                    if (parent == view) {
                        return false;
                    }
                    if (parent2 == parent) {
                        return true;
                    }
                    parent = parent.getParent();
                }
                parent = view2.getParent();
            }
            return false;
        }
        return false;
    }

    private void a() {
        this.T = true;
        a = true;
        this.t.requestLayout();
        this.t.getViewTreeObserver().addOnGlobalLayoutListener(new c());
    }

    public void a(boolean z, boolean z2) {
        if (this.T) {
            this.T = false;
            a("end", z, z2, z ? "100" : WXInstanceApm.VALUE_ERROR_CODE_DEFAULT);
        }
    }

    public void a(View view, int i) {
        io.dcloud.common.core.ui.b bVar;
        io.dcloud.common.core.ui.b bVar2;
        if (view != null) {
            if (view == this.t && (bVar2 = this.r) != null) {
                bVar2.obtainFrameOptions().left = i;
                this.r.obtainFrameOptions().checkValueIsPercentage("left", i, this.R, true, true);
            } else if (view != this.u || (bVar = this.s) == null) {
            } else {
                bVar.obtainFrameOptions().left = i;
                this.s.obtainFrameOptions().checkValueIsPercentage("left", i, this.R, true, true);
            }
        }
    }

    public ValueAnimator a(View view, int i, int i2, boolean z) {
        return a(view, i, i2, z, false);
    }

    public ValueAnimator a(View view, int i, int i2, boolean z, boolean z2) {
        ValueAnimator valueAnimator = null;
        if (view == null) {
            return null;
        }
        ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
        if (view instanceof INativeView) {
            valueAnimator = ValueAnimator.ofInt(i, i2);
        } else if (layoutParams instanceof AbsoluteLayout.LayoutParams) {
            valueAnimator = ValueAnimator.ofInt(i, i2);
        } else if (layoutParams instanceof FrameLayout.LayoutParams) {
            valueAnimator = ValueAnimator.ofFloat(i, i2);
        }
        valueAnimator.setDuration(Math.min(Math.max(new BigDecimal(450).multiply(new BigDecimal(Math.abs(i2 - i)).divide(new BigDecimal(this.R), 4, 4)).longValue(), 200L), 250L));
        valueAnimator.addListener(new d(z, z2, view, i2));
        valueAnimator.addUpdateListener(new e(view));
        return valueAnimator;
    }

    private void a(String str, boolean z, String str2) {
        a(str, z, false, str2);
    }

    public void a(String str, boolean z, boolean z2, String str2) {
        String str3;
        io.dcloud.common.core.ui.b bVar;
        String str4;
        String format;
        if ("end".equals(str)) {
            if (!a(this.r)) {
                this.r.obtainWebView().obtainWindowView().setVerticalScrollBarEnabled(this.c);
                this.r.obtainWebView().obtainWindowView().setHorizontalScrollBarEnabled(this.d);
            }
            View view = this.u;
            if (view != null && (view instanceof com.dcloud.android.widget.AbsoluteLayout)) {
                ((com.dcloud.android.widget.AbsoluteLayout) view).getDrag().c(false);
                if (!a(this.s)) {
                    this.s.obtainWebView().obtainWindowView().setVerticalScrollBarEnabled(this.e);
                    WebView obtainWebview = this.s.obtainWebView().obtainWebview();
                    if (obtainWebview != null) {
                        obtainWebview.setHorizontalScrollbarOverlay(this.f);
                    }
                }
            }
        }
        if (this.K == null || TextUtils.isEmpty(this.L) || TextUtils.isEmpty(str)) {
            return;
        }
        View view2 = this.u;
        String str5 = null;
        if (view2 != null) {
            if (view2 instanceof INativeView) {
                str3 = ((INativeView) view2).getViewId();
            } else {
                io.dcloud.common.core.ui.b bVar2 = this.s;
                if (bVar2 != null && bVar2.obtainWebView() != null) {
                    str3 = this.s.obtainWebView().obtainFrameId();
                }
            }
            bVar = this.r;
            if (bVar != null && bVar.obtainWebView() != null) {
                str5 = this.r.obtainWebView().obtainFrameId();
            }
            str4 = (z ? !z2 : z2) ? str5 : str3;
            if (a(this.s) && this.s.isWebviewCovered()) {
                if (!a(this.r) && !this.r.isWebviewCovered()) {
                    str4 = str5;
                }
            } else if (!a(this.r) && this.r.isWebviewCovered() && !a(this.s) && !this.s.isWebviewCovered()) {
                str4 = str3;
            }
            if (TextUtils.isEmpty(str4)) {
                str4 = Constants.Name.UNDEFINED;
            }
            String str6 = "";
            if (TextUtils.isEmpty(str5)) {
                str5 = "";
            }
            if (TextUtils.isEmpty(str3)) {
                str3 = "";
            }
            if (!"left".equals(this.M)) {
                str6 = Constants.Name.RTL;
            } else if ("right".equals(this.M)) {
                str6 = "ltr";
            }
            if (this.K.obtainWebView() == null) {
                if ("end".equals(str)) {
                    format = StringUtil.format("{\"type\":\"%s\",\"result\":%b,\"id\":\"%s\",\"targetId\":\"%s\",\"otherId\":\"%s\",\"direction\":\"%s\",\"progress\":\"%s\"}", str, Boolean.valueOf(z), str4, str5, str3, str6, str2);
                } else {
                    format = StringUtil.format("{\"type\":\"%s\",\"id\":\"%s\",\"targetId\":\"%s\",\"otherId\":\"%s\",\"direction\":\"%s\",\"progress\":\"%s\"}", str, str4, str5, str3, str6, str2);
                }
                Deprecated_JSUtil.execCallback(this.K.obtainWebView(), this.L, format, JSUtil.OK, true, true);
                return;
            }
            return;
        }
        str3 = null;
        bVar = this.r;
        if (bVar != null) {
            str5 = this.r.obtainWebView().obtainFrameId();
        }
        if (z) {
        }
        if (a(this.s)) {
        }
        if (!a(this.r)) {
            str4 = str3;
        }
        if (TextUtils.isEmpty(str4)) {
        }
        String str62 = "";
        if (TextUtils.isEmpty(str5)) {
        }
        if (TextUtils.isEmpty(str3)) {
        }
        if (!"left".equals(this.M)) {
        }
        if (this.K.obtainWebView() == null) {
        }
    }

    public View a(String str) {
        DragBean dragBean;
        IFrameView iFrameView;
        View obtainMainView;
        String c2 = c(str);
        HashMap<String, DragBean> hashMap = this.r.obtainFrameOptions().dragData;
        if (hashMap == null || !hashMap.containsKey(c2) || (dragBean = hashMap.get(c2)) == null || (iFrameView = dragBean.dragBindWebView) == null || !"follow".equalsIgnoreCase(JSONUtil.getString(dragBean.dragBindViewOp, "moveMode")) || (obtainMainView = iFrameView.obtainMainView()) == null || obtainMainView.getVisibility() != 0 || obtainMainView.getWidth() >= this.R) {
            return null;
        }
        int a2 = a(obtainMainView);
        int width = obtainMainView.getWidth() + a2;
        if ((a2 < 0 || a2 >= this.R) && (width <= 0 || width > this.R)) {
            return null;
        }
        return obtainMainView;
    }

    private float a(float f2) {
        if (!"bounce".equalsIgnoreCase(this.E) || 0.0f == f2) {
            return f2;
        }
        boolean z = f2 < 0.0f;
        float floatValue = new BigDecimal(f2).multiply(new BigDecimal(Math.abs(this.o - a(this.t))).divide(new BigDecimal(this.o - this.n), 4, 4)).floatValue();
        if (z) {
            floatValue = -floatValue;
        }
        return z ? Math.min(floatValue, -2.0f) : Math.max(floatValue, 2.0f);
    }

    public int a(View view) {
        if (view != null) {
            if (view instanceof INativeView) {
                return ((INativeView) view).getStyleLeft();
            }
            if (view.getLayoutParams() instanceof AbsoluteLayout.LayoutParams) {
                return (int) ViewHelper.getX(view);
            }
            if (view.getLayoutParams() instanceof FrameLayout.LayoutParams) {
                return (int) ViewHelper.getX(view);
            }
            return 0;
        }
        return 0;
    }

    private boolean a(io.dcloud.common.core.ui.b bVar) {
        if (bVar != null) {
            if (bVar == null || bVar.obtainWebView() != null) {
                if (bVar == null || bVar.obtainMainView() != null) {
                    return bVar != null && bVar.obtainWebView() == null && bVar.obtainMainView() == null;
                }
                return true;
            }
            return true;
        }
        return true;
    }
}