SystemUI Android P预研
2018-08-30 本文已影响638人
Monster_de47
Statusbar
Stutsbar将时间移到左侧,信号注网状态单独显示。

相关代码类:
- frameworks/base/packages/SystemUI/res/layout/status_bar.xml
- com/android/systemui/statusbar/SignalClusterView.java
下拉通知栏快捷功能去除二级菜单:


NavigationBar
引入了新的导航栏风格,只保留back键和home键,通过手势滑动进入recents界面。
在NaigationBarFragment中onViewCreated时注册mOverviewProxyListener监听,该监听负责更新导航栏布局以及控制back键显示以及动画效果:
private final OverviewProxyListener mOverviewProxyListener = new OverviewProxyListener() {
@Override
public void onConnectionChanged(boolean isConnected) {
mNavigationBarView.updateStates();
updateScreenPinningGestures();
}
@Override
public void onQuickStepStarted() {
// Use navbar dragging as a signal to hide the rotate button
setRotateSuggestionButtonState(false);
}
@Override
public void onInteractionFlagsChanged(@InteractionType int flags) {
mNavigationBarView.updateStates();
updateScreenPinningGestures();
}
@Override
public void onBackButtonAlphaChanged(float alpha, boolean animate) {
final ButtonDispatcher backButton = mNavigationBarView.getBackButton();
backButton.setVisibility(alpha > 0 ? View.VISIBLE : View.INVISIBLE);
backButton.setAlpha(alpha, animate);
}
};
相关代码类:
- com/android/systemui/statusbar/phone/NavigationBarFragment.java
- com/android/systemui/statusbar/phone/NavigationBarView.java
- com/android/systemui/statusbar/phone/QuickStepController.java
- com/android/systemui/OverviewProxyService.java
Recents
recents在9.0中SystemUI原生自带,并且可以使用Launcher的Recents功能。在Recents.java中判断启动哪个模块的Recent界面
相关代码类:
- com/android/systemui/statusbar/phone/NavigationBarFragment.java
- com/android/systemui/recents/Recents.java
Notification
Notification在9.0中Headsup通知出现在statusbar下方,并且状态栏左侧会显示:

相关代码类:
- com/android/systemui/statusbar/HeadsUpStatusBarView.java
- com/android/systemui/statusbar/phone/HeadsUpManagerPhone.java
- com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java