Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97b48fdc authored by Jason Monk's avatar Jason Monk Committed by android-build-merger
Browse files

Merge "QS Edit: fix some move logic" into nyc-dev

am: 8e788d01

* commit '8e788d01':
  QS Edit: fix some move logic

Change-Id: Ie32e34379d6bd2764ad523dab8bc6d25a251e670
parents 0bca8d35 8e788d01
Loading
Loading
Loading
Loading
+23 −14
Original line number Diff line number Diff line
@@ -331,9 +331,8 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta

    private boolean move(int from, int to, View v) {
        if (to >= mEditIndex) {
            if (from >= mEditIndex) {
                return false;
            }
            if (from < mEditIndex) {
                // Removing a tile.
                // Sort tiles into system/non-system groups.
                TileInfo tile = mTiles.get(from);
                if (tile.isSystem) {
@@ -349,6 +348,16 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
                        to = mTileDividerIndex;
                    }
                }
            } else {
                if (to > mEditIndex) {
                    // Don't allow tiles to be dragged around when they aren't added.
                    return false;
                }
                // Allow the case where to == mEditIndex to fall through and swap which
                // side the tile is currently on.
                // This lets the the cases where all tiles are on one side of the line
                // work.
            }
        }
        CharSequence fromLabel = mTiles.get(from).state.label;
        move(from, to, mTiles);