package androidx.core.view;

import android.R;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import androidx.annotation.Nullable;

/* JADX INFO: loaded from: classes.dex */
public class s0 extends com.google.android.material.shape.f {

    @Nullable
    private final View mView;

    public s0(@Nullable View view) {
        this.mView = view;
    }

    public void j() {
        View view = this.mView;
        if (view != null) {
            ((InputMethodManager) view.getContext().getSystemService("input_method")).hideSoftInputFromWindow(this.mView.getWindowToken(), 0);
        }
    }

    public void k() {
        View viewFindViewById = this.mView;
        if (viewFindViewById == null) {
            return;
        }
        if (viewFindViewById.isInEditMode() || viewFindViewById.onCheckIsTextEditor()) {
            viewFindViewById.requestFocus();
        } else {
            viewFindViewById = viewFindViewById.getRootView().findFocus();
        }
        if (viewFindViewById == null) {
            viewFindViewById = this.mView.getRootView().findViewById(R.id.content);
        }
        if (viewFindViewById == null || !viewFindViewById.hasWindowFocus()) {
            return;
        }
        viewFindViewById.post(new r0(viewFindViewById, 0));
    }
}
