@@ -255,7 +255,7 @@ protected void onCreate(Bundle savedInstanceState) {
255
255
if (isImmersiveInterface ()) {
256
256
binding .drawerLayout .setStatusBarBackgroundColor (Color .TRANSPARENT );
257
257
if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .R ) {
258
- binding .drawerLayout .setFitsSystemWindows (false );
258
+ // binding.drawerLayout.setFitsSystemWindows(false);
259
259
window .setDecorFitsSystemWindows (false );
260
260
} else {
261
261
window .setFlags (WindowManager .LayoutParams .FLAG_LAYOUT_NO_LIMITS , WindowManager .LayoutParams .FLAG_LAYOUT_NO_LIMITS );
@@ -283,6 +283,12 @@ public WindowInsetsCompat onApplyWindowInsets(@NonNull View v, @NonNull WindowIn
283
283
fabParams .bottomMargin = allInsets .bottom ;
284
284
navigationWrapper .floatingActionButton .setLayoutParams (fabParams );
285
285
}
286
+ } else {
287
+ ViewGroup .MarginLayoutParams navRailParams = (ViewGroup .MarginLayoutParams )
288
+ navigationWrapper .navigationRailView .getLayoutParams ();
289
+ navRailParams .bottomMargin = allInsets .bottom ;
290
+ navRailParams .setMarginStart (allInsets .left );
291
+ navigationWrapper .navigationRailView .setLayoutParams (navRailParams );
286
292
}
287
293
288
294
if (navigationWrapper .bottomAppBar != null ) {
@@ -301,10 +307,14 @@ public WindowInsetsCompat onApplyWindowInsets(@NonNull View v, @NonNull WindowIn
301
307
View toolbar = binding .includedAppBar .toolbar ;
302
308
ViewGroup .MarginLayoutParams params = (ViewGroup .MarginLayoutParams ) toolbar .getLayoutParams ();
303
309
params .topMargin = allInsets .top ;
304
- params .setMarginStart (params . getMarginStart () + allInsets .left );
305
- params .setMarginEnd (params . getMarginEnd () + allInsets .right );
310
+ params .setMarginStart (allInsets .left );
311
+ params .setMarginEnd (allInsets .right );
306
312
toolbar .setLayoutParams (params );
307
313
314
+ binding .includedAppBar .tabLayoutMainActivity .setPadding (
315
+ allInsets .left , 0 , allInsets .right , 0
316
+ );
317
+
308
318
return WindowInsetsCompat .CONSUMED ;
309
319
}
310
320
});
0 commit comments