Repository navigation
Fix AccessibilityFeatures.disableAnimations flag on Android 12+ - #53428
auto-submit[bot] merged 3 commits into
Conversation
reidbaker
left a comment
There was a problem hiding this comment.
Can you check on a pre android 12 device to make sure that this code does not need to branch?
For example if before it stored "0" instead of 0 (and now stores 0.0)
|
Thanks for reviewing @jonahwilliams and @reidbaker. I actually discovered there's a second bug in
I've pushed a second commit that fixes this as well, and I now believe flutter/flutter#130976 is fully resolved. To verify, I have created a simple Flutter app that displays the value of Pixel.4.API.29.webmPixel.6.API.33.webms20.API.33.mp4Test app: import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: Scaffold(
body: Center(
child:
Text('MediaQueryData.disableAnimations=${MediaQuery.disableAnimationsOf(context)}'),
),
),
);
}
} |
fc332f5 to
ee06b26
Compare
|
@reidbaker, I’ve expanded the |
This PR fixes the problem where Flutter would not respect the "remove animation" accessibility setting on Android 12+.
Please see this issue for details: flutter/flutter#130976
As mentioned by horsemankukka, the problem has to do with reading
Settings.Global.TRANSITION_ANIMATION_SCALEas a string instead of a float. Flutter would compare it to the string "0" to determine if animations should be disabled. Presumably, this worked because the settings app did indeed use the string "0" or "1" for this setting. But as of Android 12 it's instead written using float representation ("0.0" or "1.0"), at least on Samsung devices. The documentation also states that this setting should be read as a float, which is what this PR does.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.