我是靠谱客的博主 迅速便当,这篇文章主要介绍Android 12 MTK SystemUI 定制化开发系列(3) 之 status_bar.xml详解文章目录前言一、status_bar.xml 路径二、status_bar.xml 布局详解总结,现在分享给大家,希望可以做个参考。
文章目录
- 前言
- 一、status_bar.xml 路径
- 二、status_bar.xml 布局详解
- 总结
前言
把 status_bar.xml 单独用一期详解下, 这个布局嵌套很深,网上基本找不到详解这个布局的, 但这个布局 个人觉得很重要,对小白很有帮助或维护SystemUI的同僚多少都会有点帮助吧!
一、status_bar.xml 路径
复制代码
1vendor/mediatek/proprietary/packages/apps/SystemUI/res/layout/status_bar.xml
二、status_bar.xml 布局详解
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102<com.android.systemui.statusbar.phone.PhoneStatusBarView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:id="@+id/status_bar" android:layout_width="match_parent" android:layout_height="@dimen/status_bar_height" android:accessibilityPaneTitle="@string/status_bar" android:descendantFocusability="afterDescendants" android:focusable="false" android:orientation="vertical"> <!-- 如果存在活跃通知并且Flag为STEM_UI_FLAG_LOW_PROFILE情况下 会显示一个点,全屏提示当前存在的通知--> <ImageView android:id="@+id/notification_lights_out" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="match_parent" android:paddingStart="@dimen/status_bar_padding_start" android:paddingBottom="2dip" android:scaleType="center" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:visibility="gone" /> <LinearLayout android:id="@+id/status_bar_contents" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:paddingStart="@dimen/status_bar_padding_start" android:paddingTop="@dimen/status_bar_padding_top" android:paddingEnd="@dimen/status_bar_padding_end"> <FrameLayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1"> <!-- 悬浮式通知 --> <include layout="@layout/heads_up_status_bar_layout" /> <!-- 左侧的alpha由PhoneStatusBarTransitions控制,各个视图由StatusBarManager禁用标志disable_CLOCK 和分别为DISABLE_NOTIFICATION_ICONS --> <LinearLayout android:id="@+id/status_bar_left_side" android:layout_width="match_parent" android:layout_height="match_parent" android:clipChildren="false"> <!-- 状态栏显示运营商信息,需设置 config_showOperatorNameInStatusBar为true --> <ViewStub android:id="@+id/operator_name" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout="@layout/operator_name" /> <!-- 时钟图标 --> <com.android.systemui.statusbar.policy.Clock android:id="@+id/clock" android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical|start" android:paddingStart="@dimen/status_bar_left_clock_starting_padding" android:paddingEnd="@dimen/status_bar_left_clock_end_padding" android:singleLine="true" android:textAppearance="@style/TextAppearance.StatusBar.Clock" /> <!-- 录音机图标 --> <include layout="@layout/ongoing_call_chip" /> <!-- 通知图标区域 --> <com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:id="@+id/notification_icon_area" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:clipChildren="false" android:orientation="horizontal" /> </LinearLayout> </FrameLayout> <!-- 如果是刘海屏,会在updateLayoutForCutout方法里设置区域范围--> <android.widget.Space android:id="@+id/cutout_space_view" android:layout_width="0dp" android:layout_height="match_parent" android:gravity="center_horizontal|center_vertical" /> <com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:id="@+id/centered_icon_area" android:layout_width="wrap_content" android:layout_height="match_parent" android:clipChildren="false" android:gravity="center_horizontal|center_vertical" android:orientation="horizontal" /> <!-- 系统图标区域,主要包含了system_icon.xml 注:状态跟锁屏都是复用此布局--> <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@+id/system_icon_area" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:gravity="center_vertical|end" android:orientation="horizontal"> <include layout="@layout/system_icons" /> </com.android.keyguard.AlphaOptimizedLinearLayout> </LinearLayout> <!-- 显示界面信息 --> <ViewStub android:id="@+id/emergency_cryptkeeper_text" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout="@layout/emergency_cryptkeeper_text" /> </com.android.systemui.statusbar.phone.PhoneStatusBarView>
总结
关键的布局都标注了,方便大家初步了解这个布局结构!
最后
以上就是迅速便当最近收集整理的关于Android 12 MTK SystemUI 定制化开发系列(3) 之 status_bar.xml详解文章目录前言一、status_bar.xml 路径二、status_bar.xml 布局详解总结的全部内容,更多相关Android内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复