package com.scwang.smartrefresh.header.fungame;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.google.android.material.progressindicator.BaseProgressIndicator;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.constant.RefreshState;
import com.scwang.smartrefresh.layout.constant.SpinnerStyle;
import ඓ.㿎.K.ῲ.Ԕ.AbstractC1390;
import ඓ.㿎.K.ῲ.Ԕ.AbstractC1391;
import ඓ.㿎.K.ῲ.Ԕ.AbstractC1393;
import ඓ.㿎.K.ῲ.Ԕ.AbstractC1396;
import ඓ.㿎.K.ῲ.Ԕ.AbstractC1401;
import ඓ.㿎.K.ῲ.ᓣ.AbstractC1418;
import ඓ.㿎.K.ῲ.ᓣ.C1414;
import ඓ.㿎.K.K.ᨨ.RunnableC1443;

public class FunGameBase extends FrameLayout implements AbstractC1391 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public int f3154;

    /* renamed from: ඓ  reason: contains not printable characters */
    public boolean f3155;

    /* renamed from: ᨨ  reason: contains not printable characters */
    public AbstractC1390 f3156;

    /* renamed from: ῲ  reason: contains not printable characters */
    public int f3157;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public float f3158;

    /* renamed from: 㳳  reason: contains not printable characters */
    public boolean f3159;

    /* renamed from: 㴹  reason: contains not printable characters */
    public Runnable f3160;

    /* renamed from: 㸾  reason: contains not printable characters */
    public RefreshState f3161;

    /* renamed from: 㿎  reason: contains not printable characters */
    public AbstractC1396 f3162;

    /* renamed from: com.scwang.smartrefresh.header.fungame.FunGameBase$K  reason: contains not printable characters */
    public class C0555 extends AbstractC1418 {
        public C0555() {
        }

        @Override // ඓ.㿎.K.ῲ.Ԕ.AbstractC1392
        /* renamed from: K  reason: contains not printable characters */
        public void m1781(AbstractC1393.AbstractC1394 k, AbstractC1401 r4) {
            FunGameBase funGameBase = FunGameBase.this;
            if (funGameBase.f3155) {
                k.getClass();
                funGameBase.f3160 = new RunnableC1443(k);
                FunGameBase.this.m1778(r4);
                return;
            }
            funGameBase.f3160 = null;
            k.m3603(new Object[0]);
        }
    }

    public FunGameBase(Context context) {
        super(context);
    }

    @Override // ඓ.㿎.K.ῲ.Ԕ.AbstractC1399
    public SpinnerStyle getSpinnerStyle() {
        return SpinnerStyle.FixedFront;
    }

    @Override // ඓ.㿎.K.ῲ.Ԕ.AbstractC1399
    public View getView() {
        return this;
    }

    public void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        this.f3162 = null;
        this.f3156 = null;
    }

    public boolean onInterceptTouchEvent(MotionEvent motionEvent) {
        return this.f3161 == RefreshState.Refreshing || super.onInterceptTouchEvent(motionEvent);
    }

    /* JADX WARNING: Code restructure failed: missing block: B:11:0x001c, code lost:
        if (r0 != 3) goto L_0x0052;
     */
    public boolean onTouchEvent(MotionEvent motionEvent) {
        if (this.f3161 != RefreshState.Refreshing) {
            return super.onTouchEvent(motionEvent);
        }
        if (!this.f3155) {
            m1773();
        }
        int action = motionEvent.getAction() & BaseProgressIndicator.MAX_ALPHA;
        if (action != 0) {
            if (action != 1) {
                if (action == 2) {
                    SmartRefreshLayout.this.m1844(motionEvent.getRawY() - this.f3158);
                }
            }
            this.f3158 = 0.0f;
            AbstractC1396 r4 = this.f3162;
            SmartRefreshLayout.this.m1845(this.f3154, true);
            m1775();
        } else {
            this.f3158 = motionEvent.getRawY();
            SmartRefreshLayout.this.m1845(0, true);
        }
        return true;
    }

    public void setLayoutParams(ViewGroup.LayoutParams layoutParams) {
        super.setLayoutParams(layoutParams);
        layoutParams.height = -3;
    }

    @Override // ඓ.㿎.K.ῲ.Ԕ.AbstractC1399
    public void setPrimaryColors(int... iArr) {
    }

    public void setTranslationY(float f) {
        if (!isInEditMode()) {
            super.setTranslationY(f);
        }
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public void m1772(float f, int i, int i2, int i3) {
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public void m1773() {
        this.f3155 = true;
        this.f3156 = SmartRefreshLayout.this.f3229;
        ((C1414) this.f3156).f5346.offsetTopAndBottom(this.f3154);
        this.f3159 = SmartRefreshLayout.this.m3613();
        SmartRefreshLayout.this.m3612(false);
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m1775() {
        this.f3155 = false;
        ((C1414) this.f3156).f5346.offsetTopAndBottom(-this.f3154);
        SmartRefreshLayout.this.m3612(this.f3159);
        Runnable runnable = this.f3160;
        if (runnable != null) {
            runnable.run();
        }
    }

    @Override // ඓ.㿎.K.ῲ.Ԕ.AbstractC1399
    /* renamed from: K  reason: contains not printable characters */
    public void m1778(AbstractC1401 r1) {
    }

    @Override // ඓ.㿎.K.ῲ.Ԕ.AbstractC1399
    /* renamed from: K  reason: contains not printable characters */
    public void m1779(AbstractC1401 r1, int i, int i2) {
    }

    public FunGameBase(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
    }

    public FunGameBase(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
    }

    @Override // ඓ.㿎.K.ῲ.Ԕ.AbstractC1391
    /* renamed from: K  reason: contains not printable characters */
    public void m1776(float f, int i, int i2, int i3) {
        if (this.f3155) {
            m1772(f, i, i2, i3);
            return;
        }
        this.f3157 = i;
        setTranslationY((float) (this.f3157 - this.f3154));
    }

    @Override // ඓ.㿎.K.ῲ.ݜ.AbstractC1408
    /* renamed from: K  reason: contains not printable characters */
    public void m1780(AbstractC1401 r1, RefreshState refreshState, RefreshState refreshState2) {
        this.f3161 = refreshState2;
    }

    @Override // ඓ.㿎.K.ῲ.Ԕ.AbstractC1391
    /* renamed from: ῲ  reason: contains not printable characters */
    public void m1774(float f, int i, int i2, int i3) {
        m1776(f, i, i2, i3);
    }

    @Override // ඓ.㿎.K.ῲ.Ԕ.AbstractC1399
    /* renamed from: K  reason: contains not printable characters */
    public void m1777(AbstractC1396 r1, int i, int i2) {
        this.f3162 = r1;
        this.f3154 = i;
        setTranslationY((float) (this.f3157 - this.f3154));
        ((SmartRefreshLayout.C0559) r1).m1854(new C0555());
    }
}
