package xyz.stream.view.refresh.layout.util;

import android.view.View;
import android.view.ViewGroup;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import com.google.android.material.appbar.AppBarLayout;
import xyz.netfly.mobile.view.c;
import xyz.stream.view.refresh.layout.api.RefreshKernel;
import xyz.stream.view.refresh.layout.listener.CoordinatorLayoutListener;

/* JADX INFO: loaded from: classes3.dex */
public class DesignUtil {
    public static void checkCoordinatorLayout(View view, RefreshKernel refreshKernel, CoordinatorLayoutListener coordinatorLayoutListener) {
        try {
            if (view instanceof CoordinatorLayout) {
                refreshKernel.getRefreshLayout().setEnableNestedScroll(false);
                ViewGroup viewGroup = (ViewGroup) view;
                for (int childCount = viewGroup.getChildCount() - 1; childCount >= 0; childCount--) {
                    View childAt = viewGroup.getChildAt(childCount);
                    if (childAt instanceof AppBarLayout) {
                        ((AppBarLayout) childAt).addOnOffsetChangedListener(new c(coordinatorLayoutListener, 2));
                    }
                }
            }
        } catch (Throwable unused) {
        }
    }
}
