This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
System chrome platform service updates #2732
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,29 +39,66 @@ enum SystemUIOverlay { | |
| Bottom = 2, | ||
| }; | ||
|
|
||
| /// Specifies a preference for the style of the system overlays. Certain | ||
| /// platforms may not respect this preference. | ||
| enum SystemUIOverlayStyle { | ||
| /// System overlays should be drawn with a light color. Intended for | ||
| /// applications with a dark background. | ||
| Light = 1, | ||
|
|
||
| /// System overlays should be drawn with a dark color. Intended for | ||
| /// applications with a light background. | ||
| Dark = 2, | ||
| }; | ||
|
|
||
| /// Specifies a description of the application that is pertinent to the | ||
| /// embedder's application switcher (a.k.a. "recent tasks") user interface. | ||
| struct ApplicationSwitcherDescription { | ||
| /// A label and description of the current state of the application. | ||
| string? label; | ||
|
|
||
| /// The application's primary color. | ||
| uint32 primaryColor; | ||
| }; | ||
|
|
||
| /// Controls specific aspects of the embedder interface. | ||
| [ServiceName="flutter::platform::SystemChrome"] | ||
| interface SystemChrome { | ||
| /// Specifies the set of orientations the application interface can | ||
| /// be displayed in. | ||
| /// | ||
| /// The value 0 is synonymous with having all options enabled. | ||
| /// Arguments: | ||
| /// device_orientation_mask: A mask of `DeviceOrientation` enum values. | ||
| /// device_orientation_mask: A mask of `DeviceOrientation` enum values. | ||
| /// A value of 0 is synonymous with having all options enabled. | ||
| /// | ||
| /// Return Value: | ||
| /// boolean indicating if the orientation mask is valid and the changes | ||
| /// could be conveyed successfully to the embedder. | ||
| SetPreferredOrientations(uint32 device_orientation_mask) => (bool success); | ||
|
|
||
| /// Specifies the description of the application within the embedder's | ||
| /// application switcher (a.k.a. "recent tasks") user interface. | ||
| /// | ||
| /// Arguments: | ||
| /// description: The description of the current state of the application. | ||
| /// | ||
| /// Return value: | ||
| /// boolean indicating if the preference was conveyed successfully to the | ||
| /// embedder. | ||
| /// | ||
| /// Platform Specific Notes: | ||
| /// If application switcher metadata cannot be manually set on the platform, | ||
| /// specifying such metadata is a no-op and always return true. | ||
| SetApplicationSwitcherDescription(ApplicationSwitcherDescription description) => (bool success); | ||
|
|
||
| /// Specifies the set of overlays visible on the embedder when the | ||
| /// application is running. The embedder may choose to ignore unsupported | ||
| /// overlays | ||
| /// | ||
| /// Arguments: | ||
| /// style: A mask of `SystemUIOverlay` enum values that denotes the overlays | ||
| /// to show. | ||
| /// overlay_mask: A mask of `SystemUIOverlay` enum values that denotes the | ||
| /// overlays to show. A value of 0 is synonymous with showing no | ||
| /// overlays. | ||
| /// | ||
| /// Return Value: | ||
| /// boolean indicating if the preference was conveyed successfully to the | ||
|
|
@@ -70,5 +107,20 @@ interface SystemChrome { | |
| /// Platform Specific Notes: | ||
| /// If the overlay is unsupported on the platform, enabling or disabling | ||
| /// that overlay is a no-op and always return true. | ||
| SetEnabledSystemUIOverlays(uint32 overlays) => (bool success); | ||
| SetEnabledSystemUIOverlays(uint32 overlay_mask) => (bool success); | ||
|
|
||
| /// Specifies the style of the overlays that are visible on the embedder when | ||
| /// the applicatiomn is running. | ||
| /// | ||
| /// Arguments: | ||
| /// style: A `SystemUIOverlayStyle` enum value that denotes the style | ||
| /// | ||
| /// Return value: | ||
| /// boolean indicating if the preference was conveyed successfully to the | ||
| /// embedder. | ||
| /// | ||
| /// Platform Specific Notes: | ||
| /// If overlay style is unsupported on the platform, specifying a style is | ||
| /// a no-op and always return true. | ||
| SetSystemUIOverlayStyle(SystemUIOverlayStyle style) => (bool success); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another approach would be a query function that returns what styles are available on the current platform. This kind of pattern emphasizes discoverability and helps avoid least-common-denominator problems (although in this case the number of supported styles is probably going to be pretty limited). |
||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Redundant include. You are already including the umbrella header on the next line.