435 {
436 View fakeDecorView = mock(View.class);
437 Window fakeWindow = mock(Window.class);
438 Activity mockActivity = mock(Activity.class);
439 when(fakeWindow.getDecorView()).thenReturn(fakeDecorView);
440 when(mockActivity.getWindow()).thenReturn(fakeWindow);
441 PlatformPlugin platformPlugin = new PlatformPlugin(mockActivity, mockPlatformChannel);
442
443 if (
Build.VERSION.SDK_INT >= API_LEVELS.API_28) {
444 platformPlugin.mPlatformMessageHandler.showSystemUiMode(
445 PlatformChannel.SystemUiMode.LEAN_BACK);
446 verify(fakeDecorView)
447 .setSystemUiVisibility(
448 View.SYSTEM_UI_FLAG_LAYOUT_STABLE
449 | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
450 | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
451 | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
452 | View.SYSTEM_UI_FLAG_FULLSCREEN);
453
454 platformPlugin.mPlatformMessageHandler.showSystemUiMode(
455 PlatformChannel.SystemUiMode.IMMERSIVE);
456 verify(fakeDecorView)
457 .setSystemUiVisibility(
458 View.SYSTEM_UI_FLAG_IMMERSIVE
459 | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
460 | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
461 | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
462 | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
463 | View.SYSTEM_UI_FLAG_FULLSCREEN);
464
465 platformPlugin.mPlatformMessageHandler.showSystemUiMode(
466 PlatformChannel.SystemUiMode.IMMERSIVE_STICKY);
467 verify(fakeDecorView)
468 .setSystemUiVisibility(
469 View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
470 | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
471 | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
472 | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
473 | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
474 | View.SYSTEM_UI_FLAG_FULLSCREEN);
475 }
476
477 if (
Build.VERSION.SDK_INT >= API_LEVELS.API_29) {
478 platformPlugin.mPlatformMessageHandler.showSystemUiMode(
479 PlatformChannel.SystemUiMode.EDGE_TO_EDGE);
480 verify(fakeDecorView)
481 .setSystemUiVisibility(
482 View.SYSTEM_UI_FLAG_LAYOUT_STABLE
483 | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
484 | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
485 }
486 }