Loading packages/SystemUI/res/layout/qs_detail_items.xml +2 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,8 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" sysui:itemHeight="@dimen/qs_detail_item_height" /> sysui:itemHeight="@dimen/qs_detail_item_height" style="@style/AutoSizingList" /> <LinearLayout android:id="@android:id/empty" Loading packages/SystemUI/res/values/attrs.xml +6 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,12 @@ <attr name="horizontalSpacing" format="dimension" /> </declare-styleable> <declare-styleable name="AutoSizingList"> <!-- Whether AutoSizingList will show only as many items as fit on screen and remove extra items instead of scrolling. --> <attr name="enableAutoSizing" format="boolean" /> </declare-styleable> <!-- Theme for icons in the status bar (light/dark). background/fillColor is used for dual tone icons like wifi and signal, and singleToneColor is used for icons with only one tone. Contract: Pixel with fillColor blended over backgroundColor blended over translucent should Loading packages/SystemUI/res/values/styles.xml +3 −0 Original line number Diff line number Diff line Loading @@ -256,6 +256,9 @@ <item name="numColumns">3</item> </style> <style name="AutoSizingList"> <item name="enableAutoSizing">true</item> </style> <style name="Theme.AlertDialogHost" parent="android:Theme.DeviceDefault"> <item name="android:windowIsTranslucent">true</item> <item name="android:windowBackground">@android:color/transparent</item> Loading packages/SystemUI/src/com/android/systemui/qs/AutoSizingList.java +10 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ public class AutoSizingList extends LinearLayout { private ListAdapter mAdapter; private int mCount; private boolean mEnableAutoSizing; public AutoSizingList(Context context, @Nullable AttributeSet attrs) { super(context, attrs); Loading @@ -44,6 +45,8 @@ public class AutoSizingList extends LinearLayout { mHandler = new Handler(); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AutoSizingList); mItemSize = a.getDimensionPixelSize(R.styleable.AutoSizingList_itemHeight, 0); mEnableAutoSizing = a.getBoolean(R.styleable.AutoSizingList_enableAutoSizing, true); a.recycle(); } public void setAdapter(ListAdapter adapter) { Loading @@ -60,7 +63,7 @@ public class AutoSizingList extends LinearLayout { protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int requestedHeight = MeasureSpec.getSize(heightMeasureSpec); if (requestedHeight != 0) { int count = Math.min(requestedHeight / mItemSize, getDesiredCount()); int count = getItemCount(requestedHeight); if (mCount != count) { postRebindChildren(); mCount = count; Loading @@ -69,6 +72,12 @@ public class AutoSizingList extends LinearLayout { super.onMeasure(widthMeasureSpec, heightMeasureSpec); } private int getItemCount(int requestedHeight) { int desiredCount = getDesiredCount(); return mEnableAutoSizing ? Math.min(requestedHeight / mItemSize, desiredCount) : desiredCount; } private int getDesiredCount() { return mAdapter != null ? mAdapter.getCount() : 0; } Loading packages/SystemUI/src/com/android/systemui/qs/QSDetail.java +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ public class QSDetail extends LinearLayout { protected View mQsDetailHeader; protected TextView mQsDetailHeaderTitle; private Switch mQsDetailHeaderSwitch; protected Switch mQsDetailHeaderSwitch; private ImageView mQsDetailHeaderProgress; protected QSTileHost mHost; Loading Loading
packages/SystemUI/res/layout/qs_detail_items.xml +2 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,8 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" sysui:itemHeight="@dimen/qs_detail_item_height" /> sysui:itemHeight="@dimen/qs_detail_item_height" style="@style/AutoSizingList" /> <LinearLayout android:id="@android:id/empty" Loading
packages/SystemUI/res/values/attrs.xml +6 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,12 @@ <attr name="horizontalSpacing" format="dimension" /> </declare-styleable> <declare-styleable name="AutoSizingList"> <!-- Whether AutoSizingList will show only as many items as fit on screen and remove extra items instead of scrolling. --> <attr name="enableAutoSizing" format="boolean" /> </declare-styleable> <!-- Theme for icons in the status bar (light/dark). background/fillColor is used for dual tone icons like wifi and signal, and singleToneColor is used for icons with only one tone. Contract: Pixel with fillColor blended over backgroundColor blended over translucent should Loading
packages/SystemUI/res/values/styles.xml +3 −0 Original line number Diff line number Diff line Loading @@ -256,6 +256,9 @@ <item name="numColumns">3</item> </style> <style name="AutoSizingList"> <item name="enableAutoSizing">true</item> </style> <style name="Theme.AlertDialogHost" parent="android:Theme.DeviceDefault"> <item name="android:windowIsTranslucent">true</item> <item name="android:windowBackground">@android:color/transparent</item> Loading
packages/SystemUI/src/com/android/systemui/qs/AutoSizingList.java +10 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ public class AutoSizingList extends LinearLayout { private ListAdapter mAdapter; private int mCount; private boolean mEnableAutoSizing; public AutoSizingList(Context context, @Nullable AttributeSet attrs) { super(context, attrs); Loading @@ -44,6 +45,8 @@ public class AutoSizingList extends LinearLayout { mHandler = new Handler(); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AutoSizingList); mItemSize = a.getDimensionPixelSize(R.styleable.AutoSizingList_itemHeight, 0); mEnableAutoSizing = a.getBoolean(R.styleable.AutoSizingList_enableAutoSizing, true); a.recycle(); } public void setAdapter(ListAdapter adapter) { Loading @@ -60,7 +63,7 @@ public class AutoSizingList extends LinearLayout { protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int requestedHeight = MeasureSpec.getSize(heightMeasureSpec); if (requestedHeight != 0) { int count = Math.min(requestedHeight / mItemSize, getDesiredCount()); int count = getItemCount(requestedHeight); if (mCount != count) { postRebindChildren(); mCount = count; Loading @@ -69,6 +72,12 @@ public class AutoSizingList extends LinearLayout { super.onMeasure(widthMeasureSpec, heightMeasureSpec); } private int getItemCount(int requestedHeight) { int desiredCount = getDesiredCount(); return mEnableAutoSizing ? Math.min(requestedHeight / mItemSize, desiredCount) : desiredCount; } private int getDesiredCount() { return mAdapter != null ? mAdapter.getCount() : 0; } Loading
packages/SystemUI/src/com/android/systemui/qs/QSDetail.java +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ public class QSDetail extends LinearLayout { protected View mQsDetailHeader; protected TextView mQsDetailHeaderTitle; private Switch mQsDetailHeaderSwitch; protected Switch mQsDetailHeaderSwitch; private ImageView mQsDetailHeaderProgress; protected QSTileHost mHost; Loading