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

Commit 74de87be authored by Hai Zhang's avatar Hai Zhang
Browse files

Add ExpressiveDesignEnabledProvider to allow activity control it

We need something to pass the information from activity to widgets
about whether expressive design should be enabled.

- Intent extras are usually passed in by external clients so it's not
a great option for passing this internal decision.

- Theme attributes also unfortunately has a chicken-and-egg problem
because we may need to set theme based on whether expressive design is
enabled, and that overwrites theme attributes previously set.

So it's more straightforward to just provide an optional interface for
activities to directly control whether expressive design should be
enabled for it.

This change also removes the field expressiveThemeState which isn't
really usedful, because currently tryInit() is always unconditionally
called in isExpressiveTheme(), and we are making the value different
for different activities now so there can't be one cache for all the
activities.

Bug: 406933786
Flag: com.android.settingslib.widget.theme.flags.is_expressive_design_enabled
Test: presubmit
Change-Id: Icbe1969b91f5ce733776d8710956badd00f51b90
parent 2dc4c5fb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment