flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
165.61k stars 27.34k forks source link

Android App Launch does not use theme properly #23189

Open DavidCorrado opened 6 years ago

DavidCorrado commented 6 years ago

Short Summary of issue It seems that the app launch process does not handle themes properly and does not theme the status bar and background color correctly per how you would expect if you were developing natively on Android

Additonal Details So from my testing there is two basic app launch scenarios a native app should use to launch the app per the material documentation: https://material.io/design/communication/launch-screen.html#usage Basically a splash screen and placeholder UI. I saw there are are many pull requests related to this such as: https://github.com/flutter/flutter/issues/8147 https://github.com/flutter/flutter/pull/11505

It seems that on iOS it works how I would expect but on Android I would expect it to use the theme on launch to make it feel more native.

Below is how it works on Native Android: Android Native With Splash Note: Shows status bar per the theme. androidnativewithsplash Android Native Without Splash: Note: Shows status bar per the theme. androidwithoutsplash

Steps to reproduce If I create the default flutter android application per Android Studio and below is my flutter doctor results

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.9.4, on Mac OS X 10.14 18A391, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
[✓] Android Studio (version 3.2)
[✓] VS Code (version 1.28.1)
[✓] Connected devices (1 available)

I am testing on a Pixel 2 Emulator API 26

There are 3 situations I would like to highlight with examples 1) Default flutter app with no modifications looks like below: Note: Status bar changes from Black to the themed blue flutterdefaultproject

2) Flutter app with splash modified to match theme color Note: Status bar changes from Black to themed blue flutterandroidsplash

3) Flutter app with splash disabled Note: Screen is black and then goes into themed app flutterandroidnosplash

Goal state It would be great if there was a way to first of all get the theme you choose in flutter to plug into android like you included it via a style. Also with the solution you might want to consider how to support more placeholder UI such as I want to show the toolbar on app launch or something like that.

Work around https://github.com/DavidCorrado/FlutterSplashTesting/commit/9aa6861e64fffe52d0138e19ce7be79ed75caaed

BassamxMednini commented 4 years ago

still waiting..

markusaksli-nc commented 3 years ago

The black status bar is still reproducible on the latest master 1.24.0-8.0.pre.291.

flutter doctor -v ``` [√] Flutter (Channel master, 1.24.0-8.0.pre.291, on Microsoft Windows [Version 10.0.19041.630], locale et-EE) • Flutter version 1.24.0-8.0.pre.291 at C:\Development\flutter_master • Framework revision c1042314a9 (4 hours ago), 2020-11-18 01:38:02 -0500 • Engine revision 35a0b9fe68 • Dart version 2.12.0 (build 2.12.0-50.0.dev) [√] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at C:\Users\marku\AppData\Local\Android\sdk • Platform android-30, build-tools 30.0.2 • Java binary at: C:\Users\marku\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\201.6953283\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe [√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.7) • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community • Visual Studio Community 2019 version 16.7.30621.155 • Windows 10 SDK version 10.0.18362.0 [√] Android Studio (version 4.1.0) • Android Studio at C:\Users\marku\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\201.6953283 • 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 1.8.0_242-release-1644-b01) [√] IntelliJ IDEA Ultimate Edition (version 2020.2) • IntelliJ at C:\Users\marku\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\202.7660.26 • 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 [√] Connected device (6 available) • SM G950F (mobile) • ce12171c51cc001c03 • android-arm64 • Android 9 (API 28) • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19041.630] • Web Server (web) • web-server • web-javascript • Flutter Tools • Chrome (web) • chrome • web-javascript • Google Chrome 86.0.4240.198 • Edge (web) • edge • web-javascript • Microsoft Edge 86.0.622.68 • No issues found! ```
styles.xml (using dark mode) ```xml ```

This is further complicated by issues like https://github.com/flutter/flutter/issues/39614, https://github.com/flutter/flutter/issues/65405, and https://github.com/flutter/flutter/issues/61149.

exaby73 commented 1 year ago

I can still reproduce this issue on Android 11. On Android 13 for example, the status bar is white by default. Updating labels to reflect the same