华为手机适配:
直接在入口文件MainActivity.java中添加:
import android.graphics.Color;
import android.view.View;
import android.view.Window;
import android.os.Build;
if (Build.VERSION.SDK_INT >= 21) {
final Window window = getWindow();
window.getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
window.setStatusBarColor(Color.TRANSPARENT);
}
关于隐藏状态栏、导航栏:
https://blog.csdn.net/QQxiaoqiang1573/article/details/79867127
留海屏适配(android 9.0之后google官方支持)
https://developer.huawei.com/consumer/cn/devservice/doc/50114