package com.scwang.smartrefresh.header.fungame;

import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.scwang.smartrefresh.header.R$styleable;
import ඓ.㿎.K.ῲ.Ԕ.AbstractC1391;
import ඓ.㿎.K.ῲ.Ԕ.AbstractC1396;
import ඓ.㿎.K.ῲ.Ԕ.AbstractC1401;
import ඓ.㿎.K.ῲ.䀟.C1436;
import ඓ.㿎.K.K.ᨨ.C1442;
import ῲ.ᨨ.ʬ.C1718;

public class FunGameHeader extends FunGameBase implements AbstractC1391 {

    /* renamed from: Ԕ  reason: contains not printable characters */
    public TextView f3164;

    /* renamed from: Ԛ  reason: contains not printable characters */
    public int f3165 = 16;

    /* renamed from: ؿ  reason: contains not printable characters */
    public int f3166;

    /* renamed from: ݜ  reason: contains not printable characters */
    public String f3167 = "拖动控制游戏";

    /* renamed from: ᓣ  reason: contains not printable characters */
    public boolean f3168 = false;

    /* renamed from: ᕣ  reason: contains not printable characters */
    public float f3169 = 1.0f;

    /* renamed from: 㑃  reason: contains not printable characters */
    public RelativeLayout f3170;

    /* renamed from: 㗗  reason: contains not printable characters */
    public TextView f3171;

    /* renamed from: 㗽  reason: contains not printable characters */
    public String f3172 = "下拉即将展开";

    /* renamed from: 䀟  reason: contains not printable characters */
    public int f3173 = 16;

    /* renamed from: 䁗  reason: contains not printable characters */
    public RelativeLayout f3174;

    public FunGameHeader(Context context) {
        super(context);
        m1785(context, null);
    }

    public void setBottomMaskViewText(String str) {
        this.f3167 = str;
        this.f3171.setText(str);
    }

    @Override // ඓ.㿎.K.ῲ.Ԕ.AbstractC1399, com.scwang.smartrefresh.header.fungame.FunGameBase
    public void setPrimaryColors(int... iArr) {
        super.setPrimaryColors(iArr);
        if (iArr.length > 0) {
            this.f3164.setTextColor(iArr[0]);
            this.f3171.setTextColor(iArr[0]);
            if (iArr.length > 1) {
                this.f3174.setBackgroundColor(C1718.m4410(iArr[1], 200));
                this.f3164.setBackgroundColor(C1718.m4410(iArr[1], 200));
                this.f3171.setBackgroundColor(C1718.m4410(iArr[1], 200));
            }
        }
    }

    public void setTopMaskViewText(String str) {
        this.f3172 = str;
        this.f3164.setText(str);
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public void m1782() {
    }

    /* renamed from: ඓ  reason: contains not printable characters */
    public void m1783() {
        if (!this.f3168) {
            TextView textView = this.f3164;
            ObjectAnimator ofFloat = ObjectAnimator.ofFloat(textView, "translationY", textView.getTranslationY(), (float) (-this.f3166));
            TextView textView2 = this.f3171;
            ObjectAnimator ofFloat2 = ObjectAnimator.ofFloat(textView2, "translationY", textView2.getTranslationY(), (float) this.f3166);
            RelativeLayout relativeLayout = this.f3174;
            ObjectAnimator ofFloat3 = ObjectAnimator.ofFloat(relativeLayout, "alpha", relativeLayout.getAlpha(), 0.0f);
            AnimatorSet animatorSet = new AnimatorSet();
            animatorSet.play(ofFloat).with(ofFloat2).with(ofFloat3);
            animatorSet.setDuration(800L);
            animatorSet.setStartDelay(200);
            animatorSet.start();
            animatorSet.addListener(new C1442(this));
            this.f3168 = true;
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public final void m1785(Context context, AttributeSet attributeSet) {
        TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R$styleable.FunGameHeader);
        if (obtainStyledAttributes.hasValue(R$styleable.FunGameHeader_fgvMaskTopText)) {
            this.f3172 = obtainStyledAttributes.getString(R$styleable.FunGameHeader_fgvMaskTopText);
        }
        if (obtainStyledAttributes.hasValue(R$styleable.FunGameHeader_fgvMaskBottomText)) {
            this.f3167 = obtainStyledAttributes.getString(R$styleable.FunGameHeader_fgvMaskBottomText);
        }
        this.f3173 = obtainStyledAttributes.getDimensionPixelSize(R$styleable.FunGameHeader_fgvBottomTextSize, this.f3173);
        this.f3165 = obtainStyledAttributes.getDimensionPixelSize(R$styleable.FunGameHeader_fgvBottomTextSize, this.f3165);
        obtainStyledAttributes.recycle();
        this.f3170 = new RelativeLayout(context);
        this.f3174 = new RelativeLayout(context);
        this.f3174.setBackgroundColor(Color.parseColor("#3A3A3A"));
        this.f3164 = m1784(context, this.f3172, this.f3173, 80);
        this.f3171 = m1784(context, this.f3167, this.f3165, 48);
        this.f3169 = (float) Math.max(1, C1436.m3649(0.5f));
    }

    /* renamed from: 㸾  reason: contains not printable characters */
    public void m1789() {
        this.f3168 = false;
        TextView textView = this.f3164;
        textView.setTranslationY(textView.getTranslationY() + ((float) this.f3166));
        TextView textView2 = this.f3171;
        textView2.setTranslationY(textView2.getTranslationY() - ((float) this.f3166));
        this.f3174.setAlpha(1.0f);
        this.f3164.setVisibility(0);
        this.f3171.setVisibility(0);
        this.f3174.setVisibility(0);
    }

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

    /* renamed from: K  reason: contains not printable characters */
    public final TextView m1784(Context context, String str, int i, int i2) {
        TextView textView = new TextView(context);
        textView.setTextColor(-16777216);
        textView.setBackgroundColor(-1);
        textView.setGravity(i2 | 1);
        textView.setTextSize(2, (float) i);
        textView.setText(str);
        return textView;
    }

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

    @Override // ඓ.㿎.K.ῲ.Ԕ.AbstractC1399, com.scwang.smartrefresh.header.fungame.FunGameBase
    /* renamed from: K  reason: contains not printable characters */
    public void m1786(AbstractC1396 r2, int i, int i2) {
        super.m1777(r2, i, i2);
        if (getChildCount() < 2 && !isInEditMode()) {
            FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-1, this.f3154);
            addView(this.f3174, layoutParams);
            addView(this.f3170, layoutParams);
            this.f3166 = (int) (((float) this.f3154) * 0.5f);
            RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(-1, this.f3166);
            RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(-1, this.f3166);
            layoutParams3.topMargin = this.f3154 - this.f3166;
            this.f3170.addView(this.f3164, layoutParams2);
            this.f3170.addView(this.f3171, layoutParams3);
        }
    }

    @Override // ඓ.㿎.K.ῲ.Ԕ.AbstractC1399, com.scwang.smartrefresh.header.fungame.FunGameBase
    /* renamed from: K  reason: contains not printable characters */
    public void m1788(AbstractC1401 r1, int i, int i2) {
        m1783();
    }

    @Override // ඓ.㿎.K.ῲ.Ԕ.AbstractC1399, com.scwang.smartrefresh.header.fungame.FunGameBase
    /* renamed from: K  reason: contains not printable characters */
    public void m1787(AbstractC1401 r1) {
        if (!this.f3155) {
            m1789();
        }
    }
}
