Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the implementation process of Android immersive status bar?

Shulou Source: shulou.com Published: 2022-06-02 16:52:21 09月13日 Update

This article mainly explains "what is the implementation process of Android immersive status bar". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "Android immersive status bar implementation process is how" it!

Android- immersive status bar

Our journey is the stars and the sea, not the dust on earth.

Remove the title bar

First of all, remove the ActionBar that comes with Android under the corresponding topic, and just add NoActionBar under the corresponding topic.

Effect.

Introduce dependent implementation 'com.jaeger.statusbarutil:library:1.5.1' immersion status bar color

Immersive status bar, can not only achieve color immersion, but also can achieve picture immersion.

The state of color immersion is not set:

Logic code:

StatusBarUtil.setColor (MainActivity.this,getResources () .getColor (R.color.teal_200), 0)

Layout file

Immersion status bar picture

The effect before immersion

The effect after immersion

Layout code

Put the picture to be immersed in the ImageView component

The other components are placed in a layout

Replace with a setTransparentForImageView method

Logic code

StatusBarUtil.setTransparentForImageView (this,findViewById (R.id.constraintLayout))

StatusBarUtil official website

At this point, I believe that everyone on the "Android immersive status bar implementation process is how" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: State process code picture layout effect color theme content method component logic learning utility deeper human interest sea practicality reality Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Shulou Technology Redmi Apple OPPO Reno