Merge "Fix QS Edit flashing on exit" into nyc-dev
This commit is contained in:
@@ -106,6 +106,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene
|
||||
public void setHost(QSTileHost host) {
|
||||
mHost = host;
|
||||
mPhoneStatusBar = host.getPhoneStatusBar();
|
||||
mTileAdapter.setHost(host);
|
||||
}
|
||||
|
||||
public void setContainer(NotificationsQuickSettingsContainer notificationsQsContainer) {
|
||||
|
||||
@@ -81,6 +81,7 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
||||
private Holder mCurrentDrag;
|
||||
private boolean mAccessibilityMoving;
|
||||
private int mAccessibilityFromIndex;
|
||||
private QSTileHost mHost;
|
||||
|
||||
public TileAdapter(Context context) {
|
||||
mContext = context;
|
||||
@@ -88,6 +89,10 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
||||
mItemTouchHelper = new ItemTouchHelper(mCallbacks);
|
||||
}
|
||||
|
||||
public void setHost(QSTileHost host) {
|
||||
mHost = host;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return mTiles.get(position) != null ? mAllTiles.indexOf(mTiles.get(position))
|
||||
@@ -108,7 +113,7 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
||||
newSpecs.add(mTiles.get(i).spec);
|
||||
}
|
||||
host.changeTiles(mCurrentSpecs, newSpecs);
|
||||
setTileSpecs(newSpecs);
|
||||
mCurrentSpecs = newSpecs;
|
||||
}
|
||||
|
||||
public void setTileSpecs(List<String> currentSpecs) {
|
||||
@@ -285,6 +290,7 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
||||
move(mAccessibilityFromIndex, position, v);
|
||||
notifyItemChanged(mAccessibilityFromIndex);
|
||||
notifyItemMoved(mAccessibilityFromIndex, position);
|
||||
saveSpecs(mHost);
|
||||
}
|
||||
|
||||
private void showAccessibilityDialog(final int position, final View v) {
|
||||
@@ -373,6 +379,7 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
||||
fromLabel, (to + 1));
|
||||
}
|
||||
v.announceForAccessibility(announcement);
|
||||
saveSpecs(mHost);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user