package com.ss.android.ugc.aweme.comment.barrage.view;

import X.A6L;
import X.LnI;
import android.content.res.Resources;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import androidx.recyclerview.widget.RecyclerView;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.comment.barrage.cell.ReactionBubbleDescriptionCell;
import kotlin.h.b.n;

public final class AwemeCommentBubbleList$1 implements ViewTreeObserver.OnGlobalLayoutListener {
    public final /* synthetic */ A6L LIZ;

    static {
        Covode.recordClassIndex(56905);
    }

    public AwemeCommentBubbleList$1(A6L a6l) {
        this.LIZ = a6l;
    }

    public final void onGlobalLayout() {
        View view;
        View view2;
        int i = 0;
        RecyclerView.ViewHolder LIZ2 = this.LIZ.LIZ(0, false);
        RecyclerView.ViewHolder LIZ3 = this.LIZ.LIZ(1, false);
        A6L a6l = this.LIZ;
        if (LIZ2 != null && LIZ3 != null && (LIZ3 instanceof ReactionBubbleDescriptionCell) && !a6l.LJJJJ && (view = LIZ2.itemView) != null) {
            n.LIZIZ(view, "");
            ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
            Resources system = Resources.getSystem();
            n.LIZIZ(system, "");
            int LIZ4 = LnI.LIZ(TypedValue.applyDimension(1, 256.0f, system.getDisplayMetrics()));
            Resources system2 = Resources.getSystem();
            n.LIZIZ(system2, "");
            int LIZ5 = LIZ4 - LnI.LIZ(TypedValue.applyDimension(1, 16.0f, system2.getDisplayMetrics()));
            if (!(LIZ3 == null || (view2 = LIZ3.itemView) == null)) {
                i = view2.getMeasuredHeight();
            }
            int i2 = LIZ5 - i;
            if (i2 >= 0) {
                layoutParams.height = i2;
                view.setLayoutParams(layoutParams);
            }
        }
    }
}
