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
void initState() {
super.initState();
widget.controller.addStatusListener(_handleStatusChange);
_ignoring = widget.controller.status != AnimationStatus.completed;
_ignoring = widget.controller.status != widget.status;
}
@override
......@@ -283,7 +283,7 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
),
trailing: new IconButton(
onPressed: _toggleFrontLayer,
tooltip: 'Show options page',
tooltip: 'Toggle options page',
icon: new AnimatedIcon(
icon: AnimatedIcons.close_menu,
progress: _controller,
......@@ -328,14 +328,16 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
),
new PositionedTransition(
rect: frontRelativeRect,
child: new Container(
alignment: Alignment.topLeft,
child: new GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: _toggleFrontLayer,
onVerticalDragUpdate: _handleDragUpdate,
onVerticalDragEnd: _handleDragEnd,
child: widget.frontHeading,
child: new ExcludeSemantics(
child: new Container(
alignment: Alignment.topLeft,
child: new GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: _toggleFrontLayer,
onVerticalDragUpdate: _handleDragUpdate,
onVerticalDragEnd: _handleDragEnd,
child: widget.frontHeading,
),
),
),
),
......
......@@ -96,17 +96,19 @@ class _OptionsItem extends StatelessWidget {
Widget build(BuildContext context) {
final double textScaleFactor = MediaQuery.of(context)?.textScaleFactor ?? 1.0;
return new Container(
constraints: new BoxConstraints(minHeight: _kItemHeight * textScaleFactor),
padding: _kItemPadding,
alignment: AlignmentDirectional.centerStart,
child: new DefaultTextStyle(
style: DefaultTextStyle.of(context).style,
maxLines: 2,
overflow: TextOverflow.fade,
child: new IconTheme(
data: Theme.of(context).primaryIconTheme,
child: child,
return new MergeSemantics(
child: new Container(
constraints: new BoxConstraints(minHeight: _kItemHeight * textScaleFactor),
padding: _kItemPadding,
alignment: AlignmentDirectional.centerStart,
child: new DefaultTextStyle(
style: DefaultTextStyle.of(context).style,
maxLines: 2,
overflow: TextOverflow.fade,
child: new IconTheme(
data: Theme.of(context).primaryIconTheme,
child: child,
),
),
),
);
......
......@@ -26,7 +26,7 @@ void main() {
await tester.pump(); // triggers a frame
// Show the options page
await tester.tap(find.byTooltip('Show options page'));
await tester.tap(find.byTooltip('Toggle options page'));
await tester.pumpAndSettle();
MaterialApp app = find.byType(MaterialApp).evaluate().first.widget;
......@@ -89,7 +89,7 @@ void main() {
expect(hasFeedback, true);
// Hide the options page
await tester.tap(find.byTooltip('Show options page'));
await tester.tap(find.byTooltip('Toggle options page'));
await tester.pumpAndSettle();
});
}
......@@ -16,7 +16,7 @@ void main() {
await tester.pump(); // see https://github.com/flutter/flutter/issues/1865
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
await tester.tap(showOptionsPageButton);
......
......@@ -96,7 +96,7 @@ Future<Null> smokeDemo(WidgetTester tester, GalleryDemo demo) 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
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