// 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.Canvas;
import android.graphics.Rect;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import java.util.HashMap;
import java.util.Map;
import static androidx.recyclerview.widget.RecyclerView.NO_POSITION;
import static com.omega_r.libs.omegarecyclerview.utils.ViewUtils.isReverseLayout;
import static java.lang.Math.abs;
                    float eventY = ev.getY();
                    if (abs(mActionDownX - eventX) <= CLICK_MOVE_BIAS && abs(mActionDownY - eventY) <= CLICK_MOVE_BIAS) {
                        mStickyAdapter.onClickStickyViewHolder(mClickedStickyId);
                    }
                }
                break;
        }
        return super.onTouchEvent(parent, ev, defaultResult);
    }

    private boolean handleActionDown(@NonNull RecyclerView parent, @NonNull final MotionEvent ev, boolean defaultResult) {
        int eventX = (int) ev.getX();
        int eventY = (int) ev.getY();
        for (Long stickyId : mStickyRectMap.keySet()) {
            Rect rect = mStickyRectMap.get(stickyId);
            if (stickyId != NO_STICKY_ID && rect != null && !rect.isEmpty() && rect.contains(eventX, eventY)) {
                mClickedStickyId = stickyId;
                return true;
            }
        }
        return defaultResult;
    }

    @Override
    public final void onDrawOver(@NonNull Canvas canvas, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
        super.onDrawOver(canvas, parent, state);
        invalidateRectMap();

        int count = parent.getChildCount();
        long previousStickerId = -1;
// 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/StickyDecoration.java
import android.graphics.Canvas;
import android.graphics.Rect;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import java.util.HashMap;
import java.util.Map;
import static androidx.recyclerview.widget.RecyclerView.NO_POSITION;
import static com.omega_r.libs.omegarecyclerview.utils.ViewUtils.isReverseLayout;
import static java.lang.Math.abs;

                    float eventY = ev.getY();
                    if (abs(mActionDownX - eventX) <= CLICK_MOVE_BIAS && abs(mActionDownY - eventY) <= CLICK_MOVE_BIAS) {
                        mStickyAdapter.onClickStickyViewHolder(mClickedStickyId);
                    }
                }
                break;
        }
        return super.onTouchEvent(parent, ev, defaultResult);
    }

    private boolean handleActionDown(@NonNull RecyclerView parent, @NonNull final MotionEvent ev, boolean defaultResult) {
        int eventX = (int) ev.getX();
        int eventY = (int) ev.getY();
        for (Long stickyId : mStickyRectMap.keySet()) {
            Rect rect = mStickyRectMap.get(stickyId);
            if (stickyId != NO_STICKY_ID && rect != null && !rect.isEmpty() && rect.contains(eventX, eventY)) {
                mClickedStickyId = stickyId;
                return true;
            }
        }
        return defaultResult;
    }

    @Override
    public final void onDrawOver(@NonNull Canvas canvas, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
        super.onDrawOver(canvas, parent, state);
        invalidateRectMap();

        int count = parent.getChildCount();
        long previousStickerId = -1;
        if (isReverseLayout(parent)) {