package defpackage;

import android.view.View;
import android.view.ViewPropertyAnimator;
import android.webkit.WebView;
import android.widget.ImageView;
import com.strmr.ps.R;

/* JADX INFO: loaded from: classes3.dex */
public final /* synthetic */ class km4 implements Runnable {
    public final /* synthetic */ int a;
    public final /* synthetic */ jm4 b;

    public /* synthetic */ km4(jm4 jm4Var, int i) {
        this.a = i;
        this.b = jm4Var;
    }

    @Override // java.lang.Runnable
    public final void run() {
        ViewPropertyAnimator viewPropertyAnimatorAnimate;
        ViewPropertyAnimator viewPropertyAnimatorAlpha;
        ViewPropertyAnimator duration;
        ViewPropertyAnimator viewPropertyAnimatorAnimate2;
        ViewPropertyAnimator viewPropertyAnimatorAlpha2;
        ViewPropertyAnimator duration2;
        ViewPropertyAnimator viewPropertyAnimatorWithEndAction;
        ViewPropertyAnimator viewPropertyAnimatorAnimate3;
        ViewPropertyAnimator viewPropertyAnimatorAlpha3;
        ViewPropertyAnimator duration3;
        ViewPropertyAnimator viewPropertyAnimatorWithEndAction2;
        ViewPropertyAnimator viewPropertyAnimatorAlpha4;
        ViewPropertyAnimator duration4;
        switch (this.a) {
            case 0:
                jm4.b(this.b);
                break;
            case 1:
                jm4 jm4Var = this.b;
                jm4Var.o = true;
                fx4 fx4Var = jm4Var.h;
                if (fx4Var != null) {
                    ((rx4) fx4Var).h(null);
                }
                View view = jm4Var.l;
                if (view != null) {
                    View viewFindViewById = view.findViewById(R.id.expanded_scrim);
                    ImageView imageView = (ImageView) view.findViewById(R.id.expanded_logo);
                    jm4Var.h();
                    if (viewFindViewById != null && (viewPropertyAnimatorAnimate3 = viewFindViewById.animate()) != null && (viewPropertyAnimatorAlpha3 = viewPropertyAnimatorAnimate3.alpha(0.0f)) != null && (duration3 = viewPropertyAnimatorAlpha3.setDuration(300L)) != null && (viewPropertyAnimatorWithEndAction2 = duration3.withEndAction(new he0(viewFindViewById, 2))) != null) {
                        viewPropertyAnimatorWithEndAction2.start();
                    }
                    if (imageView != null && (viewPropertyAnimatorAnimate2 = imageView.animate()) != null && (viewPropertyAnimatorAlpha2 = viewPropertyAnimatorAnimate2.alpha(0.0f)) != null && (duration2 = viewPropertyAnimatorAlpha2.setDuration(300L)) != null && (viewPropertyAnimatorWithEndAction = duration2.withEndAction(new r21(imageView, 29))) != null) {
                        viewPropertyAnimatorWithEndAction.start();
                    }
                    WebView webView = jm4Var.f;
                    if (webView != null && (viewPropertyAnimatorAnimate = webView.animate()) != null && (viewPropertyAnimatorAlpha = viewPropertyAnimatorAnimate.alpha(1.0f)) != null && (duration = viewPropertyAnimatorAlpha.setDuration(300L)) != null) {
                        duration.start();
                        break;
                    }
                }
                break;
            default:
                jm4 jm4Var2 = this.b;
                View view2 = jm4Var2.l;
                if (view2 != null) {
                    fx4 fx4Var2 = jm4Var2.h;
                    if (fx4Var2 != null) {
                        ((rx4) fx4Var2).h(null);
                    }
                    jm4Var2.d();
                    ImageView imageView2 = (ImageView) view2.findViewById(R.id.expanded_backdrop);
                    if (imageView2 != null && imageView2.getVisibility() == 0 && imageView2.getDrawable() != null) {
                        View viewFindViewById2 = view2.findViewById(R.id.expanded_scrim);
                        ImageView imageView3 = (ImageView) view2.findViewById(R.id.expanded_logo);
                        if (viewFindViewById2 != null) {
                            viewFindViewById2.setVisibility(0);
                            ViewPropertyAnimator viewPropertyAnimatorAnimate4 = viewFindViewById2.animate();
                            if (viewPropertyAnimatorAnimate4 != null && (viewPropertyAnimatorAlpha4 = viewPropertyAnimatorAnimate4.alpha(1.0f)) != null && (duration4 = viewPropertyAnimatorAlpha4.setDuration(300L)) != null) {
                                duration4.start();
                            }
                        }
                        if (imageView3 != null && imageView3.getDrawable() != null) {
                            imageView3.setVisibility(0);
                            imageView3.setAlpha(1.0f);
                            break;
                        }
                    }
                }
                break;
        }
    }
}
