Unverified Commit 709b0cb2 authored by xster's avatar xster Committed by GitHub

Accessibility fixes for new gallery (#16973)

parent 100be23a
...@@ -46,7 +46,7 @@ class _IgnorePointerWhileStatusIsNotState extends State<_IgnorePointerWhileStatu ...@@ -46,7 +46,7 @@ class _IgnorePointerWhileStatusIsNotState extends State<_IgnorePointerWhileStatu
void initState() { void initState() {
super.initState(); super.initState();
widget.controller.addStatusListener(_handleStatusChange); widget.controller.addStatusListener(_handleStatusChange);
_ignoring = widget.controller.status != AnimationStatus.completed; _ignoring = widget.controller.status != widget.status;
} }
@override @override
...@@ -283,7 +283,7 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin ...@@ -283,7 +283,7 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
), ),
trailing: new IconButton( trailing: new IconButton(
onPressed: _toggleFrontLayer, onPressed: _toggleFrontLayer,
tooltip: 'Show options page', tooltip: 'Toggle options page',
icon: new AnimatedIcon( icon: new AnimatedIcon(
icon: AnimatedIcons.close_menu, icon: AnimatedIcons.close_menu,
progress: _controller, progress: _controller,
...@@ -328,6 +328,7 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin ...@@ -328,6 +328,7 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
), ),
new PositionedTransition( new PositionedTransition(
rect: frontRelativeRect, rect: frontRelativeRect,
child: new ExcludeSemantics(
child: new Container( child: new Container(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: new GestureDetector( child: new GestureDetector(
...@@ -339,6 +340,7 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin ...@@ -339,6 +340,7 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
), ),
), ),
), ),
),
], ],
); );
} }
......
...@@ -96,7 +96,8 @@ class _OptionsItem extends StatelessWidget { ...@@ -96,7 +96,8 @@ class _OptionsItem extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final double textScaleFactor = MediaQuery.of(context)?.textScaleFactor ?? 1.0; final double textScaleFactor = MediaQuery.of(context)?.textScaleFactor ?? 1.0;
return new Container( return new MergeSemantics(
child: new Container(
constraints: new BoxConstraints(minHeight: _kItemHeight * textScaleFactor), constraints: new BoxConstraints(minHeight: _kItemHeight * textScaleFactor),
padding: _kItemPadding, padding: _kItemPadding,
alignment: AlignmentDirectional.centerStart, alignment: AlignmentDirectional.centerStart,
...@@ -109,6 +110,7 @@ class _OptionsItem extends StatelessWidget { ...@@ -109,6 +110,7 @@ class _OptionsItem extends StatelessWidget {
child: child, child: child,
), ),
), ),
),
); );
} }
} }
......
...@@ -26,7 +26,7 @@ void main() { ...@@ -26,7 +26,7 @@ void main() {
await tester.pump(); // triggers a frame await tester.pump(); // triggers a frame
// Show the options page // Show the options page
await tester.tap(find.byTooltip('Show options page')); await tester.tap(find.byTooltip('Toggle options page'));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
MaterialApp app = find.byType(MaterialApp).evaluate().first.widget; MaterialApp app = find.byType(MaterialApp).evaluate().first.widget;
...@@ -89,7 +89,7 @@ void main() { ...@@ -89,7 +89,7 @@ void main() {
expect(hasFeedback, true); expect(hasFeedback, true);
// Hide the options page // Hide the options page
await tester.tap(find.byTooltip('Show options page')); await tester.tap(find.byTooltip('Toggle options page'));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
}); });
} }
...@@ -16,7 +16,7 @@ void main() { ...@@ -16,7 +16,7 @@ void main() {
await tester.pump(); // see https://github.com/flutter/flutter/issues/1865 await tester.pump(); // see https://github.com/flutter/flutter/issues/1865
await tester.pump(); // triggers a frame await tester.pump(); // triggers a frame
final Finder showOptionsPageButton = find.byTooltip('Show options page'); final Finder showOptionsPageButton = find.byTooltip('Toggle options page');
// Show the options page // Show the options page
await tester.tap(showOptionsPageButton); await tester.tap(showOptionsPageButton);
......
...@@ -96,7 +96,7 @@ Future<Null> smokeDemo(WidgetTester tester, GalleryDemo demo) async { ...@@ -96,7 +96,7 @@ Future<Null> smokeDemo(WidgetTester tester, GalleryDemo demo) async {
} }
Future<Null> smokeOptionsPage(WidgetTester tester) async { Future<Null> smokeOptionsPage(WidgetTester tester) async {
final Finder showOptionsPageButton = find.byTooltip('Show options page'); final Finder showOptionsPageButton = find.byTooltip('Toggle options page');
// Show the options page // Show the options page
await tester.tap(showOptionsPageButton); await tester.tap(showOptionsPageButton);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment