h6ah4i/android-advancedrecyclerview

Collapse groups while dragging

Open

#200 aperta il 1 mar 2016

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)Java (879 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (5296 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Hi

When dragging a group, I'm trying to force closing all groups just before dragging. It's visually unpleasant having the group to cross the childs one by one. So far I can collapseAll in onCheckGroupCanStartDrag, but the user looses the initial dragging gesture. collapseAll cancels the ongoing drag.

Is there a way to have this prettier?

@Override 
public boolean onCheckGroupCanStartDrag(MyGroupViewHolder holder, int groupPosition, int x, int y) {
        ...
        boolean result = ViewUtils.hitTest(dragHandleView, x - offsetX, y - offsetY);
        if (result)
            if (mExpandableItemManager.getExpandedGroupsCount()>0) {
                mExpandableItemManager.collapseAll();
            }
        return result;
    }

Edit: Just notice a duplicate #74

Guida contributor