代码路径:
frameworks\base\packages\SystemUI
代码构成:

一、布局详细介绍

布局特点:
1、FrameLayout,自定义控件 的大量使用
2、布局层级分布,高度细化
3、状态繁多

statusBar 状态栏界面

布局文件
status_bar.xml


继续深入,查看system_icons 布局文件

在这儿需要注意一下,在这两个和电量有关的控件上方,还有一个和电量有关的控件,就是下边这个,
id 为 battery_level 。有什么区别呢?
看下图

这是锁屏状态下的截图,注意看百分号的位置颜色,上下两张截图是不一样的,但现在还不明白为什么要这么设计,后续再看

继续深入,打开signal_cluster_view 之后,我们就可以找到其他所有的系统图标了。

<com.android.systemui.statusbar.SignalClusterView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/signal_cluster"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingEnd="@dimen/signal_cluster_battery_padding"
>
<ImageView
android:id="@+id/vpn"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:paddingEnd="6dp"
android:src="@drawable/stat_sys_vpn_ic"
/>
<FrameLayout
android:id="@+id/ethernet_combo"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
>
<com.android.systemui.statusbar.AlphaOptimizedImageView
android:theme="@style/DualToneLightTheme"
android:id="@+id/ethernet"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
/>
<com.android.systemui.statusbar.AlphaOptimizedImageView
android:theme="@style/DualToneDarkTheme"
android:id="@+id/ethernet_dark"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:alpha="0.0"
/>
</FrameLayout>
<FrameLayout
android:id="@+id/wifi_combo"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
>
<com.android.systemui.statusbar.AlphaOptimizedImageView
android:theme="@style/DualToneLightTheme"
android:id="@+id/wifi_signal"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
/>
<com.android.systemui.statusbar.AlphaOptimizedImageView
android:theme="@style/DualToneDarkTheme"
android:id="@+id/wifi_signal_dark"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:alpha="0.0"
/>
</FrameLayout>
<View
android:id="@+id/wifi_signal_spacer"
android:layout_width="@dimen/status_bar_wifi_signal_spacer_width"
android:layout_height="4dp"
android:visibility="gone"
/>
<LinearLayout
android:id="@+id/mobile_signal_group"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
>
</LinearLayout>
<FrameLayout
android:id="@+id/no_sims_combo"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:contentDescription="@string/accessibility_no_sims">
<com.android.systemui.statusbar.AlphaOptimizedImageView
android:theme="@style/DualToneLightTheme"
android:id="@+id/no_sims"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/stat_sys_no_sims"
/>
<com.android.systemui.statusbar.AlphaOptimizedImageView
android:theme="@style/DualToneDarkTheme"
android:id="@+id/no_sims_dark"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/stat_sys_no_sims"
android:alpha="0.0"
/>
</FrameLayout>
<View
android:id="@+id/wifi_airplane_spacer"
android:layout_width="@dimen/status_bar_airplane_spacer_width"
android:layout_height="4dp"
android:visibility="gone"
/>
<ImageView
android:id="@+id/airplane"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
/>
</com.android.systemui.statusbar.SignalClusterView>

Super_status_bar.xmlQs_panel.xmlStatus_bar_notification_row.xml

Icu4c 简介:
位置:\external\icu\icu4c\source\data\locales

CU4C是ICU在C/C++平台下的版本, ICU(International Component for Unicode)是基于”IBM公共许可证”的,与开源组织合作研究的, 用于支持软件国际化的开源项目。ICU4C提供了C/C++平台强大的国际化开发能力,软件开发者几乎可以使用ICU4C解决任何国际化的问题,根据各地的风俗和语言习惯,实现对数字、货币、时间、日期、和消息的格式化、解析,对字符串进行大小写转换、整理、搜索和排序等功能,必须一提的是,ICU4C提供了强大的BIDI算法,对阿拉伯语等BIDI语言提供了完善的支持。

Quick_status_bar_expanded_header.xml

这是绿色部分的布局,详细查看布局文件,我们可以发现


设置图标

时间控件

