package com.scwang.smartrefresh.layout.footer;

import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.widget.AppCompatTextView;
import com.scwang.smartrefresh.layout.R$styleable;
import com.scwang.smartrefresh.layout.constant.RefreshState;
import com.scwang.smartrefresh.layout.constant.SpinnerStyle;
import ඓ.㿎.K.ῲ.Ԕ.AbstractC1396;
import ඓ.㿎.K.ῲ.Ԕ.AbstractC1400;
import ඓ.㿎.K.ῲ.Ԕ.AbstractC1401;
import ඓ.㿎.K.ῲ.㗗.RunnableC1427;
import ඓ.㿎.K.ῲ.㗽.C1430;

public class ClassicsFooter extends LinearLayout implements AbstractC1400 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public ImageView f3282;

    /* renamed from: ඓ  reason: contains not printable characters */
    public SpinnerStyle f3283 = SpinnerStyle.Translate;

    /* renamed from: ῲ  reason: contains not printable characters */
    public TextView f3284;

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

    /* renamed from: 㸾  reason: contains not printable characters */
    public C1430 f3286;

    public ClassicsFooter(Context context) {
        super(context);
        m1864(context, (AttributeSet) null, 0);
    }

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

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

    @Override // ඓ.㿎.K.ῲ.Ԕ.AbstractC1399
    public void setPrimaryColors(int... iArr) {
        if (this.f3283 != SpinnerStyle.FixedBehind) {
            return;
        }
        if (iArr.length > 1) {
            setBackgroundColor(iArr[0]);
            this.f3284.setTextColor(iArr[1]);
            C1430 r0 = this.f3286;
            r0.f5385.setColor(iArr[1]);
        } else if (iArr.length > 0) {
            setBackgroundColor(iArr[0]);
            if (iArr[0] == -1) {
                this.f3284.setTextColor(-10066330);
                this.f3286.f5385.setColor(-10066330);
                return;
            }
            this.f3284.setTextColor(-1);
            this.f3286.f5385.setColor(-1);
        }
    }

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

    /* renamed from: K  reason: contains not printable characters */
    public final void m1864(Context context, AttributeSet attributeSet, int i) {
        float f = Resources.getSystem().getDisplayMetrics().density;
        setGravity(17);
        setMinimumHeight((int) ((60.0f * f) + 0.5f));
        this.f3286 = new C1430();
        this.f3286.f5385.setColor(-10066330);
        this.f3282 = new ImageView(context);
        this.f3282.setImageDrawable(this.f3286);
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams((int) ((16.0f * f) + 0.5f), (int) ((16.0f * f) + 0.5f));
        layoutParams.rightMargin = (int) ((10.0f * f) + 0.5f);
        addView(this.f3282, layoutParams);
        this.f3284 = new AppCompatTextView(context, attributeSet, i);
        this.f3284.setTextColor(-10066330);
        this.f3284.setTextSize(16.0f);
        this.f3284.setText("上拉加载更多");
        addView(this.f3284, -2, -2);
        if (!isInEditMode()) {
            this.f3282.setVisibility(8);
        }
        TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R$styleable.ClassicsFooter);
        this.f3283 = SpinnerStyle.values()[obtainStyledAttributes.getInt(R$styleable.ClassicsFooter_srlClassicsSpinnerStyle, this.f3283.ordinal())];
        if (obtainStyledAttributes.hasValue(R$styleable.ClassicsFooter_srlAccentColor)) {
            m1863(obtainStyledAttributes.getColor(R$styleable.ClassicsFooter_srlAccentColor, 0));
        }
        obtainStyledAttributes.recycle();
    }

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

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

    public ClassicsFooter(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        m1864(context, attributeSet, 0);
    }

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

    @Override // ඓ.㿎.K.ῲ.Ԕ.AbstractC1399
    /* renamed from: K  reason: contains not printable characters */
    public void m1867(AbstractC1401 r1, int i, int i2) {
        this.f3282.setVisibility(0);
        this.f3286.start();
    }

    @Override // ඓ.㿎.K.ῲ.Ԕ.AbstractC1399
    /* renamed from: K  reason: contains not printable characters */
    public void m1866(AbstractC1401 r2) {
        this.f3286.stop();
        this.f3282.setVisibility(8);
    }

    @Override // ඓ.㿎.K.ῲ.ݜ.AbstractC1408
    /* renamed from: K  reason: contains not printable characters */
    public void m1868(AbstractC1401 r1, RefreshState refreshState, RefreshState refreshState2) {
        int ordinal = refreshState2.ordinal();
        if (ordinal == 0) {
            Runnable runnable = this.f3285;
            if (runnable != null) {
                runnable.run();
                this.f3285 = null;
            }
        } else if (ordinal != 2) {
            if (ordinal == 6) {
                this.f3284.setText("释放立即加载");
                if (this.f3285 == null && this.f3283 == SpinnerStyle.FixedBehind) {
                    this.f3285 = new RunnableC1427(this, r1);
                    r1.getLayout().setBackgroundDrawable(getBackground());
                    return;
                }
                return;
            } else if (ordinal == 8) {
                this.f3284.setText("正在加载...");
                return;
            } else {
                return;
            }
        }
        this.f3284.setText("上拉加载更多");
    }

    /* renamed from: K  reason: contains not printable characters */
    public ClassicsFooter m1863(int i) {
        this.f3284.setTextColor(i);
        this.f3286.f5385.setColor(i);
        return this;
    }
}
