seamlink-aalves commented on issue #114: URL: https://github.com/apache/cordova-discuss/issues/114#issuecomment-4047313684
I did further test for this migration and found other issues that I'd like to share: For cordova-android 15 I started testing the build of the App with `AndroidEdgeToEdge` preference and while I see the same result as with `StatusBarOverlaysWebView` of `cordova-plugin-statusbar` this will to work correctly on Android version under 15. For these devices the app will not extend under the status bar but worst of all it will keep adding the insets on the top of the App. In summary, I get the status bar, the app UI starts bellow the the status bar and it will also assume the insets as if the app extended bellow the status bar. It also made no difference having the statusbar plugin or not. The result is the same. After some digging of the cordova-android 15 code I was able to get a better result changing the source code here (https://github.com/apache/cordova-android/blob/c02d1b0331d82c0480a275804f85d134ad201155/framework/src/org/apache/cordova/CordovaActivity.java#L124) from: `canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM;` to: `canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false);` Also changed here (https://github.com/apache/cordova-android/blob/c02d1b0331d82c0480a275804f85d134ad201155/framework/src/org/apache/cordova/SystemBarPlugin.java#L58) from: `canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM;` to: `canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false);` While this fixes the insets problem in Android < 15 and does not change the behaviour for Android >= 15, for the first ones it does not solve the overlay of the status bar. For me this would be acceptable and good compromise. I found no way to overlay the statusbar over the webview for android <15. I will try to make a PR with this change. For cordova-ios 8 my tests have turned out mixed results. After my last comment I did further tests and while I confirmed that in a blank app I was able to get an App with the webview extended under the statusbar with `viewport-fit=cover`, with our App, after removing the status bar plugin and having `viewport-fit=cover` I was unable to get the App to extend under the statusbar. Without the status bar I could only get the desired result by implementing an override to the `viewDidLoad` function in the `ViewController` like this: ``` /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ import Cordova import WebKit #if compiler(>=6.1) @objc @implementation #else @_objcImplementation #endif extension MainViewController { } class ViewController: MainViewController { override func viewDidLoad() { super.viewDidLoad() if #available(iOS 11.0, *), let wk = self.webView as? WKWebView { wk.scrollView.contentInsetAdjustmentBehavior = .never } } } ``` Please note that I searched the complete code of the App to check if there was something manipulating. I found that the cordova inappvrowser also has code related to the manipulation of the statusbar, so I removed it but got the same result with UI of the app starting after the status bar. After removing both the statusbar and the inappbrowser I found no code related to the manipulation of the statusbar except for the platform code. Finally, I found no way to control the color of the text of the status bar without the status bar plugin. Will this be implemented in the future? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
