Android 7.0 SystemUI 状态栏左侧应用图标显示控制流程
2017-05-18 14:18
766 查看
SystemUI 状态栏左侧应用图标如下图所示:
![](https://img-blog.csdn.net/20170518140419906?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdGpfc2hlbnpoZW5kYXh1ZQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
状态栏StatusBar显示分为三个区域,分别是左侧应用图标显示区域(USB图标,下载图标,截屏图标),中右侧系统图标显示(Wifi 蓝牙 信号栏图标显示)和最右侧电池电量及时间显示区域,本次重点讲述左侧应用图标显示控制流程:
PhoneStatusBar.java:
makeStatusBarView()-->createIconController()
protected void createIconController() {
mIconController = new StatusBarIconController(
mContext, mStatusBarView, mKeyguardStatusBar, this);
}
StatusBarIconController.java:
mNotificationIconAreaController = SystemUIFactory.getInstance()
.createNotificationIconAreaController(context, phoneStatusBar);
mNotificationIconAreaInner =
mNotificationIconAreaController.getNotificationInnerAreaView();
NotificationIconAreaController.java
/**
* Returns the view that represents the notification area.
*/
public View getNotificationInnerAreaView() {
return mNotificationIconArea;
}
mNotificationIconArea实际是notification_icon_area.xml layout布局文件
**/
ViewGroup notificationIconArea =
(ViewGroup) statusBar.findViewById(R.id.notification_icon_area);
notificationIconArea是status_bar.xml layout 布局文件中的一个组件:
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout
android:id="@+id/notification_icon_area"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal" />
notificationIconArea.addView(mNotificationIconAreaInner);
所有第三方应用发送的通知图标都会添加在notificationIconArea中显示:
NotificationIconAreaController.java:
/**
* Updates the notifications with the given list of notifications to display.
*/
public void updateNotificationIcons(NotificationData notificationData) {
....
ArrayList<StatusBarIconView> toShow = new ArrayList<>(size);
....
ArrayList<View> toRemove = new ArrayList<>();
....
}
以上方法中会包含本次刷新需要显示或者移除的状态栏应用通知小图标。
状态栏StatusBar显示分为三个区域,分别是左侧应用图标显示区域(USB图标,下载图标,截屏图标),中右侧系统图标显示(Wifi 蓝牙 信号栏图标显示)和最右侧电池电量及时间显示区域,本次重点讲述左侧应用图标显示控制流程:
PhoneStatusBar.java:
makeStatusBarView()-->createIconController()
protected void createIconController() {
mIconController = new StatusBarIconController(
mContext, mStatusBarView, mKeyguardStatusBar, this);
}
StatusBarIconController.java:
mNotificationIconAreaController = SystemUIFactory.getInstance()
.createNotificationIconAreaController(context, phoneStatusBar);
mNotificationIconAreaInner =
mNotificationIconAreaController.getNotificationInnerAreaView();
NotificationIconAreaController.java
/**
* Returns the view that represents the notification area.
*/
public View getNotificationInnerAreaView() {
return mNotificationIconArea;
}
mNotificationIconArea实际是notification_icon_area.xml layout布局文件
**/
ViewGroup notificationIconArea =
(ViewGroup) statusBar.findViewById(R.id.notification_icon_area);
notificationIconArea是status_bar.xml layout 布局文件中的一个组件:
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout
android:id="@+id/notification_icon_area"
android:layout_width="0dip"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal" />
notificationIconArea.addView(mNotificationIconAreaInner);
所有第三方应用发送的通知图标都会添加在notificationIconArea中显示:
NotificationIconAreaController.java:
/**
* Updates the notifications with the given list of notifications to display.
*/
public void updateNotificationIcons(NotificationData notificationData) {
....
ArrayList<StatusBarIconView> toShow = new ArrayList<>(size);
....
ArrayList<View> toRemove = new ArrayList<>();
....
}
以上方法中会包含本次刷新需要显示或者移除的状态栏应用通知小图标。
相关文章推荐
- Android系统应用---SystemUI之二:Statusbar显示流程以及系统状态图标更新分析
- Android应用图标在状态栏上显示,以及显示不同的图标
- Android应用图标在状态栏上显示实现原理
- Android Launcher3安装应用后,控制应用图标显示位置
- Android 5.0 状态栏(SystemUI)系统图标加载流程简单分析
- Android应用图标在状态栏上显示,以及显示不同的图标
- Android Launcher3安装应用后,控制应用图标显示位置(显示在第一页上,默认是第二页)
- Android系统状态栏的信号图标显示流程简介
- Android Wi-Fi StatusBar(状态栏)流量上下行图标显示流程
- Android - 安装应用(APP) 不显示图标
- android-显示SoundRecorder应用图标于桌面
- Android在应用的标题栏上显示请求旋转图标
- Android状态栏显示电池状态代码流程分析
- Android程序安装后应用图标不显示
- Android程序安装后应用图标不显示
- Android APP安装后不在桌面显示图标的应用场景举例和实现方法
- android 状态栏 导航栏隐藏显示控制方法及效果示例
- android 应用图标放在状态栏上之NotificationManager和Notification的使用总结
- Android--状态栏的图标和文字提醒/NotificationManager与Notification对象的应用