当前位置: 移动技术网 > 移动技术>移动开发>Android > SystemUI 如何判断当前界面显示的为全屏界面?

SystemUI 如何判断当前界面显示的为全屏界面?

2020年07月18日  | 移动技术网移动技术  | 我要评论

不积跬步无以至千里

一.前摘

         怎么判断当前的用户处于全屏模式呢?处于全屏模式当中即是状态栏处于沉浸状态,而往往此时用户其实是不想被打扰的。因此可以针对当前如果用户处于全屏模式下,我们做一些勿扰模式的一种行为,类似于当处于全屏模式我们就不再弹出全屏通知等等。

二.正文

现在我们判断全屏模式肯定是因为状态栏的沉浸式出现的,因此我们就以此为突破口,查看SystemUI的源码中怎么控制状态栏的消失的?

代码路径:

app/src/com/android/systemui/statusbar/phone/StatusBar.java

@Override // CommandQueue
    public void setWindowState(
            int displayId, @WindowType int window, @WindowVisibleState int state) {
        if (displayId != mDisplayId) {
            return;
        }
        boolean showing = state == WINDOW_STATE_SHOWING;
        if (mStatusBarWindow != null
                && window == StatusBarManager.WINDOW_STATUS_BAR
  

本文地址:https://blog.csdn.net/Older_Fisher/article/details/107388972

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网