美文网首页android
SystemUi-基础1

SystemUi-基础1

作者: xuefeng_apple | 来源:发表于2021-04-12 09:46 被阅读0次

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>

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 开启了手势导航


也可以在配置里面修改:
framework/base/core/res/res/values/config.xml
<bool name="config_swipe_up_gesture_setting_available">true</bool>

如果采用全面屏手势后, APP在设计中要注意,系统栏(状态栏& 导航栏)对app 的影响,主屏手势区域对边界的影响。

对沉浸模式理解:


  • 沉浸模式主要针对全屏操作下通过系统栏上滑动 退出情况的来说的 。
    非粘性沉浸模式---》系统栏上滑动--》系统栏显示半透明,不消失
    粘性沉浸模式---》系统栏上滑动--》系统栏隐藏--》显示,延时自动消失

  • 一般的全屏,在任何地方触摸都可以退出显示系统栏,然后退出

沉浸模式理解参考:
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

相关文章

  • SystemUi-基础1

    1- 基础概念 在Android系统中SystemUI是以应用的形式运行在Android系统当中,即编译Syste...

  • 1、基础

    创建项目 django-admin project_name cd project_name python ma...

  • 基础1

    什么是php? 什么是b/s &&c/s/和常用属性 程序语言 table 表格标签: 属性:border wi...

  • 基础1

    d键切换默认前景色、背景色 shift+ctrl+I 反选

  • 基础1

    ⒈文字:移动文字使用左最上方箭头 ⒉按住alt 切换放大镜放大缩小 ⒊Ctrl 0在图片放大缩小的情况下最快恢复到...

  • 基础-1

    递归 在递归中可以使用指针进行数字迭代操作,要注意*num++ (误) -----> (*num)++(对)层次...

  • 基础-1

    存储单元 微型机存储器的存储单元可以存储1个byte(字节),1个byte包含8个bit(位) byte=B ...

  • 基础-1

    Nest是一个渐进式的Node框架,可以在TypeScript和JavaScript(ES6、ES7、ES8)之上...

  • 基础-1

    主函数:程序有且只有一个主函数package main //导入主函数的包func main() {} 打印的模...

  • 基础1

    var / val 的区别 用kt文件转化成的java文件做对比 kotlin: decompile之后的jav...

网友评论

    本文标题:SystemUi-基础1

    本文链接:https://www.haomeiwen.com/subject/hkbtlltx.html