Skip to content

Commit

Permalink
Add missing kHasImplicitScrolling enum value
Browse files Browse the repository at this point in the history
This brings the Dart and C++ semantics flag enums back in sync.

In #5941, implicit scrolling support was added to SemanticsFlag in
dart:ui, and to the Android embedder, but not to the SemanticsFlags enum
on the C++ side.

This also clarifies/corrects the documentation for this value in dart:ui
and in the embedder API.
  • Loading branch information
cbracken committed Mar 5, 2019
1 parent 39c46de commit 21cfb01
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/ui/semantics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,9 @@ class SemanticsAction {

/// A Boolean value that can be associated with a semantics node.
//
// When changes are made to this class, the equivalent APIs in each of the
// embedders *must* be updated.
// When changes are made to this class, the equivalent APIs in
// `lib/ui/semantics/semantics_node.h` and in each of the embedders *must* be
// updated.
class SemanticsFlag {
static const int _kHasCheckedStateIndex = 1 << 0;
static const int _kIsCheckedIndex = 1 << 1;
Expand Down Expand Up @@ -475,10 +476,10 @@ class SemanticsFlag {
/// Whether the platform can scroll the semantics node when the user attempts
/// to move focus to an offscreen child.
///
/// For example, a [ListView] widget has implicit scrolling so that users can
/// easily move to the next visible set of children. A [TabBar] widget does
/// not have implicit scrolling, so that users can navigate into the tab
/// body when reaching the end of the tab bar.
// For example, a [ListView] widget has implicit scrolling so that users can
// easily move the accessibility focus to the next set of children. A
// [PageView] widget does not have implicit scrolling, so that users don't
// navigate to the next page when reaching the end of the current one.
static const SemanticsFlag hasImplicitScrolling = const SemanticsFlag._(_kHasImplicitScrollingIndex);

/// The possible semantics flags.
Expand Down
1 change: 1 addition & 0 deletions lib/ui/semantics/semantics_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ enum class SemanticsFlags : int32_t {
kIsLiveRegion = 1 << 15,
kHasToggledState = 1 << 16,
kIsToggled = 1 << 17,
kHasImplicitScrolling = 1 << 18,
};

struct SemanticsNode {
Expand Down
8 changes: 8 additions & 0 deletions shell/platform/embedder/embedder.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ typedef enum {
kFlutterSemanticsFlagHasToggledState = 1 << 16,
// If true, the semantics node is "on". If false, the semantics node is "off".
kFlutterSemanticsFlagIsToggled = 1 << 17,
/// Whether the platform can scroll the semantics node when the user attempts
/// to move the accessibility focus to an offscreen child.
///
// For example, a |ListView| widget has implicit scrolling so that users can
// easily move the accessibility focus to the next set of children. A
// |PageView| widget does not have implicit scrolling, so that users don't
// navigate to the next page when reaching the end of the current one.
kFlutterSemanticsFlagHasImplicitScrolling = 1 << 18,
} FlutterSemanticsFlag;

typedef enum {
Expand Down

0 comments on commit 21cfb01

Please sign in to comment.