Explain the latest adaptation of MIUI 9 immersive status bar

Question:

Recently, the latest MIUI 9 system was updated. After installing the company's application, I found that the previously adapted immersive status bar suddenly had no effect. I felt very depressed. So I searched the Internet for articles on the adaptation of Xiaomi's mobile phone status bar, and found that most of the articles were still the previous adaptation scheme:

So I went to Xiaomi's open platform and found the problem:

1. Before Android 6.0, there was no way for Android to achieve the effect of "black characters in the status bar", so MIUI made an interface by itself.

2. In Android 6.0 and above, Android provides a standard method to achieve the effect of "black characters in the status bar", but this method conflicts with MIUI's method, so that when developers use the Android standard method, the expected effect does not appear, which has caused trouble to many developers, especially overseas developers.

In order to solve this problem, Xiaomi Jue decided to be compatible with the official standard solution of Android after MIUI 9 and abandoned its own solution. Therefore, for users of versions above MIUI 9, the implementation of dark fonts in the mobile phone status bar needs to be re adapted, and Xiaomi official also gave the latest adaptation solution.

In the new MIUI Version (i.e. based on Android 6.0, development version 7.7.13 and later):

Status bar dark font:

Status bar white font:

However, in order to continue adapting to the previous MIUI system, you need to write the above two schemes at the same time

Finally, the implementation code is as follows:

After modifying the above code, I finally saw the familiar immersive effect again!

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>