Deprecated methods that call setStatusBarColor, setNavigationBarColor, setNavigationBarDividerColor (#165737)

Added @deprecated annotation and explanation to methods that use these
methods: setStatusBarColor, setNavigationBarColor,
setNavigationBarDividerColor

This PR partially addresses #165327

---------

Co-authored-by: Reid Baker <1063596+reidbaker@users.noreply.github.com>
Co-authored-by: Camille Simon <43054281+camsim99@users.noreply.github.com>
Co-authored-by: Camille Simon <camillesimon@google.com>
This commit is contained in:
Narek Malkhasyan 2025-04-29 23:13:23 +04:00 committed by GitHub
parent 7141eb3bdc
commit 9eddcb7ba4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 1 deletions

View File

@ -808,6 +808,12 @@ public class FlutterActivity extends Activity
/*shouldDelayFirstAndroidViewDraw=*/ getRenderMode() == RenderMode.surface);
}
/**
* @deprecated This method is outdated because it calls {@code setStatusBarColor}, which is
* deprecated in Android 15 and above. Consider using the new WindowInsetsController or other
* Android 15+ APIs for system UI styling.
*/
@Deprecated
private void configureStatusBarForFullscreenFlutterExperience() {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);

View File

@ -600,6 +600,12 @@ public class FlutterFragmentActivity extends FragmentActivity
}
}
/**
* @deprecated This method is outdated because it calls {@code setStatusBarColor}, which is
* deprecated in Android 15 and above. Consider using the new WindowInsetsController or other
* Android 15+ APIs for system UI styling.
*/
@Deprecated
private void configureStatusBarForFullscreenFlutterExperience() {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);

View File

@ -403,7 +403,13 @@ public class PlatformPlugin {
updateSystemUiOverlays();
}
@SuppressWarnings("deprecation")
/**
* @deprecated This method is outdated because it calls {@code setStatusBarColor}, {@code
* setNavigationBarColor} and {@code setNavigationBarDividerColor}, which are deprecated in
* Android 15 and above. Consider using the new WindowInsetsController or other Android 15+
* APIs for system UI styling.
*/
@Deprecated
private void setSystemChromeSystemUIOverlayStyle(
PlatformChannel.SystemChromeStyle systemChromeStyle) {
Window window = activity.getWindow();