快捷图标控件(后边需要详细总结)
在qs_panel.xml 中

这就是主图中 土黄色部分
进入QsPanel.java 文件中

亮度调节控件

天蓝色edit按钮的绑定以及单击事件的绑定及实现
然后看一下 showEdit() 方法:

开启了一个新的线程,然后调用了 mCustomizePanel.show(x, y);继续找方法
QSCustomizer.java
乍一看,不是太明白

public void show(int x, int y) {
if (!isShown) {
MetricsLogger.visible(getContext(), MetricsProto.MetricsEvent.QS_EDIT);
isShown = true;
setLavaCustomizing(true);
SetTileSpecs();
mQsContainer.notifyCustomzieChangerdForLava(true/*isCustomizing*/);
setVisibility(View.VISIBLE);
mClipper.animateCircularClip(x, y, true, mExpandAnimationListener);
new TileQueryHelper(mContext, mHost).setListener(mTileAdapter);
mNotifQsContainer.setCustomizerAnimating(true);
mNotifQsContainer.setCustomizerShowing(true);
announceForAccessibility(mContext.getString(
R.string.accessibility_desc_quick_settings_edit));
mHost.getKeyguardMonitor().addCallback(mKeyguardCallback);
}
}

详细看一下 QSCustomizer.java
public class QSCustomizer extends LinearLayout implements OnMenuItemClickListener
是个自定义布局的样子,父控件是一个 LinearLayout
全局搜索 inflate (加载布局) 关键字

LayoutInflater.from(getContext()).inflate(R.layout.qs_customize_panel_content, this);

看一下 qs_customize_panel_content.xml 布局文件

<merge xmlns:android="http://schemas.android.com/apk/res/android"><Toolbar
android:id="@*android:id/action_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="28dp"
android:navigationContentDescription="@*android:string/action_bar_up_description"
style="?android:attr/toolbarStyle"/><android.support.v7.widget.RecyclerView
android:id="@android:id/list"
android:layout_width="@dimen/notification_panel_width"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#6CE8E0"
android:scrollIndicators="top"
android:scrollbars="vertical"
android:importantForAccessibility="no"/><View
android:id="@+id/nav_bar_background"
android:layout_width="match_parent"
android:layout_height="@dimen/navigation_bar_size"
android:layout_gravity="bottom"
android:background="#ff000000"/>
</merge>


原来是 RecyclerView

接下来,看一下通知的布局文件。
/frameworks/base/core/res/res/layout

来个布局截图

然后在看一下布局文件 notification_template_material_base.xml

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/status_bar_latest_event_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FF00F7"
android:tag="base"
>
①<include layout="@layout/notification_template_header"/>
<LinearLayout
android:id="@+id/notification_main_column"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_marginStart="@dimen/notification_content_margin_start"
android:layout_marginEnd="@dimen/notification_content_margin_end"
android:layout_marginTop="@dimen/notification_content_margin_top"
android:layout_marginBottom="@dimen/notification_content_margin_bottom"
android:orientation="vertical"
>
②<include layout="@layout/notification_template_part_line1"/>
③<include layout="@layout/notification_template_text"/>
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginStart="@dimen/notification_content_margin_start"
android:layout_marginBottom="15dp"
android:layout_marginEnd="@dimen/notification_content_margin_end">
④ <include layout="@layout/notification_template_progress"/>
</FrameLayout>
⑤ <include layout="@layout/notification_template_right_icon"/>
</FrameLayout>

