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

Do not Swiping #39

Open
Open

Description

@matheus-corregiari

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;
          }
    });
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions