小红书.apk(点击下载) / b.java


package qb1;

import android.graphics.Rect;
import android.view.View;
import com.xingin.matrix.followfeed.entities.NoteFeed;
import com.xingin.net.gen.model.NoteDetailVideoFeedPlayState;
import java.util.Iterator;
import java.util.List;
import kotlin.Metadata;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.jvm.internal.Intrinsics;
import qo2.a;
import yb1.c;

@Metadata(bv = {}, d1 = {"\u0000>\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0007\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u001a\u000e\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0001\u001a\u00020\u0000\u001a'\u0010\n\u001a\u0004\u0018\u00010\t2\u000e\u0010\u0006\u001a\n\u0012\u0004\u0012\u00020\u0005\u0018\u00010\u00042\u0006\u0010\b\u001a\u00020\u0007¢\u0006\u0004\b\n\u0010\u000b\u001a\u001a\u0010\u0011\u001a\u00020\u00102\b\u0010\r\u001a\u0004\u0018\u00010\f2\b\b\u0002\u0010\u000f\u001a\u00020\u000e\u001a\n\u0010\u0013\u001a\u00020\u0010*\u00020\u0012\u001a\u0016\u0010\u0015\u001a\u0004\u0018\u00010\u00052\f\u0010\u0014\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004¨\u0006\u0016"}, d2 = {"Lfe1/b;", "entity", "Lcom/xingin/net/gen/model/NoteDetailVideoFeedPlayState;", "a", "", "", "list", "Lk61/b;", "pageIntentImpl", "", "c", "(Ljava/util/List;Lk61/b;)Ljava/lang/Integer;", "Landroid/view/View;", a.COPY_LINK_TYPE_VIEW, "", "percent", "", "e", "Lcom/xingin/matrix/followfeed/entities/NoteFeed;", "d", "items", "b", "matrix_detail_feed_library_release"}, k = 2, mv = {1, 6, 0})
/* compiled from: CommonFunction.kt */
public final class b {
    public static final NoteDetailVideoFeedPlayState a(fe1.b bVar) {
        Intrinsics.checkNotNullParameter(bVar, "entity");
        return new NoteDetailVideoFeedPlayState(bVar.d(), Long.valueOf(bVar.b()), Long.valueOf(bVar.a()), Long.valueOf(bVar.c()), Integer.valueOf(bVar.e()));
    }

    public static final Object b(List<? extends Object> list) {
        Intrinsics.checkNotNullParameter(list, "items");
        if (list.isEmpty()) {
            return -1;
        }
        for (int i10 = CollectionsKt__CollectionsKt.getLastIndex(list); -1 < i10; i10--) {
            if (CollectionsKt___CollectionsKt.getOrNull(list, i10) instanceof NoteFeed) {
                return Integer.valueOf(i10);
            }
        }
        return -1;
    }

    public static final Integer c(List<? extends Object> list, k61.b bVar) {
        boolean z14;
        Intrinsics.checkNotNullParameter(bVar, "pageIntentImpl");
        if (list == null) {
            return null;
        }
        Iterator<? extends Object> it3 = list.iterator();
        boolean z15 = false;
        int i10 = 0;
        while (true) {
            if (!it3.hasNext()) {
                i10 = -1;
                break;
            }
            Object next = it3.next();
            if (next instanceof NoteFeed) {
                z14 = Intrinsics.areEqual(((NoteFeed) next).getId(), bVar.l());
            } else {
                if (next instanceof c) {
                    c cVar = (c) next;
                    if (cVar.isSourceItem() || Intrinsics.areEqual(cVar.getNoteId(), bVar.l())) {
                        z14 = true;
                    }
                }
                z14 = false;
            }
            if (z14) {
                break;
            }
            i10++;
        }
        Integer valueOf = Integer.valueOf(i10);
        if (valueOf.intValue() >= 0) {
            z15 = true;
        }
        if (z15) {
            return valueOf;
        }
        return null;
    }

    public static final boolean d(NoteFeed noteFeed) {
        Intrinsics.checkNotNullParameter(noteFeed, "<this>");
        return (noteFeed.getIllegalInfo().getDesc().length() > 0) && noteFeed.getOrderCooperate().getStatus() != 401;
    }

    public static final boolean e(View view, float f14) {
        if (view == null) {
            return false;
        }
        Rect rect = new Rect();
        int height = view.getLocalVisibleRect(rect) ? rect.height() : 0;
        view.getHitRect(rect);
        int height2 = rect.height();
        if (height2 != 0 && ((float) height) / ((float) height2) > f14) {
            return true;
        }
        return false;
    }
}