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,14 +328,16 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin ...@@ -328,14 +328,16 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
), ),
new PositionedTransition( new PositionedTransition(
rect: frontRelativeRect, rect: frontRelativeRect,
child: new Container( child: new ExcludeSemantics(
alignment: Alignment.topLeft, child: new Container(
child: new GestureDetector( alignment: Alignment.topLeft,
behavior: HitTestBehavior.opaque, child: new GestureDetector(
onTap: _toggleFrontLayer, behavior: HitTestBehavior.opaque,
onVerticalDragUpdate: _handleDragUpdate, onTap: _toggleFrontLayer,
onVerticalDragEnd: _handleDragEnd, onVerticalDragUpdate: _handleDragUpdate,
child: widget.frontHeading, onVerticalDragEnd: _handleDragEnd,
child: widget.frontHeading,
),
), ),
), ),
), ),
......
...@@ -96,17 +96,19 @@ class _OptionsItem extends StatelessWidget { ...@@ -96,17 +96,19 @@ 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(
constraints: new BoxConstraints(minHeight: _kItemHeight * textScaleFactor), child: new Container(
padding: _kItemPadding, constraints: new BoxConstraints(minHeight: _kItemHeight * textScaleFactor),
alignment: AlignmentDirectional.centerStart, padding: _kItemPadding,
child: new DefaultTextStyle( alignment: AlignmentDirectional.centerStart,
style: DefaultTextStyle.of(context).style, child: new DefaultTextStyle(
maxLines: 2, style: DefaultTextStyle.of(context).style,
overflow: TextOverflow.fade, maxLines: 2,
child: new IconTheme( overflow: TextOverflow.fade,
data: Theme.of(context).primaryIconTheme, child: new IconTheme(
child: child, data: Theme.of(context).primaryIconTheme,
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