package o;

import android.content.res.Resources;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
import com.google.android.material.textfield.TextInputLayout;
import java.util.WeakHashMap;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class Ae0 implements TextWatcher {
    public int l;
    public final /* synthetic */ EditText m;
    public final /* synthetic */ TextInputLayout n;

    public Ae0(TextInputLayout textInputLayout, EditText editText) {
        this.n = textInputLayout;
        this.m = editText;
        this.l = editText.getLineCount();
    }

    @Override // android.text.TextWatcher
    public final void afterTextChanged(Editable editable) throws Resources.NotFoundException {
        TextInputLayout textInputLayout = this.n;
        textInputLayout.u(!textInputLayout.L0, false);
        if (textInputLayout.v) {
            textInputLayout.n(editable);
        }
        if (textInputLayout.D) {
            textInputLayout.v(editable);
        }
        EditText editText = this.m;
        int lineCount = editText.getLineCount();
        int i = this.l;
        if (lineCount != i) {
            if (lineCount < i) {
                WeakHashMap weakHashMap = Oj0.a;
                int minimumHeight = editText.getMinimumHeight();
                int i2 = textInputLayout.E0;
                if (minimumHeight != i2) {
                    editText.setMinimumHeight(i2);
                }
            }
            this.l = lineCount;
        }
    }

    @Override // android.text.TextWatcher
    public final void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
    }

    @Override // android.text.TextWatcher
    public final void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
    }
}
