package ῲ.ᨨ.ᨨ;

import android.view.View;
import android.view.ViewTreeObserver;

/* renamed from: ῲ.ᨨ.ᨨ.Ԕ  reason: contains not printable characters */
/* compiled from: OneShotPreDrawListener */
public final class ViewTreeObserver$OnPreDrawListenerC1728 implements ViewTreeObserver.OnPreDrawListener, View.OnAttachStateChangeListener {

    /* renamed from: ʬ  reason: contains not printable characters */
    public ViewTreeObserver f6043;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final View f6044;

    /* renamed from: 㸾  reason: contains not printable characters */
    public final Runnable f6045;

    public ViewTreeObserver$OnPreDrawListenerC1728(View view, Runnable runnable) {
        this.f6044 = view;
        this.f6043 = view.getViewTreeObserver();
        this.f6045 = runnable;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static ViewTreeObserver$OnPreDrawListenerC1728 m4435(View view, Runnable runnable) {
        if (view == null) {
            throw new NullPointerException("view == null");
        } else if (runnable != null) {
            ViewTreeObserver$OnPreDrawListenerC1728 r0 = new ViewTreeObserver$OnPreDrawListenerC1728(view, runnable);
            view.getViewTreeObserver().addOnPreDrawListener(r0);
            view.addOnAttachStateChangeListener(r0);
            return r0;
        } else {
            throw new NullPointerException("runnable == null");
        }
    }

    public boolean onPreDraw() {
        m4436();
        this.f6045.run();
        return true;
    }

    public void onViewAttachedToWindow(View view) {
        this.f6043 = view.getViewTreeObserver();
    }

    public void onViewDetachedFromWindow(View view) {
        m4436();
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m4436() {
        if (this.f6043.isAlive()) {
            this.f6043.removeOnPreDrawListener(this);
        } else {
            this.f6044.getViewTreeObserver().removeOnPreDrawListener(this);
        }
        this.f6044.removeOnAttachStateChangeListener(this);
    }
}
