sergejsha / pinned-section-listview

Easy to use ListView with pinned sections for Android.
2.59k stars 808 forks source link

Click on a pinned item, not working properly #75

Open han4wluc opened 9 years ago

han4wluc commented 9 years ago

When I click on a pinned item (only when it is floating on the top) , it calls the click on the item behind it instead.

I have a setOnItemClickListener on the list view. and setClickListener on the pinned item inside the adapter.

shihabmi7 commented 9 years ago

i am also facing same problem. mr. han4wluc are you solve the problem?

han4wluc commented 9 years ago

unfortunately I was not

shihabmi7 commented 9 years ago

I am trying to solve the issue. But I am only manage to solve when header are clicked, But can't manage when item is clicked.

The issue no 49. describes little but not enough for me.

https://github.com/beworker/pinned-section-listview/issues/49

qqli007 commented 7 years ago

the same problem on android n.

The new view's mAttachInfo == null, so the click not perform.

The code in VIew.java:

public boolean post(Runnable action) {
    final AttachInfo attachInfo = mAttachInfo;
    if (attachInfo != null) {
        return attachInfo.mHandler.post(action);
    }

    // Postpone the runnable until we know on which thread it needs to run.
    // Assume that the runnable will be successfully placed after attach.
    getRunQueue().post(action);
    return true;
}

It return true,so performClick() not excute.

     if (!mHasPerformedLongPress && !mIgnoreNextUpEvent) {
         // This is a tap, so remove the longpress check
         removeLongPress
         // Only perform take click actions if we were in the pressed state
         if (!focusTaken) {
            // Use a Runnable and post this rather than calling
                // performClick directly. This lets other visual state
                // of the view update before click actions start.
                if (mPerformClick == null) {
                    mPerformClick = new PerformClick();
                }
                if (!post(mPerformClick)) {
                    performClick();
                }
            }
        }