Skip to content

Commit 9eddcb7

Browse files
narekmalkreidbakercamsim99
authored
Deprecated methods that call setStatusBarColor, setNavigationBarColor, setNavigationBarDividerColor (flutter#165737)
Added @deprecated annotation and explanation to methods that use these methods: setStatusBarColor, setNavigationBarColor, setNavigationBarDividerColor This PR partially addresses flutter#165327 --------- Co-authored-by: Reid Baker <[email protected]> Co-authored-by: Camille Simon <[email protected]> Co-authored-by: Camille Simon <[email protected]>
1 parent 7141eb3 commit 9eddcb7

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterActivity.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,12 @@ private View createFlutterView() {
808808
/*shouldDelayFirstAndroidViewDraw=*/ getRenderMode() == RenderMode.surface);
809809
}
810810

811+
/**
812+
* @deprecated This method is outdated because it calls {@code setStatusBarColor}, which is
813+
* deprecated in Android 15 and above. Consider using the new WindowInsetsController or other
814+
* Android 15+ APIs for system UI styling.
815+
*/
816+
@Deprecated
811817
private void configureStatusBarForFullscreenFlutterExperience() {
812818
Window window = getWindow();
813819
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);

engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterFragmentActivity.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,12 @@ protected FlutterFragment createFlutterFragment() {
600600
}
601601
}
602602

603+
/**
604+
* @deprecated This method is outdated because it calls {@code setStatusBarColor}, which is
605+
* deprecated in Android 15 and above. Consider using the new WindowInsetsController or other
606+
* Android 15+ APIs for system UI styling.
607+
*/
608+
@Deprecated
603609
private void configureStatusBarForFullscreenFlutterExperience() {
604610
Window window = getWindow();
605611
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);

engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,13 @@ private void restoreSystemChromeSystemUIOverlays() {
403403
updateSystemUiOverlays();
404404
}
405405

406-
@SuppressWarnings("deprecation")
406+
/**
407+
* @deprecated This method is outdated because it calls {@code setStatusBarColor}, {@code
408+
* setNavigationBarColor} and {@code setNavigationBarDividerColor}, which are deprecated in
409+
* Android 15 and above. Consider using the new WindowInsetsController or other Android 15+
410+
* APIs for system UI styling.
411+
*/
412+
@Deprecated
407413
private void setSystemChromeSystemUIOverlayStyle(
408414
PlatformChannel.SystemChromeStyle systemChromeStyle) {
409415
Window window = activity.getWindow();

0 commit comments

Comments
 (0)