Merge "Set the values for QQS/QS columns"
This commit is contained in:
committed by
Android (Google) Code Review
commit
11dca19424
@@ -86,10 +86,10 @@
|
||||
<bool name="config_navigation_bar_enable_auto_dim_no_visible_wallpaper">true</bool>
|
||||
|
||||
<!-- The maximum number of tiles in the QuickQSPanel -->
|
||||
<integer name="quick_qs_panel_max_columns">4</integer>
|
||||
<integer name="quick_qs_panel_max_columns">6</integer>
|
||||
|
||||
<!-- The number of columns in the QuickSettings -->
|
||||
<integer name="quick_settings_num_columns">4</integer>
|
||||
<integer name="quick_settings_num_columns">3</integer>
|
||||
|
||||
<!-- The number of rows in the QuickSettings -->
|
||||
<integer name="quick_settings_max_rows">3</integer>
|
||||
|
||||
@@ -146,7 +146,8 @@ public class QSCustomizerController extends ViewController<QSCustomizer> {
|
||||
RecyclerView recyclerView = mView.getRecyclerView();
|
||||
recyclerView.setAdapter(mTileAdapter);
|
||||
mTileAdapter.getItemTouchHelper().attachToRecyclerView(recyclerView);
|
||||
GridLayoutManager layout = new GridLayoutManager(getContext(), TileAdapter.NUM_COLUMNS) {
|
||||
GridLayoutManager layout =
|
||||
new GridLayoutManager(getContext(), mTileAdapter.getNumColumns()) {
|
||||
@Override
|
||||
public void onInitializeAccessibilityNodeInfoForItem(RecyclerView.Recycler recycler,
|
||||
RecyclerView.State state, View host, AccessibilityNodeInfoCompat info) {
|
||||
|
||||
@@ -61,7 +61,6 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
||||
private static final long DRAG_LENGTH = 100;
|
||||
private static final float DRAG_SCALE = 1.2f;
|
||||
public static final long MOVE_DURATION = 150;
|
||||
public static final int NUM_COLUMNS = 4;
|
||||
|
||||
private static final int TYPE_TILE = 0;
|
||||
private static final int TYPE_EDIT = 1;
|
||||
@@ -99,6 +98,7 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
||||
private final UiEventLogger mUiEventLogger;
|
||||
private final AccessibilityDelegateCompat mAccessibilityDelegate;
|
||||
private RecyclerView mRecyclerView;
|
||||
private final int mNumColumns;
|
||||
|
||||
@Inject
|
||||
public TileAdapter(Context context, QSTileHost qsHost, UiEventLogger uiEventLogger) {
|
||||
@@ -109,6 +109,7 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
||||
mDecoration = new TileItemDecoration(context);
|
||||
mMarginDecoration = new MarginTileDecoration();
|
||||
mMinNumTiles = context.getResources().getInteger(R.integer.quick_settings_min_num_tiles);
|
||||
mNumColumns = context.getResources().getInteger(R.integer.quick_settings_num_columns);
|
||||
mAccessibilityDelegate = new TileAdapterDelegate();
|
||||
}
|
||||
|
||||
@@ -122,6 +123,10 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
||||
mRecyclerView = null;
|
||||
}
|
||||
|
||||
public int getNumColumns() {
|
||||
return mNumColumns;
|
||||
}
|
||||
|
||||
public ItemTouchHelper getItemTouchHelper() {
|
||||
return mItemTouchHelper;
|
||||
}
|
||||
@@ -602,7 +607,7 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
|
||||
public int getSpanSize(int position) {
|
||||
final int type = getItemViewType(position);
|
||||
if (type == TYPE_EDIT || type == TYPE_DIVIDER || type == TYPE_HEADER) {
|
||||
return NUM_COLUMNS;
|
||||
return mNumColumns;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user