1- 基础概念
在Android系统中SystemUI是以应用的形式运行在Android系统当中,即编译SystemUI模块会生产APK文件,源代码路径在frameworks/base/packages/SystemUI/,安装路径system/priv-app/-SystemUI。
SystemUI是一个普通的APK文件,即是一个普通的APP,但是,手机使用者看见的所有SystemUI的内容都不像是一个APP,为什么?既然是一个应用,就是完成特定的功能,SystemUI主要完成的功能有:
frameworks/base/packages/SystemUI/res/values/config.xml
283 <string-array name="config_systemUIServiceComponents" translatable="false">
284 <item>com.android.systemui.util.NotificationChannels</item>
285 <item>com.android.systemui.statusbar.CommandQueue$CommandQueueStart</item>
286 <item>com.android.systemui.keyguard.KeyguardViewMediator</item>
287 <item>com.android.systemui.recents.Recents</item>
288 <item>com.android.systemui.volume.VolumeUI</item>
289 <item>com.android.systemui.stackdivider.Divider</item>
290 <item>com.android.systemui.SystemBars</item>
291 <item>com.android.systemui.usb.StorageNotification</item>
292 <item>com.android.systemui.power.PowerUI</item>
293 <item>com.android.systemui.media.RingtonePlayer</item>
294 <item>com.android.systemui.keyboard.KeyboardUI</item>
295 <item>com.android.systemui.pip.PipUI</item>
296 <item>com.android.systemui.shortcut.ShortcutKeyDispatcher</item>
297 <item>@string/config_systemUIVendorServiceComponent</item>
298 <item>com.android.systemui.util.leak.GarbageMonitor$Service</item>
299 <item>com.android.systemui.LatencyTester</item>
300 <item>com.android.systemui.globalactions.GlobalActionsComponent</item>
301 <item>com.android.systemui.ScreenDecorations</item>
302 <item>com.android.systemui.biometrics.BiometricDialogImpl</item>
303 <item>com.android.systemui.SliceBroadcastRelayHandler</item>
304 <item>com.android.systemui.SizeCompatModeActivityController</item>
305 <item>com.android.systemui.statusbar.notification.InstantAppNotifier</item>
306 <item>com.android.systemui.theme.ThemeOverlayController</item>
307 </string-array>
![](https://img.haomeiwen.com/i17969152/fbfec43d1c06aa09.png)
![](https://img.haomeiwen.com/i17969152/a21110409848fef2.png)
frameworks/base/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java
public void onCreate()
---》 startSecondaryUserServicesIfNeeded()
---》 public void startServicesIfNeeded()
---》 startServicesIfNeeded(names);
---》 mServices[i].start();
从什么可以看出systemui,启动了各个服务。 SystemUI需要启动的Service包括KeyguardViewMediator、Recent、VolumeUI、SystemBars、StorageNotification、PowerUI、RingtongPlayer等
2- 手势导航
android 10 开启了手势导航
![](https://img.haomeiwen.com/i17969152/6317d66b890a431f.png)
也可以在配置里面修改:
framework/base/core/res/res/values/config.xml
<bool name="config_swipe_up_gesture_setting_available">true</bool>
![](https://img.haomeiwen.com/i17969152/adbea4f538721f77.png)
![](https://img.haomeiwen.com/i17969152/e221e9416497a225.png)
如果采用全面屏手势后, APP在设计中要注意,系统栏(状态栏& 导航栏)对app 的影响,主屏手势区域对边界的影响。
对沉浸模式理解:
![](https://img.haomeiwen.com/i17969152/7237197a93495a1d.png)
-
沉浸模式主要针对全屏操作下通过系统栏上滑动 退出情况的来说的 。
非粘性沉浸模式---》系统栏上滑动--》系统栏显示半透明,不消失
粘性沉浸模式---》系统栏上滑动--》系统栏隐藏--》显示,延时自动消失 -
一般的全屏,在任何地方触摸都可以退出显示系统栏,然后退出
沉浸模式理解参考:
https://zhuanlan.zhihu.com/p/92906684
https://zhuanlan.zhihu.com/p/94082454
https://zhuanlan.zhihu.com/p/97576915
https://zhuanlan.zhihu.com/p/99696248
https://www.it610.com/article/5205577.htm
架构分析参考:
https://blog.csdn.net/myfriend0/article/details/54972861
其他:
https://www.jianshu.com/p/83ce8731fb13
https://www.jianshu.com/p/32ef16fc77d2
https://developer.android.google.cn/training/gestures/detector?hl=fr&authuser=0
网友评论