// Path: omegarecyclerview/src/main/java/com/omega_r/libs/omegarecyclerview/utils/ViewUtils.java
// public static boolean isReverseLayout(@Nullable RecyclerView recyclerView) {
//     if (recyclerView == null) return false;
//     RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();
//     if (layoutManager == null) return false;
//     if (layoutManager instanceof LinearLayoutManager) {
//         return ((LinearLayoutManager) layoutManager).getReverseLayout();
//     }
//     return false;
// }


import android.graphics.Rect;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import static com.omega_r.libs.omegarecyclerview.utils.ViewUtils.isReverseLayout;
package com.omega_r.libs.omegarecyclerview.sticky_decoration;




@SuppressWarnings("rawtypes")
public class HeaderStickyDecoration extends StickyDecoration {

    public HeaderStickyDecoration(StickyAdapter adapter) {
        super(adapter);
    }

    @Override
    public void getItemOffsets(@NonNull Rect outRect, @NonNull View view,
                               @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
        super.getItemOffsets(outRect, view, parent, state);
        RecyclerView.Adapter adapter = parent.getAdapter();
        if (adapter == null) return;

        int position = parent.getChildAdapterPosition(view);
        int topOffset = 0;
        if (position != RecyclerView.NO_POSITION && hasSticker(position)
                && showHeaderAboveItem(parent, position)) {

            RecyclerView.ViewHolder stickyHolder = getStickyHolder(parent, position);
            if(stickyHolder != null) {
                View header = stickyHolder.itemView;
                topOffset = header.getHeight();
// Path: omegarecyclerview/src/main/java/com/omega_r/libs/omegarecyclerview/utils/ViewUtils.java
// public static boolean isReverseLayout(@Nullable RecyclerView recyclerView) {
//     if (recyclerView == null) return false;
//     RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();
//     if (layoutManager == null) return false;
//     if (layoutManager instanceof LinearLayoutManager) {
//         return ((LinearLayoutManager) layoutManager).getReverseLayout();
//     }
//     return false;
// }


// Path: omegarecyclerview/src/main/java/com/omega_r/libs/omegarecyclerview/sticky_decoration/HeaderStickyDecoration.java
import android.graphics.Rect;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import static com.omega_r.libs.omegarecyclerview.utils.ViewUtils.isReverseLayout;

package com.omega_r.libs.omegarecyclerview.sticky_decoration;




@SuppressWarnings("rawtypes")
public class HeaderStickyDecoration extends StickyDecoration {

    public HeaderStickyDecoration(StickyAdapter adapter) {
        super(adapter);
    }

    @Override
    public void getItemOffsets(@NonNull Rect outRect, @NonNull View view,
                               @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
        super.getItemOffsets(outRect, view, parent, state);
        RecyclerView.Adapter adapter = parent.getAdapter();
        if (adapter == null) return;

        int position = parent.getChildAdapterPosition(view);
        int topOffset = 0;
        if (position != RecyclerView.NO_POSITION && hasSticker(position)
                && showHeaderAboveItem(parent, position)) {

            RecyclerView.ViewHolder stickyHolder = getStickyHolder(parent, position);
            if(stickyHolder != null) {
                View header = stickyHolder.itemView;
                topOffset = header.getHeight();
                if (isReverseLayout(parent)) {