[Gallery] Fix slow motion setting announcement (#301)

* Enable a11y carousel scrolling

* Fix slow motion announcement on android talkback

* Revert "Enable a11y carousel scrolling"

This reverts commit cc8f233b54.
pull/305/head
Pierre-Louis 5 years ago committed by GitHub
parent b485f10fca
commit 6f0f2fed52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -26,44 +26,47 @@ class SlowMotionSetting extends StatelessWidget {
final textTheme = Theme.of(context).textTheme;
final options = GalleryOptions.of(context);
return Container(
margin: settingItemHeaderMargin,
child: Material(
shape: RoundedRectangleBorder(borderRadius: settingItemBorderRadius),
color: colorScheme.secondary,
clipBehavior: Clip.antiAlias,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Padding(
padding: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
GalleryLocalizations.of(context).settingsSlowMotion,
style: textTheme.subhead.apply(
color: colorScheme.onSurface,
return Semantics(
container: true,
child: Container(
margin: settingItemHeaderMargin,
child: Material(
shape: RoundedRectangleBorder(borderRadius: settingItemBorderRadius),
color: colorScheme.secondary,
clipBehavior: Clip.antiAlias,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Padding(
padding: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
GalleryLocalizations.of(context).settingsSlowMotion,
style: textTheme.subhead.apply(
color: colorScheme.onSurface,
),
),
),
],
],
),
),
),
),
Padding(
padding: const EdgeInsetsDirectional.only(end: 8),
child: Switch(
activeColor: colorScheme.primary,
value: options.timeDilation != 1.0,
onChanged: (isOn) => GalleryOptions.update(
context,
options.copyWith(timeDilation: isOn ? 5.0 : 1.0),
Padding(
padding: const EdgeInsetsDirectional.only(end: 8),
child: Switch(
activeColor: colorScheme.primary,
value: options.timeDilation != 1.0,
onChanged: (isOn) => GalleryOptions.update(
context,
options.copyWith(timeDilation: isOn ? 5.0 : 1.0),
),
),
),
),
],
],
),
),
),
);

Loading…
Cancel
Save