Repository: flutter
Issue: [Android] ProgressBar animation is not working when using the theme `Theme.AppCompat.DayNight.NoActionBar` in Platform Views
Labels: platform-android,a: platform-views,has reproducible steps,P2,found in release: 3.7,found in release: 3.9,customer: radio,team-android,triaged-android

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->
ProgressBar animation is not working when embedding native views in a Flutter app, specifically implementing preloader when the banner is being loaded

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

1. Refer to the documentation [Hosting native Android views in your Flutter app with Platform Views](https://docs.flutter.dev/development/platform-integration/android/platform-views?tab=android-platform-views-java-tab).

2. In the file styles.xml under android/app/src/main/res/values/styles.xml, change the theme to `Theme.AppCompat.DayNight.NoActionBar`

`<style name="NormalTheme" parent="Theme.AppCompat.DayNight.NoActionBar" />`

3. Run your sample application.


**Expected results:**

Here is a sample snapshot using a different theme, example is the default style when creating a new Flutter project:

`<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">`

<img src=https://user-images.githubusercontent.com/42828461/223180078-40e26003-6f32-4853-a56e-bd757ffe8dbb.gif width="25%" height="25%">

There should be an animation on the ProgressBar just like the example above.

**Actual results:** 

Actual themes used when the behavior was being observed:

`<style name="NormalTheme" parent="Theme.AppCompat.DayNight.NoActionBar" />`

<img src=https://user-images.githubusercontent.com/42828461/223186565-e619fc53-6b6a-438b-8a98-15eaea717319.gif width="25%" height="25%">

The ProgressBar is either stuck/idle.

<details>
<summary>Code sample</summary>

Attached is a minimal reproducible sample.

<!--
      Please create a minimal reproducible sample that shows the problem
      and attach it below between the lines with the backticks.

      To create it you can use `flutter create bug` command and update the `main.dart` file.

      Alternatively, you can use https://dartpad.dev/
      which is capable of creating and running small Flutter apps.

      Without this we will unlikely be able to progress on the issue, and because of that
      we regretfully will have to close it.
-->

[flutter_sample.zip](https://github.com/flutter/flutter/files/10900827/flutter_sample.zip)

</details>

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue. If there is a crash, please include
      the entirety of the crash log including the backtrace.
-->

`flutter run --verbose`
```
[  +33 ms] executing: sysctl hw.optional.arm64
[  +16 ms] Exit code 1 from: sysctl hw.optional.arm64
[        ] sysctl: unknown oid 'hw.optional.arm64'
[   +1 ms] executing: [/Users/user/Developer/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +13 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] 12cb4eb7a009f52b347b62ade7cb4854b926af72
[        ] executing: [/Users/user/Developer/flutter/] git tag --points-at 12cb4eb7a009f52b347b62ade7cb4854b926af72
[  +61 ms] Exit code 0 from: git tag --points-at 12cb4eb7a009f52b347b62ade7cb4854b926af72
[        ] 3.7.6
[  +38 ms] executing: [/Users/user/Developer/flutter/] git rev-parse --abbrev-ref --symbolic @{upstream}
[  +21 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{upstream}
[        ] origin/stable
[        ] executing: [/Users/user/Developer/flutter/] git ls-remote --get-url origin
[  +15 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +50 ms] executing: [/Users/user/Developer/flutter/] git rev-parse --abbrev-ref HEAD
[  +16 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[   +1 ms] executing: sw_vers -productName
[  +31 ms] Exit code 0 from: sw_vers -productName
[        ] macOS
[        ] executing: sw_vers -productVersion
[  +31 ms] Exit code 0 from: sw_vers -productVersion
[        ] 13.2.1
[        ] executing: sw_vers -buildVersion
[  +28 ms] Exit code 0 from: sw_vers -buildVersion
[        ] 22D68
[        ] executing: uname -m
[  +17 ms] Exit code 0 from: uname -m
[   +1 ms] x86_64
[  +31 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +88 ms] executing: /Users/user/Library/Android/sdk/platform-tools/adb devices -l
[  +21 ms] executing: sysctl hw.optional.arm64
[   +8 ms] Exit code 1 from: sysctl hw.optional.arm64
[        ] sysctl: unknown oid 'hw.optional.arm64'
[        ] executing: xcrun xcodebuild -version
[ +247 ms] Exit code 0 from: xcrun xcodebuild -version
[   +3 ms] Xcode 14.2
           Build version 14C18
[   +3 ms] executing: xcrun xcdevice list --timeout 2
[   +2 ms] xcrun simctl list devices booted iOS --json
[        ] executing: xcrun simctl list devices booted iOS --json
[  +10 ms] executing: xcrun simctl list devices booted
[ +204 ms] Exit code 0 from: xcrun simctl list devices booted
[        ] == Devices ==
           -- iOS 16.2 --
               iPhone 14 Pro Max (78B01F9C-514E-4766-9DC6-ECE59E05BD40) (Booted)
[  +59 ms] List of devices attached
           emulator-5554          device product:sdk_gphone64_x86_64 model:sdk_gphone64_x86_64 device:emu64x transport_id:2
[ +229 ms] {
                      "devices" : {
                        "com.apple.CoreSimulator.SimRuntime.iOS-16-2" : [
                          {
                            "lastBootedAt" : "2023-02-22T22:22:13Z",
                            "dataPath" : "\/Users\/user\/Library\/Developer\/CoreSimulator\/Devices\/78B01F9C-514E-4766-9DC6-ECE59E05BD40\/data",
                            "dataPathSize" : 3170975744,
                            "logPath" : "\/Users\/user\/Library\/Logs\/CoreSimulator\/78B01F9C-514E-4766-9DC6-ECE59E05BD40",
                            "udid" : "78B01F9C-514E-4766-9DC6-ECE59E05BD40",
                            "isAvailable" : true,
                            "logPathSize" : 274432,
                            "deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-14-Pro-Max",
                            "state" : "Booted",
                            "name" : "iPhone 14 Pro Max"
                          }
                        ]
                      }
                    }
[+2691 ms] [
                      {
                        "simulator" : true,
                        "operatingSystemVersion" : "16.2 (20C52)",
                        "available" : true,
                        "platform" : "com.apple.platform.iphonesimulator",
                        "modelCode" : "iPad13,18",
                        "identifier" : "41AE502C-10A8-492F-A1B9-268AE7DC634E",
                        "architecture" : "x86_64",
                        "modelUTI" : "com.apple.ipad-10-1",
                        "modelName" : "iPad (10th generation)",
                        "name" : "iPad (10th generation)"
                      },
                      {
                        "simulator" : true,
                        "operatingSystemVersion" : "16.2 (20C52)",
                        "available" : true,
                        "platform" : "com.apple.platform.iphonesimulator",
                        "modelCode" : "iPhone14,6",
                        "identifier" : "3F23A51A-B690-4DCC-B133-AD7A0B5220FC",
                        "architecture" : "x86_64",
                        "modelUTI" : "com.apple.iphone-se3-1",
                        "modelName" : "iPhone SE (3rd generation)",
                        "name" : "iPhone SE (3rd generation)"
                      },
                      {
                        "simulator" : true,
                        "operatingSystemVersion" : "16.2 (20C52)",
                        "available" : true,
                        "platform" : "com.apple.platform.iphonesimulator",
                        "modelCode" : "iPad14,5",
                        "identifier" : "9BD38BC8-5B5B-4AE1-AC30-4F634EF5C0F3",
                        "architecture" : "x86_64",
                        "modelUTI" : "com.apple.ipad-pro-12point9-6th-1",
                        "modelName" : "iPad Pro (12.9-inch) (6th generation)",
                        "name" : "iPad Pro (12.9-inch) (6th generation)"
                      },
                      {
                        "simulator" : true,
                        "operatingSystemVersion" : "16.2 (20C52)",
                        "available" : true,
                        "platform" : "com.apple.platform.iphonesimulator",
                        "modelCode" : "iPad14,3",
                        "identifier" : "3626F91B-471C-4754-91A2-3CD8559298BB",
                        "architecture" : "x86_64",
                        "modelUTI" : "com.apple.ipad-pro-11-4th-1",
                        "modelName" : "iPad Pro (11-inch) (4th generation)",
                        "name" : "iPad Pro (11-inch) (4th generation)"
                      },
                      {
                        "simulator" : true,
                        "operatingSystemVersion" : "16.2 (20C52)",
                        "available" : true,
                        "platform" : "com.apple.platform.iphonesimulator",
                        "modelCode" : "iPad13,17",
                        "identifier" : "DD1E64BC-50FA-4A1D-B873-1F45B0ABBC8F",
                        "architecture" : "x86_64",
                        "modelUTI" : "com.apple.ipad-air5-1",
                        "modelName" : "iPad Air (5th generation)",
                        "name" : "iPad Air (5th generation)"
                      },
                      {
                        "simulator" : true,
                        "operatingSystemVersion" : "16.2 (20C52)",
                        "available" : true,
                        "platform" : "com.apple.platform.iphonesimulator",
                        "modelCode" : "iPhone15,3",
                        "identifier" : "78B01F9C-514E-4766-9DC6-ECE59E05BD40",
                        "architecture" : "x86_64",
                        "modelUTI" : "com.apple.iphone-14-pro-max-1",
                        "modelName" : "iPhone 14 Pro Max",
                        "name" : "iPhone 14 Pro Max"
                      },
                      {
                        "simulator" : false,
                        "operatingSystemVersion" : "13.2.1 (22D68)",
                        "interface" : "usb",
                        "available" : true,
                        "platform" : "com.apple.platform.macosx",
                        "modelCode" : "MacBookPro15,1",
                        "identifier" : "DBFDA7DB-8321-5FD2-A99E-96FAAE2E66C7",
                        "architecture" : "x86_64h",
                        "modelUTI" : "com.apple.macbookpro-15-retina-touchid-2018",
                        "modelName" : "MacBook Pro",
                        "name" : "My Mac"
                      },
                      {
                        "simulator" : true,
                        "operatingSystemVersion" : "16.2 (20C52)",
                        "available" : true,
                        "platform" : "com.apple.platform.iphonesimulator",
                        "modelCode" : "iPad14,1",
                        "identifier" : "B0A71B57-B78D-49E2-98ED-F249B229797B",
                        "architecture" : "x86_64",
                        "modelUTI" : "com.apple.ipad-mini6-1",
                        "modelName" : "iPad mini (6th generation)",
                        "name" : "iPad mini (6th generation)"
                      },
                      {
                        "simulator" : true,
                        "operatingSystemVersion" : "16.2 (20C52)",
                        "available" : true,
                        "platform" : "com.apple.platform.iphonesimulator",
                        "modelCode" : "iPhone14,7",
                        "identifier" : "FFB16B72-ED8F-4D3F-B7E5-4B50AED92C32",
                        "architecture" : "x86_64",
                        "modelUTI" : "com.apple.iphone-14-1",
                        "modelName" : "iPhone 14",
                        "name" : "iPhone 14"
                      },
                      {
                        "simulator" : true,
                        "operatingSystemVersion" : "16.2 (20C52)",
                        "available" : true,
                        "platform" : "com.apple.platform.iphonesimulator",
                        "modelCode" : "iPhone15,2",
                        "identifier" : "A5C6090F-8D3F-4496-A24A-E0988985CB27",
                        "architecture" : "x86_64",
                        "modelUTI" : "com.apple.iphone-14-pro-1",
                        "modelName" : "iPhone 14 Pro",
                        "name" : "iPhone 14 Pro"
                      },
                      {
                        "simulator" : true,
                        "operatingSystemVersion" : "16.2 (20C52)",
                        "available" : true,
                        "platform" : "com.apple.platform.iphonesimulator",
                        "modelCode" : "iPhone14,8",
                        "identifier" : "D66532B7-CD62-4197-A33E-B6FC3CB1ECD7",
                        "architecture" : "x86_64",
                        "modelUTI" : "com.apple.iphone-14-plus-1",
                        "modelName" : "iPhone 14 Plus",
                        "name" : "iPhone 14 Plus"
                      }
                    ]
[   +8 ms] /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell getprop
[  +63 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[   +4 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +86 ms] Multiple devices found:
[   +1 ms] ro.hardware = ranchu
[   +4 ms] sdk gphone64 x86 64 (mobile) • emulator-5554                        • android-x64 • Android 13 (API 33) (emulator)
[        ] iPhone 14 Pro Max (mobile)   • 78B01F9C-514E-4766-9DC6-ECE59E05BD40 • ios         • com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
[        ] [1]: sdk gphone64 x86 64 (emulator-5554)
[        ] [2]: iPhone 14 Pro Max (78B01F9C-514E-4766-9DC6-ECE59E05BD40)
[   +1 ms] Please choose one (To quit, press "q/Q")
[        ] : 
[+734801 ms] q
[  +18 ms] "flutter run" took 738,727ms.
[  +37 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      FlutterCommand._chooseOneOfAvailableDevices (package:flutter_tools/src/runner/flutter_command.dart:1542:7)
           <asynchronous suspension>
           #2      FlutterCommand.findAllTargetDevices (package:flutter_tools/src/runner/flutter_command.dart:1498:39)
           <asynchronous suspension>
           #3      RunCommand.validateCommand (package:flutter_tools/src/commands/run.dart:497:15)
           <asynchronous suspension>
           #4      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1381:5)
           <asynchronous suspension>
           #5      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1257:27)
           <asynchronous suspension>
           #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #7      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
           <asynchronous suspension>
           #8      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:283:9)
           <asynchronous suspension>
           #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #10     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
           <asynchronous suspension>
           #11     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:64:9)
           <asynchronous suspension>
           #12     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #13     main (package:flutter_tools/executable.dart:91:3)
           <asynchronous suspension>
           
           
[ +260 ms] ensureAnalyticsSent: 254ms
[        ] Running 0 shutdown hooks
[        ] Shutdown hooks complete
[        ] exiting with code 1

```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->
`flutter analyze` 
```
Analyzing flutter_sample...                                             
No issues found! (ran in 1.2s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->
`flutter doctor -v`
```
[✓] Flutter (Channel stable, 3.7.6, on macOS 13.2.1 22D68 darwin-x64, locale en)
    • Flutter version 3.7.6 on channel stable at /Users/user/Developer/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 12cb4eb7a0 (5 days ago), 2023-03-01 10:29:26 -0800
    • Engine revision ada363ee93
    • Dart version 2.19.3
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/user/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

[✓] VS Code (version 1.75.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.58.0

[✓] Connected device (4 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554                        • android-x64    • Android 13 (API 33) (emulator)
    • iPhone 14 Pro Max (mobile)   • 78B01F9C-514E-4766-9DC6-ECE59E05BD40 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
    • macOS (desktop)              • macos                                • darwin-x64     • macOS 13.2.1 22D68 darwin-x64
    • Chrome (web)                 • chrome                               • web-javascript • Google Chrome 110.0.5481.177

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
```

</details>


<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->