summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
Commit message (Collapse)AuthorAgeFilesLines
* fixup! SystemUI: Calculate paged QS tiles height properlyMichael Bestas2023-04-201-1/+1
| | | | Change-Id: If9c6d6a5540729af0651acd16187c290dbf2156a
* Merge tag 'android-13.0.0_r35' of ↵George Zacharia2023-04-031-23/+46
|\ | | | | | | | | | | | | | | https://android.googlesource.com/platform/frameworks/base into t13.0 Android 13.0.0 release 35 Change-Id: I709958b2f015d1774b2ece25894467c3a279f93c
| * Adding extra logging for tiles distribution across pagesMichal Brzezinski2022-12-091-26/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | There are a few things: - adding generic methods in QSLogger to be able to log simple messages without adding extra methods to it - moving all logging in PagedTileLayout to using QSLogger - for every case when we force tiles redistribution, we log reason why it is happening - adding temp logs for when tiles are not redistributed but maybe they should be - logging when split shade state has changed in QSPanelControllerBase Bug: 255208946 Test: just adding logging Change-Id: Ie0b165edbf1f79dfff78c55646e513d37cea67a3
| * Optimistic fix for tile not getting redistributed in split shadeMichal Brzezinski2022-12-061-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | The issue is likely caused by QS tiles not getting redistributed in PagedTileLayout#onConfigurationChanged which does it only when orientation changes. One fix would be to remove that condition at all but then we would be redistributing for every configuration change or we'd need to make PagedTileLayout aware of split shade - none of these options seem good. So the solution here is to force redistribution from QSPanelControllerBase which is already aware of split shade and can listen to changes there. I'll also add more logs (in case bug is not fixed) in follow-up CL. Bug: 255208946 Test: there is no reliable way to reproduce the issue, we'll see if it stops happening Test: QSPanelControllerTest Change-Id: I81630b6eec16237a1a665982553dfc5b9dbac54b
| * Fix qs rows count on foldablesAnton Potapov2022-11-141-7/+13
| | | | | | | | | | | | Fixes: 255102159 Test: Manual on foldable device + autotest Change-Id: I54243e2373fa6fac26886618173ef4c4b5a71a3a
* | SystemUI: qs columns count settingsmaxwen2023-01-031-0/+15
| | | | | | | | | | | | and vertical qs tile layout settings (and resource config) Change-Id: I5b519ad62d17fec16400229264c66cbbde2a2031
* | Merge tag 'android-13.0.0_r16' into t13.0George Zacharia2022-12-151-0/+12
|\| | | | | | | | | | | | | | | | | | | | | Android 13.0.0 Release 16 (TQ1A.221205.011) Also included the following reverts: 1. Revert "fw/b: Import Wi-Fi standard icon [1/2]" 2. Revert "Add preference for toggling the wallpaper zooming animation" Co-authored-by: Semavi Ulusoy <doc.divxm@gmail.com> Change-Id: I9a6b51e452c28d10411712c59778bb54da5783e9
| * Add index info to every event coming from PagedTileLayoutsallyyuen2022-07-071-0/+11
| | | | | | | | | | | | | | | | | | A11y services can now access page number from all events, not just scrolled events. Test: build and check a11y events are populated. Bug: 232046146 Change-Id: I78edaeca5b540211472a4b809b14a65c0d5e958b
| * Delayable marquee TextViewFabian Kozynski2022-06-061-0/+1
| | | | | | | | | | | | | | | | | | Adds a TextView class that delays the start of its marquee after it's been visible and selected for a while. Test: manual Fixes: 203534602 Change-Id: Ie76b28c11348d842d0337dd612c54a39c844e148
* | SystemUI: Calculate paged QS tiles height properlyAdithya R2022-10-181-5/+9
|/ | | | | | | | | | When QS is re-inflated during UI mode change and we're on the 3rd or higher QS page, the first QS page is misaligned and hence height returns 0, resulting in footer and media panel position overlapping the QS panel. Return the maximum height among all present QS pages to fix this issue. Change-Id: I539babdb75c114cc44b4213ff114d4272be22ef6
* Fix RTL changes in PagedTileLayoutFabian Kozynski2022-04-271-11/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change fixes two RTL issues with PagedTileLayout: * When RTL happens we had a race condition between the following: * onConfigurationChanged * onRtlPropertiesChanged * QSFragment recreation due to InterestingConfigChanges This was causing that the page that was set after RTL changed when QS was open (for example, by using the Development tile) would sometimes not be correct. In order to fix this, we do two things: * Remove LAYOUT_DIRECTION from InterestingConfigChanges so QSFragment is not recreated * Cached the last known direction in PagedTileLayout so we can use that to get the page when the change happens, even if it has already propagated internally due to onConfigurationChanged. * When PagedTileLayout has never measured and laid out page 0 (because it was recreated in a different page), getTilesHeight returned 0. To prevent this, make sure that we always measure and lay out page 0 (explicitly if not attached to PagedTileLayout). Test: manual Fixes: 227231905 Change-Id: I453606937f275b8fe3255f3e2c666cb912229b1a
* Add better a11y support in QSFabian Kozynski2022-03-311-0/+46
| | | | | | | | | | | | | | | * Add ACTION_PAGE_LEFT/RIGHT to PagedTileLayout and proper focus after changing pages. * Add CollectionInfo to TileLayout and CollectionItemInfo to QSTileViewImpl to indicate the position of the currently focused tile. * Properly use ACTION_COLLAPSE/EXPAND in QSPanel/QuickQSPanel so the proper announcement is made, as well as the proper action is provided in the contextual menu. Test: manual Test: atest com.android.systemui.qs Bug: 204726862 Change-Id: I9bb085002c99e75ab0bb91f287ded62793b932bb
* Annotate com.android.systemui.qs with @NullableFedor Kudasov2022-01-071-0/+4
| | | | | | Bug: 209459024 Test: m SystemUI-core Change-Id: I48ba7039ca826c8304f425f34a8c84981710dc77
* Fix QS expansion animationsFabian Kozynski2022-01-041-3/+27
| | | | | | | | | | | | | | | * Fix gap between tiles when expanding * Fix second page collapsing animation: tiles now will shrink and at the end be replaced by QQS tiles. We need to create the animators as we move through the pages, as PagedTileLayout only has the current page and the (up to) two adjacent ones. This means that if the page has not been added, we don't have correct positions and measures. See bug for video Fixes: 207895040 Test: manual Change-Id: Id2b14b11ace4199ed07f7675b6575cb4b71e93d5
* Fix size of last page of QSPanelFabian Kozynski2021-12-061-1/+2
| | | | | | | | Sizing should always use the size of page 0. Test: manual Fixes: 209476721 Change-Id: Ia01d48ceeef46271535bca24924b9b47367cc92a
* Always have QS expanded on split shadeLucas Dupin2021-12-051-0/+9
| | | | | | | | Test: pull down qs from launcher, lock screen, from regular or split shade modes. Test: repeat tests pulling down with 2 fingers Fixes: 204450723 Change-Id: Ifea32b10378ed4cc240ea1a95bea12db515479bf
* Impl CUJ_NOTIFICATION_SHADE_QS_SCROLL_SWIPEMilton Wu2021-11-161-0/+25
| | | | | | | | | | Implement CUJ_NOTIFICATION_SHADE_QS_SCROLL_SWIPE during QS screen scrolling, and swiping. Bug: 199715431 Test: atest QSPanelControllerBaseTest QSPanelControllerTest QSSquishinessControllerTest Change-Id: I61957c986aa1fc3a79e00c0885e75e27664daf3d
* Fix 2 finger pull down animationLucas Dupin2021-11-051-1/+4
| | | | | | | | | | | | | In order to animate smoothly when going directly to QS, and skipping QQS, we need to propagate the squishiness amount to the paged tile layout. Test: pull down shade, on split screen, landscape, portrait Test: pull down QS, scroll through pages Test: pull down shade with 2 fingers Test: atest QSSquishinessControllerTest Fixes: 204916761 Change-Id: I249e49a7b6c6ce1e9b6da28ab80ead771b962edc
* Pass configuration changes to all pagesFabian Kozynski2021-10-291-0/+10
| | | | | | | | | | | | | | In PagedTileLayout, all pages are inflated previously and the view pager only attaches/dettaches pages. However, configuration changes are only dispatched to direct children of the view. This change makes it so that non-attached pages are also notified. In particular, fontWeightAdjustment was not being passed, and it's not one of the changes that causes fragments in SystemUI to be reinflated. Test: manual Fixes: 200882432 Change-Id: Ie2bd0eccf1d1e71f364501612bb6e6be8aa29bc9
* Make QS buttons squishyLucas Dupin2021-10-261-0/+5
| | | | | | | | | | Pass squishiness fraction from notifications to QS, and make it behave accordingly. Test: manual Test: atest QSSquishinessControllerTest Bug: 199047412 Change-Id: I9f5df7ae99e0bced4626dcb36053c9dba78ec672
* 3 column QSFabian Kozynski2021-09-231-0/+1
| | | | | | | | | This is applied in portrait width >600dp and all orientations >720dp Test: manual Fixes: 197636649 Change-Id: I1ed0cc795e7f4c846a500353ba93538db23b6f55
* Fix QSTileViewImpl label set ellipsize performance issueBill Lin2021-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | health/microbench/systemui/systemui-latency-suite regress wake & unlock time : +50ms Root cuase: TextView.setEllipsize() overhead is high, and the overhead x QSTileView numbers would obviously affect the test latency time. Solution: By default we left tileView as Marquee but not setSelected(), then we setSelected on tile views when QQS expanding until proposedTranslation meet 1f(showing truncated at End with '...' visualization) Adding 3 major factors to achieve below state machine 1. Selected(T) : expansion == 1f or proposedTranslation < 0f 2. NoAction in transitioning : expansion > 0f or expansion < 1f 3. Signal when mLastHeaderTranslation != headerTranslation The expansion state will be: - init Collapsed : setSelected(true) - Header expanding QQS : setSelected(false) - QQS expanded : NoAction - QQS -> Expanding QS : NoAction - QS expanded : setSelected(true) - QS Collapsing -> QQS : setSelected(true) or QS full collapsing : setSelected(true) - QS collapsed in QQS : setSelected(false) - Back to init state : setSelected(true) Test: health/microbench/systemui/systemui-latency-suite Test: Manual check QS/QQS long label tile QQS : ellipsize at end QS: Marquee Test: SystemUITests Bug: 192680464 Change-Id: Iebf1e84043501916dd90378973a6736135c9f653
* Use padding in pages instead of pageMarginFabian Kozynski2021-06-011-2/+16
| | | | | | | | | | | | | | | ViewPager pageMargin does some rounding when calculating the offset of each page, leading to positions that are not integers at the snapping points. This is usually not an issue, except that we use those positions to drive the PageIndicator. Instead, set padding on the pages and negative margin in PagedTileLayout. As everything has clip false, this produces the exact same effect. Test: manual Fixes: 187954110 Change-Id: Ie1055a34c26214b012e96e3ec032ce4db576694d
* Fix margins between headers and tiles.Fabian Kozynski2021-05-191-3/+0
| | | | | | | | | | | | | | | | Also: * Remove old classes. * Change height of tiles. * Add back clipping on PagedTileLayout, as the views don't need to go outside its bounds. * Fix a scrolling issue Fixes: 187460996 Fixes: 187966021 Fixes: 187334034 Fixes: 188459321 Test: manual Change-Id: Ide520f26982a3f2c8918424cb4c14d3d14da3724
* Fix pageMargin in PagedTileLayoutFabian Kozynski2021-04-301-6/+0
| | | | | | | | | | | | Page margin was being set again from inside PagedTileLayout. Only set at QSContainerImpl level, based on margins. As the controller calls updateResources on view attached, they will get set correctly as soon as the view is attached. Test: manual Fixes: 186863859 Change-Id: I8a9f22cc35899ba081bd94c48b3647fc7ae89829
* Don't clip tiles as pages as scrolledFabian Kozynski2021-04-271-15/+7
| | | | | | Test: manual Fixes: 186536987 Change-Id: I70365e52c09f634a4ba9c62a84e3d39c412333b7
* Remove QS flagFabian Kozynski2021-04-141-27/+5
| | | | | | | | Completely remove the flag and clean up old layouts and some old code. Test: manual Bug: 185250134 Change-Id: I539de8f3a80814b2e386d7ebbf7013d4f60ef67e
* Fix sizes and paddingsFabian Kozynski2021-03-241-0/+7
| | | | | | | | | | | | | | Fix size of brightness slider. Also, align margins with notifications in: * QQS * QS * QSCustomizer * Brightness slider Test: manual Fixes: 183391158 Change-Id: I31a3b7f8d42186f2d2699f2fba71ee0dcc335bf9
* Dismantle remove labels prototypeFabian Kozynski2021-02-261-12/+0
| | | | | | Test: manual Bug: 171319433 Change-Id: I1ea97cec5c0d9b559213ca2adb9ddf7af60229a6
* Prototype tiles with side labelsFabian Kozynski2021-01-071-20/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This switches the tiles in QS to have the labels on the side, and display in two columns. Implemented: * animation in expansion interleaves the tiles from QQS into QS, so the first half of QQS moves to the left column * Tapping on the label has the same effect as long pressing Not implemented: * animated shape between QQS and QS * Edit screen Landscape with media has a bug where scrolling pages resets to first page. Also, animations in landscape with media don't look great. To enable: adb shell settings put secure sysui_side_labels 1 (0 to disable) and restart SystemUI Test: manual Test: SystemUITests Change-Id: I7468bc2c0b81e99a2de235a3b4312e678e968fd2
* Prototype remove labels in QSFabian Kozynski2020-12-141-0/+13
| | | | | | | | | | | | | | | | Add flag to not show labels in QS. This also makes it show more rows. Added a switch in customizer to toggle the setting. Some visual issues when toggling (media player), fixed by collapsing and reopening QS. In user builds, can be toggled with: `adb shell settings put secure sysui_remove_labels {0, 1}` Test: manual Change-Id: I750c53d918b2d9590ff86eed67d1932444390828
* 11/N Remove UIEventLogger from QSPanel.Dave Mankoff2020-11-181-2/+2
| | | | | | | | Removes UIEventLogger injection from QSPanel constructor. Bug: 168904199 Test: atest SystemUITests Change-Id: I2099ed36c6ba09968da2bc2de1cba23318282573
* Minor QS visual fixesFabian Kozynski2020-11-121-3/+2
| | | | | | | | | | - Have both brightness sliders use same height. That way QS edit mode is aligned with QS - Fix PagedTileLayout clipping to clip at the margins. That way, the visible part of the page correctly aligns with media player. Test: visual Change-Id: If99393daefa97011e740b46ea64757f72e425630
* 5/N Move QS Tile tracking logic into QSPanelControllerBase.Dave Mankoff2020-10-191-1/+1
| | | | | | | | | | | | | This is a big, sort of hairy CL, but is a big push to completing this series. One notable thing you see happen here is a lot less calls to methods liks "setHost" which late-bind various member variables. Classes such as QSTileHost are available to be injected at constrction time and this CL starts taking advantage of that, removing the need for a lot of null checks. Bug: 168904199 Test: atest SystemUITests && manual Change-Id: Ib4768d10e26debdea8d43daee61d2501ed250e67
* Merge "Guard aginst another NPE" into rvc-qpr-dev am: 3f7fa9eb3a am: 70a4d6f738TreeHugger Robot2020-09-251-0/+10
|\ | | | | | | | | | | Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12512322 Change-Id: I5c5c95aeb1a095ebbbfa855e6aab50ba60ae6162
| * Guard aginst another NPEFabian Kozynski2020-09-251-0/+10
| | | | | | | | | | | | | | | | | | Cannot find what is actually going on. Some reports have the error from line 165, but some don't. There's no particular repro steps. Test: build Fixes: 162801646 Change-Id: Ieff5db9146f95273d3db216834c1e93eed765514
* | Merge "Guard against NPE" into rvc-qpr-dev am: cc514fd00d am: 5e6bdc42eeFabian Kozynski2020-08-041-1/+3
|\| | | | | | | | | | | Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12202983 Change-Id: I972d7383e34a1e15d680f7078fe58cce45e07d26
| * Guard against NPEFabian Kozynski2020-07-211-1/+3
| | | | | | | | | | | | Test: build Bug: 161166697 Change-Id: I06d7a81b522fe372a1a610791e1598d205e4339c
* | Add support for colors in PageIndicatorFabian Kozynski2020-07-201-1/+0
|/ | | | | | | | | Adds proper support for colors in PageIndicator (via android:tint attribute). By default, it will use the accent color. Test: manual Fixes: 157767613 Change-Id: I41288e182938d31c41b82f4a95ce3ac6b50c65e3
* Set PageIndicator pages in QSPanel#onMeasureBeverly2020-06-151-9/+17
| | | | | | | | | | | | | | Pre-emptively update PageIndicator's numPages before measuring in QSPanel so that views will be appropriately measured. Previously, new PageIndicator child views would be added in the middle of a QSPanel layout pass after already being measured, so the new PageIndicator child wouldn't be measured. Test: manually add and remove new QS tiles. rotate between landscape + portrait modes. observe the PageIndicator is correct. Fixes: 157542221 Change-Id: Ic1bb29039dd12993a50758bf48a4ad792d8cdfc3
* Changed the landscape experience of quick settingsSelim Cinek2020-06-121-14/+53
| | | | | | | | | | | | | | | | | | | | | | When introducing Media into quick settings, the landscape experience never really worked well. The music player would be cut off on the bottom and users could never reach their playback controls. Instead of the vertical layout, we're now rendering quick settings side by side with the player. Using some densities, this could still be too large, so we're also introducing a scrollview for the expanded quick settings. This also makes sure all the paddings and spacings are up to spec. This also fixes behavior where a user could still collapse the panel while the user switcher was showing. Bug: 154332040 Test: atest SystemUITests Change-Id: I3b8babc2cc6a91e19824b67f043aa5044dc370b9
* Add try/catch to prevent NPE in PagedTileLayoutFabian Kozynski2020-05-051-3/+21
| | | | | | | | | This catches the NPE. Still haven't found what actually causes it. Test: monkey tested in the bug Fixes: 149979063 Change-Id: Idf73909e6f3c456616433d5278e2061431e0e840
* Add new QS Ui EVentsFabian Kozynski2020-04-301-2/+19
| | | | | | | | | | | | | | | | | This CL adds events for: * QS interactions * StatusBarState changes * User Switcher interaction * DND panel interaction The new QS events that refer to particular tiles attach the following: * spec (if framework tile) or package (if CustomTile) * instanceId associated with the QSTile object on creation Test: atest SystemUITests (including new tests) Test: manual using statsd_testdrive Fixes: 147508235 Change-Id: I43d8fe1fdb2aec1f16032da61a599ebc29809afc
* Prevent NPE in PagedTileLayoutFabian Kozynski2020-03-261-0/+3
| | | | | | | | | | | | | | This CL prevents fake drag by checking ViewPager#isFakeDragging, which is enabled by ViewPager#beginFakeDrag. This is not a fix of the underlying issue (which is not known) but a patch to prevent crashing. Fixes: 149979063 Test: adb shell monkey --throttle 1000 --pct-nav 0 --pct-majornav 0 \ --pct-touch 30 --ignore-crashes --ignore-timeouts \ --ignore-security-exceptions -v 2000000 Change-Id: I7da764eaf20fc9d971afe2cb89b232b4efd65a3b
* Fix number of pages in PagedTileLayoutFabian Kozynski2019-07-311-1/+3
| | | | | | | | | If there's less that one full page of tiles, do not create an extra page (as there's always a minimum of 1 page). Fixes: 138625713 Test: manual with less and more than one page of tiles Change-Id: I59a111f55ce3b00b94d8fb1a0594497c5a3af35c
* Safeguard against no tiles in QSFabian Kozynski2019-06-201-3/+8
| | | | | | | | | | | | | | | | | In PagedTileLayout: * Make sure that each page displays at least 1 tile (never 0). * Make sure that there's at least one page (even if it's empty) In QSTileHost: * If the new value of sysui_qs_tiles produces no tiles (but it's not set to empty), set the tile set to the empty default @string/quick_settings_tiles Test: adb shell settings put secure sysui_qs_tiles not-a-valid-tile-spec Test: atest QSTileHostTest Fixes: 135023694 Fixes: 135677464 Change-Id: I1e5cf4d2688370001ecae87fc0272acecd48af73
* Change how PagedTileLayout is measuredFabian Kozynski2019-04-181-1/+5
| | | | | | | | | | | | | | | | | | | The change makes PagedTileLayout only use excess space from QSPanel after other views have been measured and the padding has been accounted for (see LinearLayout#measureVertical). PagedTileLayout caches the last height to be measured so as to minimize the number of times the number of rows is recalculated (and prevent loops). Also, fixed the calculation in TileLayout#updateMaxRows to match the height calculation in TileLayout#onMeasure. Test: manual, stress testing with multiple pages, adding and removing tiles, starting and disconnecting VPN, changing display size Bug:122714773 Change-Id: I5c85f03cfc79e341244d213fd92307821db80889
* Fixed bugs in PagedTileLayout, QSAnimator using RTLFabian Kozynski2019-04-121-2/+15
| | | | | | | | | | | * getNumVisibleTiles now returns the correct number when in RTL. It was not referring to the correct page * mPageToRestore set properly on configuration changes * Animation of tiles that do not fit in screen is correct in RTL. Fixes: 130408545 Test: visual, changing configuration and expanding/collapsing Change-Id: I62da728631fceaead0f81af1b32a115e961cf58e
* Remove allocation in onLayoutFabian Kozynski2019-04-011-2/+4
| | | | | | | | The clipping rect was allocated in onLayout. After this change, the rect is allocated once and the bounds are reset. Test: manual Change-Id: I92dcca915fc244a3d418e98a456a0719407cdf57
* Fixes wrong measurements on QS animationFabian Kozynski2018-10-091-2/+19
| | | | | | | | | | | | | | Clipping of PagedTileLayout is done independent of padding so no measurement corrections are needed. Padding in TilePage fixed so the pages are centered (they use all the width). FrameLayout in qs_paged_tile_layout removed as not used. Change-Id: If8cd95855ebcddf533e87b9203c4ee3d831bdf2c Test: atest && visual Fixes: 117452733 Bug: 117401270 Bug: 117096186