package com.bytedance.android.livesdk.chatroom.behavior;

import X.05p;
import X.1gt;
import X.2Pr;
import X.C4949LsC;
import X.M12;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import com.bytedance.covode.number.Covode;
import kotlin.h.b.n;

public final class ScrollHeaderBehavior extends 05p<View> {
    public C4949LsC<? super View, 2Pr> LIZ;

    static {
        Covode.recordClassIndex(13381);
    }

    public ScrollHeaderBehavior() {
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public ScrollHeaderBehavior(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        M12.LIZ((Object) context, (Object) attributeSet);
    }

    public final boolean onDependentViewChanged(1gt r2, View view, View view2) {
        M12.LIZ(r2, view, view2);
        r2.requestLayout();
        return false;
    }

    public final boolean layoutDependsOn(1gt r2, View view, View view2) {
        M12.LIZ(r2, view, view2);
        return n.LIZ(view2, r2.findViewWithTag("suctionBottomView"));
    }

    public final boolean onMeasureChild(1gt r11, View view, int i, int i2, int i3, int i4) {
        View findViewWithTag;
        int i5;
        View view2 = view;
        1gt r4 = r11;
        M12.LIZ((Object) r4, (Object) view2);
        int i6 = view2.getLayoutParams().height;
        if ((i6 != -1 && i6 != -2) || (findViewWithTag = r4.findViewWithTag("suctionBottomView")) == null) {
            return false;
        }
        int size = View.MeasureSpec.getSize(i3);
        if (size == 0) {
            size = r4.getHeight();
        }
        int translationY = size + ((int) findViewWithTag.getTranslationY());
        if (i6 == -1) {
            i5 = 1073741824;
        } else {
            i5 = Integer.MIN_VALUE;
        }
        r4.LIZ(view2, i, i2, View.MeasureSpec.makeMeasureSpec(translationY, i5), i4);
        return true;
    }
}
