Merge "Use proper size for indexing"
This commit is contained in:
committed by
Android (Google) Code Review
commit
72b1a381dd
@@ -99,7 +99,7 @@ class DoubleLineTileLayout(
|
||||
}
|
||||
}
|
||||
|
||||
override fun getNumVisibleTiles() = tilesToShow
|
||||
override fun getNumVisibleTiles() = Math.min(mRecords.size, tilesToShow)
|
||||
|
||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
||||
super.onConfigurationChanged(newConfig)
|
||||
|
||||
@@ -480,7 +480,6 @@ public class QSPanel extends LinearLayout implements Tunable, BrightnessMirrorLi
|
||||
}
|
||||
}
|
||||
mTileLayout = newLayout;
|
||||
newLayout.setListening(mListening);
|
||||
if (needsDynamicRowsAndColumns()) {
|
||||
newLayout.setMinRows(horizontal ? 2 : 1);
|
||||
// Let's use 3 columns to match the current layout
|
||||
@@ -498,6 +497,14 @@ public class QSPanel extends LinearLayout implements Tunable, BrightnessMirrorLi
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the listening state of the current layout to the state of the view. Used after
|
||||
* switching layouts.
|
||||
*/
|
||||
public void reSetLayoutListening() {
|
||||
mTileLayout.setListening(mListening);
|
||||
}
|
||||
|
||||
private void updateHorizontalLinearLayoutMargins() {
|
||||
if (mHorizontalLinearLayout != null && !displayMediaMarginsOnMedia()) {
|
||||
LayoutParams lp = (LayoutParams) mHorizontalLinearLayout.getLayoutParams();
|
||||
|
||||
@@ -214,6 +214,7 @@ public abstract class QSPanelControllerBase<T extends QSPanel> extends ViewContr
|
||||
boolean switchTileLayout(boolean force) {
|
||||
if (mView.switchTileLayout(force, mRecords)) {
|
||||
setTiles();
|
||||
mView.reSetLayoutListening();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -336,7 +336,7 @@ public class QuickQSPanel extends QSPanel {
|
||||
|
||||
@Override
|
||||
public int getNumVisibleTiles() {
|
||||
return mColumns;
|
||||
return Math.min(mRecords.size(), mColumns);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -353,6 +353,7 @@ public class QuickQSPanel extends QSPanel {
|
||||
boolean startedListening = !mListening && listening;
|
||||
super.setListening(listening);
|
||||
if (startedListening) {
|
||||
// getNumVisibleTiles() <= mRecords.size()
|
||||
for (int i = 0; i < getNumVisibleTiles(); i++) {
|
||||
QSTile tile = mRecords.get(i).tile;
|
||||
mUiEventLogger.logWithInstanceId(QSEvent.QQS_TILE_VISIBLE, 0,
|
||||
|
||||
Reference in New Issue
Block a user