Merge "Fix QS edit overanimating" into nyc-dev
This commit is contained in:
@@ -86,7 +86,6 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
|||||||
mContext = context;
|
mContext = context;
|
||||||
mAccessibilityManager = context.getSystemService(AccessibilityManager.class);
|
mAccessibilityManager = context.getSystemService(AccessibilityManager.class);
|
||||||
mItemTouchHelper = new ItemTouchHelper(mCallbacks);
|
mItemTouchHelper = new ItemTouchHelper(mCallbacks);
|
||||||
setHasStableIds(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -250,7 +249,7 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
|||||||
}
|
}
|
||||||
holder.mTileView.onStateChanged(info.state);
|
holder.mTileView.onStateChanged(info.state);
|
||||||
holder.mTileView.setAppLabel(info.appLabel);
|
holder.mTileView.setAppLabel(info.appLabel);
|
||||||
holder.mTileView.setShowAppLabel(position > mTileDividerIndex);
|
holder.mTileView.setShowAppLabel(mTileDividerIndex > -1 && position > mTileDividerIndex);
|
||||||
|
|
||||||
if (mAccessibilityManager.isTouchExplorationEnabled()) {
|
if (mAccessibilityManager.isTouchExplorationEnabled()) {
|
||||||
final boolean selectable = !mAccessibilityMoving || position < mEditIndex;
|
final boolean selectable = !mAccessibilityMoving || position < mEditIndex;
|
||||||
@@ -283,7 +282,8 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
|||||||
mTiles.remove(mEditIndex--);
|
mTiles.remove(mEditIndex--);
|
||||||
mAccessibilityMoving = false;
|
mAccessibilityMoving = false;
|
||||||
move(mAccessibilityFromIndex, position, v);
|
move(mAccessibilityFromIndex, position, v);
|
||||||
notifyDataSetChanged();
|
notifyItemChanged(mAccessibilityFromIndex);
|
||||||
|
notifyItemMoved(mAccessibilityFromIndex, position);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showAccessibilityDialog(final int position, final View v) {
|
private void showAccessibilityDialog(final int position, final View v) {
|
||||||
@@ -315,7 +315,7 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
|||||||
mAccessibilityFromIndex = position;
|
mAccessibilityFromIndex = position;
|
||||||
// Add placeholder for last slot.
|
// Add placeholder for last slot.
|
||||||
mTiles.add(mEditIndex++, null);
|
mTiles.add(mEditIndex++, null);
|
||||||
notifyDataSetChanged();
|
notifyItemInserted(mEditIndex - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SpanSizeLookup getSizeLookup() {
|
public SpanSizeLookup getSizeLookup() {
|
||||||
@@ -335,6 +335,7 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mTileDividerIndex == mTiles.size()) {
|
if (mTileDividerIndex == mTiles.size()) {
|
||||||
|
notifyItemInserted(mTiles.size());
|
||||||
mTiles.add(null);
|
mTiles.add(null);
|
||||||
}
|
}
|
||||||
if (to <= mTileDividerIndex) {
|
if (to <= mTileDividerIndex) {
|
||||||
@@ -344,7 +345,8 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
|||||||
}
|
}
|
||||||
CharSequence fromLabel = mTiles.get(from).state.label;
|
CharSequence fromLabel = mTiles.get(from).state.label;
|
||||||
move(from, to, mTiles);
|
move(from, to, mTiles);
|
||||||
notifyDataSetChanged();
|
notifyItemChanged(from);
|
||||||
|
notifyItemMoved(from, to);
|
||||||
updateDividerLocations();
|
updateDividerLocations();
|
||||||
CharSequence announcement;
|
CharSequence announcement;
|
||||||
if (to >= mEditIndex) {
|
if (to >= mEditIndex) {
|
||||||
@@ -389,6 +391,7 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
|||||||
}
|
}
|
||||||
if (mTiles.size() - 1 == mTileDividerIndex) {
|
if (mTiles.size() - 1 == mTileDividerIndex) {
|
||||||
mTiles.remove(mTiles.size() - 1);
|
mTiles.remove(mTiles.size() - 1);
|
||||||
|
notifyItemRemoved(mTiles.size() - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user