SystemUI

packages/SystemUI/res-keyguard/layout/keyguard_host_view.xml

packages/SystemUI/res-keyguard/layout/keyguard_bouncer.xml

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/transparent"
    android:clipChildren="false"
    android:clipToPadding="false">

    <include
        layout="@layout/keyguard_host_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
</FrameLayout>

com/android/keyguard/dagger/KeyguardBouncerModule.java

com/android/keyguard/dagger/KeyguardBouncerModule.java
    static ViewGroup providesRootView(LayoutInflater layoutInflater) {
        return (ViewGroup) layoutInflater.inflate(R.layout.keyguard_bouncer, null);
    }

packages/SystemUI/res/layout/super_status_bar.xml

<com.android.systemui.statusbar.phone.StatusBarWindowView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:sysui="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <FrameLayout
        android:id="@+id/status_bar_launch_animation_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

<!--    -->
    <FrameLayout
        android:id="@+id/status_bar_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/system_bar_background" />
</com.android.systemui.statusbar.phone.StatusBarWindowView>

status_bar_container部分如下

NotificationShadeWindowView 的加载

StatusBar.java

start--->createAndAddWindows

    public void createAndAddWindows(@Nullable RegisterStatusBarResult result) {
        makeStatusBarView(result); //1
        //这里的mNotificationShadeWindowController 是NotificationShadeWindowControllerImpl的实力对象
        mNotificationShadeWindowController.attach(); //2
        mStatusBarWindowController.attach();
    }

1,先执行makeStatusBarView-->inflateStatusBarWindow

    private void inflateStatusBarWindow() {
        mNotificationShadeWindowView = mSuperStatusBarViewFactory.getNotificationShadeWindowView();
        //将加载的mNotificationShadeWindowView赋值给NotificationShadeWindowControllerImpl
        mNotificationShadeWindowController.setNotificationShadeView(mNotificationShadeWindowView);

    }
    public NotificationShadeWindowView getNotificationShadeWindowView() {
        if (mNotificationShadeWindowView != null) {
            return mNotificationShadeWindowView;
        }
        //加载布局
        mNotificationShadeWindowView = (NotificationShadeWindowView)
                mInjectionInflationController.injectable(
                LayoutInflater.from(mContext)).inflate(R.layout.super_notification_shade,
                /* root= */ null);
        if (mNotificationShadeWindowView == null) {
            throw new IllegalStateException(
                    "R.layout.super_notification_shade could not be properly inflated");
        }

        return mNotificationShadeWindowView;
    }

2,执行完makeStatusBarView后在看createAndAddWindows中2处

 mNotificationShadeWindowController.attach();

执行的是NotificationShadeWindowControllerImpl的attach方法

就是往mWindowManager中添加第1步中加载的super_notification_shade布局

即NotificationShadeWindowView

    public void attach() {
        mWindowManager.addView(mNotificationShadeView, mLp);

    }
    public void setNotificationShadeView(ViewGroup view) {
        mNotificationShadeView = view;
    }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值