Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.

Do not Swiping #39

Open
matheus-corregiari opened this issue Mar 7, 2014 · 0 comments
Open

Do not Swiping #39

matheus-corregiari opened this issue Mar 7, 2014 · 0 comments

Comments

@matheus-corregiari
Copy link

Hello!

i'm trying to make my list swipable with undo bar. But i'm setting up all of the parameters like the Demo and still not working...

My XML:

<de.timroes.android.listview.EnhancedListView
android:id="@+id/historicoListView"
android:drawSelectorOnTop="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:dividerHeight="5dp"
android:divider="#00000000"
android:clipToPadding="false"
android:scrollbarStyle="outsideOverlay"/>

And i'm setting the list on this method:

private void setLista(){
this.lista.setDismissCallback(new OnDismissCallback() {

        @Override
        public Undoable onDismiss(EnhancedListView listView, final int position) {
            final CardHistoricoVO item = (CardHistoricoVO) adapter.getItem(position);
            adapter.remove(position);
            return new Undoable() {
              @Override 
              public void undo() {
                  adapter.insert(position, item);
              }
              @Override 
              public String getTitle() {
                return "Deleted '" + ((ValorVO) item.getObject()).getId() + "'";
              }
              @Override 
              public void discard() {
                bancoValor.deleteValor((ValorVO) item.getObject());
              }
            };
        }
    });

    this.lista.enableSwipeToDismiss();
    this.lista.setUndoStyle(UndoStyle.MULTILEVEL_POPUP);
    this.lista.setSwipeDirection(SwipeDirection.BOTH);
    this.lista.setSwipingLayout(0); //R.id.card_item_categoria);

    this.lista.setShouldSwipeCallback(new OnShouldSwipeCallback() {
          @Override
          public boolean onShouldSwipe(EnhancedListView lv, int position) {
            return true;
          }
    });
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant