Extract image color

Liu Haiping supports

The View cutting

Applications (Toolbar)

Control system interface (Status bar)

Note: Bangs and the status bar

LayoutInDisplayCutoutMode: LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT - this is the default behavior, as described above. In portrait mode, the content is displayed in the fringe area; But in landscape mode, the content shows black edges. LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES - In portrait mode and landscape mode, the content is rendered to the fringe area. Android may not allow content views to overlap with system bars. To replace this behavior and force the content to the fringe area, please pass the setSystemUiVisibility (int) method applying the following any sign to View visibility:  SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION SYSTEM_UI_FLAG_LAYOUT_STABLE LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER - Content is never rendered to the bangs area. If LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER is set, the window is not allowed to overlap the bangs. This mode should be used to temporarily set the window of view.system_UI_FLAG_fullscreen or view.system_UI_FLAG_hide_navigation to avoid performing another window layout when the flag is set or cleared.Copy the code

Note: Full screen mode

The setSystemUiVisibility lean back (watch video) : SYSTEM_UI_FLAG_FULLSCREEN | SYSTEM_UI_FLAG_HIDE_NAVIGATION immersion mode: SYSTEM_UI_FLAG_FULLSCREEN | SYSTEM_UI_FLAG_HIDE_NAVIGATION | SYSTEM_UI_FLAG_IMMERSIVE viscous immersion mode:  SYSTEM_UI_FLAG_FULLSCREEN | SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKYCopy the code

Summary: WindowInsetsController enables the above functionality (API30)

    ViewCompat.getWindowInsetsController(view)
Copy the code