This CL introduces some lambda-based modifiers to change the alpha,
paddings or size of a Composable without triggering recomposition when
those values change. This is especially useful when animating these
values, which happens a lot in the SystemUI shade given that a lot of
components size/alpha is driven by touch gestures.
Test: Manual
Bug: 247473910
Change-Id: If63d302dcad5ad753b4ebf90ed239e598baa55c1
This CL forks the Pager API from Accompanist. Note that I took the
version 0.20.0 of Accompanist [1], which is the version right before the
Pager API starts depending on dev.chrisbanes.snapper [1], which I'm not
sure is ok to fork in the platform.
[1] https://github.com/google/accompanist/releases/tag/v0.20.0
[2] 498301e4d4
Bug: 247473910
Test: Manual
Change-Id: I57947a196be84af9c34365377588e50b8f249af0
Adds a screen to the gallery app to test it. Did not end up using the UI
screenshot diff test because the buttons are not the same in Compose as
they are in this bespoke UI. The UI is simple enough that I was able to
get close enough.
Fix: 246002091
Test: In the next CL, a screen is added to the gallery app to test it.
Change-Id: I90d871bb819ecd7bd75a3f55746a94f7a37f68c2
Includes logic to add them to the Compose Gallery app.
There's probably a lot of work that still needs to go into Buttons.kt
but this is a start.
Bug: 246002087
Test: Compose gallery app screen for buttons
Change-Id: If284f43c205b04009b63d5eab2cc53f3b334e515
Using the new, modern architecture user switcher UI, we implement a UI
screenshot diff test for it. This is a prerequisite for the next step,
where we replace the XML file and view-binder code with a Jetpack
Compose implementation.
Bug: 243843440
Test: N/A this CL is a test
Change-Id: I2831129f44702007be64133a3edcd418e30bd4c1
This mimics how Compose treats icons, and reminds future users of `Icon`
to add content descriptions (or choicefully not have one).
Bug: 238425913
Test: tests in systemui.qs.footer
Test: tests in systemui.statusbar.pipeline
Test: Turn on flag 507 and ensure QS footer actions still have content
descriptions
Change-Id: Ia86e50f43c36325ef7523b86dc4a8ca9b269325e
This CL provides most of the implementation of the QS FooterActions
following the modern Android architecture. In particular, this CL
includes:
- repositories in the data layer.
- an interactor in the domain layer.
- a view model in the ui layer.
The ViewBinder is added in ag/19674347, given that it comes together
with changes to the existing XML files.
Note that after this CL, the new implementation will still not be used
as it won't be wired yet. This is done in ag/19674347.
The highest value of the tests is in FooterActionsViewModelTest, which
focuses on testing the *state* (view model) of the footer actions using
the *real implementation* of the repositories, interactor and viewModel
all together. To do so, I implemented a FooterActionsUtils class that
allows to *easily* create real implementations of those repositories,
interactor and view model, without requiring the caller to provide any
parameter. I believe that this is even better than introducing new
fakes, and it should hopefully lead us towards using more and more of
the real implementations in our tests, and less and less of fakes/mocks,
making the tests much more useful. Of course, I still had to use fake &
mocks for the classes I'm calling to and for which instantiating the
actual object is too painful. As you can see, there are no test files
for the repositories: given that we already use the real implementations
in the ViewModel tests, they are defacto already tested.
I still added some tests on *interactions* (not *state*) in
FooterActionsInteractorTest. Even though I believe those tests don't
provide much value (they are merely a copy/paste of the implementation),
I preferred keeping the same coverage as the current tests (some of
which are going to be removed in ag/19674347).
Note that the business logic contained in this CL was mostly copy/pasted
from the current implementation, as I wanted to make sure that this is
going to be a pure refactoring that does not change the logic of this
feature. Still, I left some TODOs in the code for potential
improvements.
Bug: 242040009
Test: atest FooterActionsViewModelTest
Test: atest FooterActionsInteractorTest
Change-Id: Ia0bdf9824e098ad6604709f5db87576437b0a904
This CL implements the People UI using Jetpack Compose. Note that this
implementation won't be used by SystemUI yet, and can only be viewed
using the SystemUIGallery app at the moment.
Once ag/19500380 is submitted (blocked by b/236146570), the screenshot
tests will use the Compose implementation. You can see the visual
difference between the implementations in ag/19498514. As explained in
b/238993727#comment10 the result is slightly different (and improved
over the current View implementation).
Note that the fake values of this screen have been moved from the
current PeopleSpaceScreenshotTest, and are now reused there as well (see
ag/19568794).
Bug: 238993727
Test: atest SystemUIGoogleScreenshotTests
Change-Id: I4d2f241ccf768ef3fccc01ce196418ce7fc26492
This CL moves all the current Compose code from master to tm-qpr-dev,
which is possible now that all Compose dependencies have been cherry
picked to tm-qpr-dev.
Note that I used the SHA of ag/19398175 for this CL Change-Id and
Merged-In tags, which is the last CL in master that changed code in the
compose/ folder. That way, we make sure that we don't try to merge this
code back into master.
Bug: 231131244
Test: m SystemUIComposeGallery
Change-Id: Ic3efb42d371c6aac8c2a6297a0cb192a780903cd
Merged-In: Ic3efb42d371c6aac8c2a6297a0cb192a780903cd