Loading packages/CarSystemUI/src/com/android/systemui/notifications/NotificationsUI.java +12 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.SystemUI; import com.android.systemui.statusbar.FlingAnimationUtils; import com.android.systemui.statusbar.car.CarStatusBar; import com.android.systemui.statusbar.policy.ConfigurationController; /** Loading Loading @@ -90,6 +91,7 @@ public class NotificationsUI extends SystemUI private FlingAnimationUtils mFlingAnimationUtils; private static int sSettleOpenPercentage; private static int sSettleClosePercentage; private CarStatusBar mCarStatusBar; /** * Inits the window that hosts the notifications and establishes the connections Loading Loading @@ -230,6 +232,10 @@ public class NotificationsUI extends SystemUI inflateNotificationContent(); } public void setStatusBar(CarStatusBar carStatusBar) { mCarStatusBar = carStatusBar; } public View.OnTouchListener getDragDownListener() { return mOnTouchListener; } Loading Loading @@ -328,6 +334,9 @@ public class NotificationsUI extends SystemUI @Override public boolean onScroll(MotionEvent event1, MotionEvent event2, float distanceX, float distanceY) { if (mCarStatusBar == null || !mCarStatusBar.getIsUserSetup()) { return true; } boolean isDown = event1.getY() - event2.getY() < 0; // CarStatusBar and NavigationBar are identical so avoid the touch if it // starts from NavigationBar to open. Loading Loading @@ -442,6 +451,9 @@ public class NotificationsUI extends SystemUI * Sets the notifications to visible */ public void openCarNotifications(float velocityY) { if (mCarStatusBar == null || !mCarStatusBar.getIsUserSetup()) { return; } mCarNotificationWindow.setVisibility(View.VISIBLE); ValueAnimator animator = ValueAnimator.ofFloat(mContent.getTranslationY(), 0); Loading packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java +6 −0 Original line number Diff line number Diff line Loading @@ -262,6 +262,7 @@ public class CarStatusBar extends StatusBar implements topBar.setStatusBar(this); CarNavigationBarView qsTopBar = mStatusBarWindow.findViewById(R.id.qs_car_top_bar); qsTopBar.setStatusBar(this); getComponent(NotificationsUI.class).setStatusBar(this); } @Override Loading Loading @@ -614,6 +615,11 @@ public class CarStatusBar extends StatusBar implements return mContext.getDrawable(com.android.internal.R.drawable.default_wallpaper); } /** Returns true if the current user makes it through the setup wizard, false otherwise. */ public boolean getIsUserSetup(){ return mUserSetup; } public void toggleCarNotifications() { getComponent(NotificationsUI.class).toggleShowingCarNotifications(); } Loading Loading
packages/CarSystemUI/src/com/android/systemui/notifications/NotificationsUI.java +12 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.SystemUI; import com.android.systemui.statusbar.FlingAnimationUtils; import com.android.systemui.statusbar.car.CarStatusBar; import com.android.systemui.statusbar.policy.ConfigurationController; /** Loading Loading @@ -90,6 +91,7 @@ public class NotificationsUI extends SystemUI private FlingAnimationUtils mFlingAnimationUtils; private static int sSettleOpenPercentage; private static int sSettleClosePercentage; private CarStatusBar mCarStatusBar; /** * Inits the window that hosts the notifications and establishes the connections Loading Loading @@ -230,6 +232,10 @@ public class NotificationsUI extends SystemUI inflateNotificationContent(); } public void setStatusBar(CarStatusBar carStatusBar) { mCarStatusBar = carStatusBar; } public View.OnTouchListener getDragDownListener() { return mOnTouchListener; } Loading Loading @@ -328,6 +334,9 @@ public class NotificationsUI extends SystemUI @Override public boolean onScroll(MotionEvent event1, MotionEvent event2, float distanceX, float distanceY) { if (mCarStatusBar == null || !mCarStatusBar.getIsUserSetup()) { return true; } boolean isDown = event1.getY() - event2.getY() < 0; // CarStatusBar and NavigationBar are identical so avoid the touch if it // starts from NavigationBar to open. Loading Loading @@ -442,6 +451,9 @@ public class NotificationsUI extends SystemUI * Sets the notifications to visible */ public void openCarNotifications(float velocityY) { if (mCarStatusBar == null || !mCarStatusBar.getIsUserSetup()) { return; } mCarNotificationWindow.setVisibility(View.VISIBLE); ValueAnimator animator = ValueAnimator.ofFloat(mContent.getTranslationY(), 0); Loading
packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java +6 −0 Original line number Diff line number Diff line Loading @@ -262,6 +262,7 @@ public class CarStatusBar extends StatusBar implements topBar.setStatusBar(this); CarNavigationBarView qsTopBar = mStatusBarWindow.findViewById(R.id.qs_car_top_bar); qsTopBar.setStatusBar(this); getComponent(NotificationsUI.class).setStatusBar(this); } @Override Loading Loading @@ -614,6 +615,11 @@ public class CarStatusBar extends StatusBar implements return mContext.getDrawable(com.android.internal.R.drawable.default_wallpaper); } /** Returns true if the current user makes it through the setup wizard, false otherwise. */ public boolean getIsUserSetup(){ return mUserSetup; } public void toggleCarNotifications() { getComponent(NotificationsUI.class).toggleShowingCarNotifications(); } Loading