Source code analysis of SystemUI

24. Analysis of SystemUI source code of S700 platform:
(1) SystemUI source code structure: 
keyguard/ ---> Contact between SystemUI and Keyguard
qs/ ---> Quick Settings related processing
recents/ ---> Processing recently opened application
statusbar /phone ---> Control notification display and status of keyguard (2) The interface corresponding to the main function points: Status Bar ---> The top of the screen displays wifi, signal strength and other areas Notification ---> Drop-down menu area Navigation Bar - --> Virtual key area at the bottom of the screen  (3) Loading process of SystemUI view: The root view of SystemUI is loaded in the makeStatusBarView() method of PhoneStatusBar, which is the following line of code mStatusBarWindow = (StatusBarWindowView) View.inflate(context, R.layout.super_status_bar, null); It can be seen that R.layout.super_status_bar is the root view of SystemUI, and the location of the super_status_bar.xml layout file is in the android\frameworks\base\packages\SystemUI\res\layout\ directory. The layout mainly looks at three pieces, first look at the first piece









<includ layout="@layout/status_bar", include the status_bar through the include tag. The status_bar corresponds to the PhoneStatusBarView class, which is the top display area of ​​the phone screen; why does the status_bar correspond to the PhoneStatusBarView class? Because the first tag of the status_bar layout file is PhoneStatusBarView is a custom control class, the status_bar is located in the android\frameworks\base\packages\SystemUI\res\layout\ directory, and the PhoneStatusBarView class is in adroid\frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\phone \ directory, this class is mainly used to display system status, notifications, etc., mainly including notification icons and status bar icons;

Look at the second block <com.android.systemui.statusbar.phone.PanelHolder, this is a container, a custom View that inherits FrameLayout, which includes the status_bar_expanded layout file through the include tag, corresponding to the PanelHolder class, which is a pull-down display View, which mainly includes QuickSettings and Notification Panel; let's take a look at the status_bar_expanded.xml layout file, this layout file mainly contains three parts, the top is similar to the status bar partial view, corresponding to the status_bar_expanded_header.xml file, corresponding to the StatusBarHeaderView class; the middle It is a quick setting partial view, corresponding to the ObservableScrollView class whose id is @+id/scroll_view in the status_bar_expanded.xml layout file; the bottom is the message notification partial view, corresponding to the NotificationStackScrollLayout whose id in the status_bar_expanded.xml layout file is @+id/notification_stack_scroller Class; finally, look at the third keyguard_bouncer, it is not directly added to the layout layout, it is only visible after the user sets the lock screen protection, corresponding to the KeyguardBouncer.java class, no record analysis UI layout file hierarchy super_status_bar.xml is included status_bar.xml, also contains status_bar_expanded.xml, status_bar_expanded.xml contains status_bar_expanded_header.xml

Note: The above source code is the SystemUI source code of the Android 5.1.1 system

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326059730&siteId=291194637