SystemUI 布局相关推荐

  1. Android 系统(58)---Android 系统 UI - SystemUI之功能介绍和UI布局实现

    Android 系统 UI - SystemUI之功能介绍和UI布局实现 前言 Android ROM开发过程中,难免会涉及到对SystemUI的修改,之前做过一些这方面的工作,现在整理下,准备按照如 ...

  2. Android P SystemUI之StatusBar UI布局status_bar.xml解析

    相关源码: \frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\phone\CollapsedStatusBar ...

  3. 9.0自定义SystemUI下拉状态栏和通知栏视图(十七)之自定义通知布局构建

    1.前言 在进行9.0的rom产品定制化开发中,在9.0中针对systemui下拉状态栏和通知栏的定制UI的工作开发中,原生系统的下拉状态栏和通知栏的视图UI在产品开发中会不太满足功能, 所以根据产品 ...

  4. 10.0 自定义SystemUI下拉状态栏和通知栏视图(八)之锁屏通知布局

    1.前言 在进行10.0的系统rom产品定制化开发中,在10.0中针对systemui下拉状态栏和通知栏的定制UI的工作开发中,原生系统的下拉状态栏和通知栏的视图UI在产品开发中会不太满足功能, 所以 ...

  5. 12.0 自定义SystemUI下拉状态栏和通知栏视图(二十)之锁屏通知布局

    1.前言 在进行12.0的系统rom产品定制化开发中,在12.0中针对systemui下拉状态栏和通知栏的定制UI的工作开发中,原生系统的下拉状态栏和通知栏的视图UI在产品开发中会不太满足功能, 所以 ...

  6. Android 系统 UI - SystemUI之功能介绍和UI布局实现

    前言 Android ROM开发过程中,难免会涉及到对SystemUI的修改,之前做过一些这方面的工作,现在整理下,准备按照如下章节介绍SystemUI.借此对SystemUI做下整体性回顾.  -S ...

  7. android systemui ime_switcher布局冲突

    diff --git a/frameworks/base/packages/SystemUI/res/layout/menu_ime.xml b/frameworks/base/packages/Sy ...

  8. 自定义View:测量measure,布局layout,绘制draw

    1. 什么是View 在Android的官方文档中是这样描述的:表示了用户界面的基本构建模块.一个View占用了屏幕上的一个矩形区域并且负责界面绘制和事件处理. 手机屏幕上所有看得见摸得着的都是Vie ...

  9. Android 7.0 SystemUI 之启动和状态栏和导航栏简介

    Android 7.0 SystemUI 之启动和状态栏和导航栏简介 一.SystemUI 是什么 首先SystemUI 是一个系统应用,apk路径位于/system/priv-app 源码路径位于: ...

最新文章

  1. 曲线学习PyQt5方案一
  2. 结对开发----找出“水王
  3. parted命令详解
  4. 中国移动如何开具并下载打印电子发票?
  5. Geoserver怎样设置地图shp文件为相对路径,可轻松复制移植
  6. mac mail 删除邮件服务器,如何从Mac OS X中的邮件中删除所有电子邮件 | MOS86
  7. UNIX环境高级编程之第10章:信号
  8. python查看系统句柄数量_查看Linux某个进程打开的文件句柄(file descriptor)数量...
  9. C++ 从零单排(2)-基础知识二
  10. 信息安全原理与技术第七次实验:木马攻击与防范
  11. 软件测试(三)--标准的测试用例模板
  12. 通信原理 AMI码和HDB3码的编码方式
  13. 完成知乎项目的登录和注册功能(一)
  14. 用vs code 搭建stm32 开发环境(详细)
  15. ListView 设置 scrollbars 之后出现的细线白边的解决方法
  16. 天津大学计算机软件技术基础试题答案,天津大学网络学院计算机软件技术基础-1试题b卷.doc...
  17. MySQL数据库_(学生_教师_课程_成绩)表_练习
  18. erdas遥感图像几何校正_实验二 ERDAS遥感图像的几何校正
  19. LSF_安装(UNIX or Linux)
  20. Photoshop CC 2017 在Mac上安装报错解决办法

热门文章

  1. Matlab中的mod()函数
  2. 使用RMAN恢复备库
  3. Conky-colors详细教程
  4. 在html里怎么给表单加上边框,html如何给table表单加边框
  5. 后台打log(便于查看问题和调试)方法
  6. 安装mysql报msvcr100_解决安装mysql 提示msvcr100.dill 丢失,的最快方法
  7. ubuntu18.0安装搜狗输入法无法显示中文
  8. github followers-following相互比较
  9. 第二期金牌网管师100%就业培训班招生简章
  10. html是什么意思网络用语,网络用语内涵是什么意思