Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 8b387a38 authored by Alejandro Nijamkin's avatar Alejandro Nijamkin
Browse files

[flexiglass] Adds burn-in to smartspace section elements.

This CL has several necessary changes:
1. Extracts burn-in and alpha from KeyguardRootViewModel and onto
   AodBurnInViewModel and AodAlphaViewModel, respectively. This is
   necessary because the new blueprint/section implementation doesn't
   use KeyguardRootView by design (using an @Composable hierarchy
   instead) which means that it cannot use KeyguardRootViewBinder to
   apply the alpha, scale, and translation on the necessary smartspace,
   date, and weather elements (nor can it do so for clock elements -
   something that this CL doesn't do but does enable).
2. Changes the way the old view-binder (KeyguardRootViewBinder) passes
   UI-sourced parameters (like the clock provider, inset, and status
   view position) into the view-model (KeyguardRootViewModel) to be
   passed in when querying the flows that require it, instead of setting
   them as fields on the view-model. This is cleaner but also opens up
   the ability to do the same from Jetpack Compose, where side-effects
   such as this don't necessarily trigger another composition pass.
3. Implements a way to pipe the positioning of the top of the clock
   section and the top of the smartspace section back up to the
   blueprint that owns them and has that blueprint then create the
   burn-in parameters that can be used for (2) in the Compose-based
   implementation. This can be done using the @Composable fun
   burnIn(...) function that then produces an instance of BurnInState
   with proper callbacks for setting the clock controller and reporting
   the tops of the two sections.
4. Implements a simple modifier (fun Modifier.burnInAware) which is then
   used by SmartspaceSection (and can be used by other sections in the
   future) allowing the section to selectively apply the anti-burn-in
   alpha, scale, and translation to selected child composables that need
   that treatment in AOD.
5. Finally, there are some test cleanups: the alpha and burn-in related
   test cases were moved out of KeyguardRootViewModelTest and into the new test classes for the new, smaller view-models which are deviceless-supporting. The KeyguardRootViewModelTest was also moved to make it deviceless-supporting.

Bug: 316211368
Test: See included test changes
Test: manually verified in Flexiglass and outside of Flexiglass
Flag: ACONFIG com.android.systemui.scene_container DEVELOPMENT
Change-Id: I1b4affbaeacf7205ee573f5d45df1f8bbcd8f241
parent c61f0302
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment