android9 SystemUI customization 1-basic layout relationship

1.super_status_bar.xml

<com.android.systemui.statusbar.phone.StatusBarWindowView>
	<com.android.systemui.statusbar.BackDropView>
		<ImageView android:id="@+id/backdrop_back"/>
		<ImageView android:id="@+id/backdrop_front"/>
	</com.android.systemui.statusbar.BackDropView>
	//statusBar下拉时显示的背景蒙板(灰色透明)
	<com.android.systemui.statusbar.ScrimView
		android:id="@+id/scrim_behind"/>
    //状态栏布局(statusBar未下拉的状态栏)
	<FrameLayout
      android:id="@+id/status_bar_container"/>
	<ViewStub android:id="@+id/fullscreen_user_switcher_stub"/>
	//statusBar下拉菜单对应的总布局
	<include layout="@layout/status_bar_expanded"/>
	//亮度控制条
	<include layout="@layout/brightness_mirror" />
	//statusBar下拉时显示的前景蒙板<com.android.systemui.statusbar.ScrimView
    android:id="@+id/scrim_in_front"/>
</com.android.systemui.statusbar.phone.StatusBarWindowView>

status_bar_container: The layout when the status bar is not expanded, corresponding to the wireframe in the figure below:
insert image description here
ScrimView background mask, displayed when the status bar is expanded:
insert image description here

@layout/brightness_mirror brightness control bar:
insert image description here

2.status_bar_expanded.xml:

Contains quick setting panel container layout, notification bar container layout and lock screen related container layout.

<com.android.systemui.statusbar.phone.NotificationPanelView
   //锁屏时的状态栏
   <include
     layout="@layout/keyguard_status_view"
     android:visibility="gone" />
   //快捷设置面板及通知栏的包裹容器
   <com.xxx.NotificationsQuickSettingsContainer>
      //快捷设置面板布局
      <FrameLayout
       android:id="@+id/qs_frame"
       android:layout="@layout/qs_panel"/>
      //通知栏布局
      <NotificationStackScrollLayout
       android:id="@+id/notification_stack_scroller"/>
      //?
      <include layout="@layout/ambient_indication"
        android:id="@+id/ambient_indication_container" />
      //?
      <ViewStub
       android:id="@+id/keyguard_user_switcher"
       android:layout="@layout/keyguard_user_switcher"/>
      //
      <include
        layout="@layout/keyguard_status_bar"
        android:visibility="invisible" />
      <Button
        android:id="@+id/report_rejected_touch"
        android:visibility="gone" />
   </com.xxx.NotificationsQuickSettingsContainer>
   <include
      layout="@layout/keyguard_bottom_area"
      android:visibility="gone" />
   <com.android.systemui.statusbar.AlphaOptimizedView
    android:id="@+id/qs_navbar_scrim" />
</com.android.systemui.statusbar.phone.NotificationPanelView>

3.qs_panel.xml: quick panel

 <com.android.systemui.qs.QSContainerImpl
    //qs面板主要部分背景,控制图中2处的背景
    <View android:id="@+id/quick_settings_background"/>
    //qs面板底部,对应图中4
    <include layout="@layout/qs_footer_impl" />
    //qs面板展开时的statusBar背景 ,控制图中1处的背景
    <View android:id="@+id/quick_settings_status_bar_background"/>
    //
	<View android:id="@+id/quick_settings_gradient_view"/>
	//qs快捷设置,继承线性布局,二级展开部分,对应图中3
	<com.android.systemui.qs.QSPanel/>
	//header,快捷面板一展开首先显示的主要部分
	<include layout="@layout/quick_status_bar_expanded_header" />
	//长按设置按钮(每个单一item)显示的页面:快捷设置详情
	<include android:id="@+id/qs_detail"
	 layout="@layout/qs_detail" />
	//
	<include
        android:id="@+id/qs_customize"
        layout="@layout/qs_customize_panel"
        android:visibility="gone" />
</com.android.systemui.qs.QSContainerImpl>

The layout correspondence is shown in the fully expanded qs diagram:
qs fully expanded diagram

4.quick_status_bar_expanded_header.xml:

The header displayed when the qs panel is not fully expanded

<com.android.systemui.qs.QuickStatusBarHeader
	//面板展开时的statusBar(完全、未完全展开都是这个),
	//包含了时间文字和电量的显示,对应下图1
	<include layout="@layout/quick_status_bar_header_system_icons"/>
	//包含日期、手机状态icon(如wifi、信号图标),对应下图2
	<include layout="@layout/quick_qs_status_icons"/>
	//包含工具提示、报警文本等的布局,图中未显示
	<include layout="@layout/quick_settings_header_info" />
	//快捷设置的缩略部分,对应图中3
	<com.android.systemui.qs.QuickQSPanel/>
	//
	<com.android.systemui.statusbar.AlphaOptimizedImageView/>
	//
	<TextView android:id="@+id/header_debug_info"/>
</com.android.systemui.qs.QuickStatusBarHeader>

The corresponding area is shown in the folding diagram of the qs panel:
qs panel folding chart
The display area of ​​QuickStatusBarHeader is shown in the thick line box in the figure. Note that there are 3 places and 3 places in the fully expanded picture. There are quick setting buttons in both places, but the corresponding layouts are different. Expand The last 3 places correspond to QSPanel, and the 3 here correspond to QuickQSPanel, which is a subclass of QSPanel. QuickQSPanel displays one row by default, and QSPanel can control the number of columns and the number of each row displayed, both of which have no effect.

Next Preliminary Revision

Guess you like

Origin blog.csdn.net/weixin_40652755/article/details/122835655