Skip to content

Commit

Permalink
Only touch APPEARANCE_LIGHT_STATUS_BARS
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Abbondanzo committed Oct 14, 2023
1 parent b2bbedb commit dc76851
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import android.view.ViewGroup;
import android.view.ViewStructure;
import android.view.Window;
import android.view.WindowInsetsController;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityEvent;
import android.widget.FrameLayout;
Expand Down Expand Up @@ -395,12 +396,15 @@ private void updateSystemAppearance() {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.R) {
int activityAppearance =
currentActivity.getWindow().getInsetsController().getSystemBarsAppearance();
int dialogAppearance = mDialog.getWindow().getInsetsController().getSystemBarsAppearance();
int appearanceMask = activityAppearance ^ dialogAppearance;
int activityLightStatusBars =
activityAppearance & WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS;
mDialog
.getWindow()
.getInsetsController()
.setSystemBarsAppearance(activityAppearance, appearanceMask);
.setSystemBarsAppearance(
activityLightStatusBars,
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS
);
} else {
mDialog
.getWindow()
Expand Down

0 comments on commit dc76851

Please sign in to comment.