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

Loading…
Cancel
Save