【Android系统源码修改】如何分析SystemUI Layout 的组成

本文详细探讨了Android SystemUI中StatusBar的构成,包括StatusBarWindowView作为根布局,BackDropView,ScrimView的作用,特别是ScrimView在下拉状态时的背景变化。接着分析了PanelHolder在通知栏布局中的位置,以及通知栏下拉后的布局文件status_bar_expanded.xml,其中NotificationStackScrollLayout作为通知列表容器,ObservableScrollView则包含快捷按键布局。此外,还讲解了下拉通知栏头部布局的调整以及亮度调节布局brightness_mirror。
摘要由CSDN通过智能技术生成

StatusBar

从相关的布局文件xml中可以找到状态栏主要的Layout:

  • 1 StatusBarWindowView是状态栏根布局
  • 2 BackDropView
  • 3 ScrimView是状态栏下拉后,背景,半透明灰色
  • 4 status_bar状态栏的布局
  • 5 PanelHolder,下拉通知栏布局
<com.android.systemui.statusbar.phone.StatusBarWindowView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">
    <com.android.systemui.statusbar.BackDropView
            android:id="@+id/backdrop"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="gone"
            >
        <ImageView android:id="@+id/backdrop_back"
                   android:layout_width="match_parent"
                   android:scaleType="centerCrop"
                   android:layout_height="match_parent" />
        <ImageView android:id="@+id/backdrop_front"
                   android:layout_width="match_parent"
                   android:layout_height="match_parent"
                   android:scaleType="centerCrop"
                   android:visibility="invisible" />
    </com.android.systemui.statusbar.BackDropView>
    <com.android.systemui.statusbar.ScrimView
        android:id="@+id/scrim_behind"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:importantForAccessibility="no" />
    <include layout="@layout/status_bar"
        android:layout_width="match_parent"
        android:layout_height="@dimen/status_bar_height" />
    <FrameLayout android:id="@+id/brightness_mirror"
                 android:layout_width="@dimen/notification_panel_width"
                 android:layout_height="wrap_content"
                 android:layo
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Bright_Lin

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值