Loading packages/CarSystemUI/res/drawable/car_ic_notification_selected_unseen.xml +2 −1 Original line number Diff line number Diff line Loading @@ -31,3 +31,4 @@ android:pathData="M 6 0 C 9.31370849898 0 12 2.68629150102 12 6 C 12 9.31370849898 9.31370849898 12 6 12 C 2.68629150102 12 0 9.31370849898 0 6 C 0 2.68629150102 2.68629150102 0 6 0 Z" /> </group> </vector> packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarNavigationBarView.java +14 −4 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ import com.android.systemui.statusbar.phone.StatusBarIconController; */ class CarNavigationBarView extends LinearLayout { private View mNavButtons; private View mNotificationsButton; private CarNavigationButton mNotificationsButton; private CarStatusBar mCarStatusBar; private Context mContext; private View mLockScreenButtons; Loading Loading @@ -151,10 +151,20 @@ class CarNavigationBarView extends LinearLayout { * Nav buttons will be shown. */ public void hideKeyguardButtons() { if (mLockScreenButtons == null) { return; } if (mLockScreenButtons == null) return; mNavButtons.setVisibility(View.VISIBLE); mLockScreenButtons.setVisibility(View.GONE); } /** * Toggles the notification unseen indicator on/off. * * @param hasUnseen true if the unseen notification count is great than 0. */ void toggleNotificationUnseenIndicator(Boolean hasUnseen) { if (mNotificationsButton == null) return; mNotificationsButton.setUnseen(hasUnseen); } } packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarNavigationButton.java +33 −4 Original line number Diff line number Diff line Loading @@ -34,12 +34,17 @@ import java.net.URISyntaxException; * code. */ public class CarNavigationButton extends com.android.keyguard.AlphaOptimizedImageButton { private static final String TAG = "CarNavigationButton"; private static final int UNSEEN_ICON_RESOURCE_ID = R.drawable.car_ic_notification_unseen; private static final int UNSEEN_SELECTED_ICON_RESOURCE_ID = R.drawable.car_ic_notification_selected_unseen; private Context mContext; private String mIntent; private String mLongIntent; private boolean mBroadcastIntent; private boolean mHasUnseen = false; private boolean mSelected = false; private float mSelectedAlpha = 1f; private float mUnselectedAlpha = 1f; Loading @@ -50,6 +55,8 @@ public class CarNavigationButton extends com.android.keyguard.AlphaOptimizedImag public CarNavigationButton(Context context, AttributeSet attrs) { super(context, attrs); mContext = context; // CarNavigationButton attrs TypedArray typedArray = context.obtainStyledAttributes( attrs, R.styleable.CarNavigationButton); mIntent = typedArray.getString(R.styleable.CarNavigationButton_intent); Loading @@ -59,10 +66,15 @@ public class CarNavigationButton extends com.android.keyguard.AlphaOptimizedImag R.styleable.CarNavigationButton_selectedAlpha, mSelectedAlpha); mUnselectedAlpha = typedArray.getFloat( R.styleable.CarNavigationButton_unselectedAlpha, mUnselectedAlpha); mIconResourceId = typedArray.getResourceId( com.android.internal.R.styleable.ImageView_src, 0); mSelectedIconResourceId = typedArray.getResourceId( R.styleable.CarNavigationButton_selectedIcon, mIconResourceId); typedArray.recycle(); // ImageView attrs TypedArray a = context.obtainStyledAttributes( attrs, com.android.internal.R.styleable.ImageView); mIconResourceId = a.getResourceId(com.android.internal.R.styleable.ImageView_src, 0); a.recycle(); } Loading Loading @@ -119,6 +131,23 @@ public class CarNavigationButton extends com.android.keyguard.AlphaOptimizedImag super.setSelected(selected); mSelected = selected; setAlpha(mSelected ? mSelectedAlpha : mUnselectedAlpha); updateImage(); } /** * @param hasUnseen true if should indicate if this is a Unseen state, false otherwise. */ public void setUnseen(boolean hasUnseen) { mHasUnseen = hasUnseen; updateImage(); } private void updateImage() { if (mHasUnseen) { setImageResource(mSelected ? UNSEEN_SELECTED_ICON_RESOURCE_ID : UNSEEN_ICON_RESOURCE_ID); } else { setImageResource(mSelected ? mSelectedIconResourceId : mIconResourceId); } } } packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java +15 −4 Original line number Diff line number Diff line Loading @@ -311,7 +311,6 @@ public class CarStatusBar extends StatusBar implements return result; } @Override public void showKeyguard() { super.showKeyguard(); Loading Loading @@ -451,9 +450,21 @@ public class CarStatusBar extends StatusBar implements mNotificationDataManager = new NotificationDataManager(); mNotificationDataManager.setOnUnseenCountUpdateListener( () -> { // TODO: Update Notification Icon based on unseen count Log.d(TAG, "unseen count: " + mNotificationDataManager.getUnseenNotificationCount()); if (mNavigationBarView != null && mNotificationDataManager != null) { Boolean hasUnseen = mNotificationDataManager.getUnseenNotificationCount() > 0; if (mNavigationBarView != null) { mNavigationBarView.toggleNotificationUnseenIndicator(hasUnseen); } if (mLeftNavigationBarView != null) { mLeftNavigationBarView.toggleNotificationUnseenIndicator(hasUnseen); } if (mRightNavigationBarView != null) { mRightNavigationBarView.toggleNotificationUnseenIndicator(hasUnseen); } } }); CarHeadsUpNotificationManager carHeadsUpNotificationManager = Loading packages/CarSystemUI/res/drawable/car_ic_notification_unseen.xml +1 −1 File changed.Contains only whitespace changes. Show changes Loading
packages/CarSystemUI/res/drawable/car_ic_notification_selected_unseen.xml +2 −1 Original line number Diff line number Diff line Loading @@ -31,3 +31,4 @@ android:pathData="M 6 0 C 9.31370849898 0 12 2.68629150102 12 6 C 12 9.31370849898 9.31370849898 12 6 12 C 2.68629150102 12 0 9.31370849898 0 6 C 0 2.68629150102 2.68629150102 0 6 0 Z" /> </group> </vector>
packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarNavigationBarView.java +14 −4 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ import com.android.systemui.statusbar.phone.StatusBarIconController; */ class CarNavigationBarView extends LinearLayout { private View mNavButtons; private View mNotificationsButton; private CarNavigationButton mNotificationsButton; private CarStatusBar mCarStatusBar; private Context mContext; private View mLockScreenButtons; Loading Loading @@ -151,10 +151,20 @@ class CarNavigationBarView extends LinearLayout { * Nav buttons will be shown. */ public void hideKeyguardButtons() { if (mLockScreenButtons == null) { return; } if (mLockScreenButtons == null) return; mNavButtons.setVisibility(View.VISIBLE); mLockScreenButtons.setVisibility(View.GONE); } /** * Toggles the notification unseen indicator on/off. * * @param hasUnseen true if the unseen notification count is great than 0. */ void toggleNotificationUnseenIndicator(Boolean hasUnseen) { if (mNotificationsButton == null) return; mNotificationsButton.setUnseen(hasUnseen); } }
packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarNavigationButton.java +33 −4 Original line number Diff line number Diff line Loading @@ -34,12 +34,17 @@ import java.net.URISyntaxException; * code. */ public class CarNavigationButton extends com.android.keyguard.AlphaOptimizedImageButton { private static final String TAG = "CarNavigationButton"; private static final int UNSEEN_ICON_RESOURCE_ID = R.drawable.car_ic_notification_unseen; private static final int UNSEEN_SELECTED_ICON_RESOURCE_ID = R.drawable.car_ic_notification_selected_unseen; private Context mContext; private String mIntent; private String mLongIntent; private boolean mBroadcastIntent; private boolean mHasUnseen = false; private boolean mSelected = false; private float mSelectedAlpha = 1f; private float mUnselectedAlpha = 1f; Loading @@ -50,6 +55,8 @@ public class CarNavigationButton extends com.android.keyguard.AlphaOptimizedImag public CarNavigationButton(Context context, AttributeSet attrs) { super(context, attrs); mContext = context; // CarNavigationButton attrs TypedArray typedArray = context.obtainStyledAttributes( attrs, R.styleable.CarNavigationButton); mIntent = typedArray.getString(R.styleable.CarNavigationButton_intent); Loading @@ -59,10 +66,15 @@ public class CarNavigationButton extends com.android.keyguard.AlphaOptimizedImag R.styleable.CarNavigationButton_selectedAlpha, mSelectedAlpha); mUnselectedAlpha = typedArray.getFloat( R.styleable.CarNavigationButton_unselectedAlpha, mUnselectedAlpha); mIconResourceId = typedArray.getResourceId( com.android.internal.R.styleable.ImageView_src, 0); mSelectedIconResourceId = typedArray.getResourceId( R.styleable.CarNavigationButton_selectedIcon, mIconResourceId); typedArray.recycle(); // ImageView attrs TypedArray a = context.obtainStyledAttributes( attrs, com.android.internal.R.styleable.ImageView); mIconResourceId = a.getResourceId(com.android.internal.R.styleable.ImageView_src, 0); a.recycle(); } Loading Loading @@ -119,6 +131,23 @@ public class CarNavigationButton extends com.android.keyguard.AlphaOptimizedImag super.setSelected(selected); mSelected = selected; setAlpha(mSelected ? mSelectedAlpha : mUnselectedAlpha); updateImage(); } /** * @param hasUnseen true if should indicate if this is a Unseen state, false otherwise. */ public void setUnseen(boolean hasUnseen) { mHasUnseen = hasUnseen; updateImage(); } private void updateImage() { if (mHasUnseen) { setImageResource(mSelected ? UNSEEN_SELECTED_ICON_RESOURCE_ID : UNSEEN_ICON_RESOURCE_ID); } else { setImageResource(mSelected ? mSelectedIconResourceId : mIconResourceId); } } }
packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java +15 −4 Original line number Diff line number Diff line Loading @@ -311,7 +311,6 @@ public class CarStatusBar extends StatusBar implements return result; } @Override public void showKeyguard() { super.showKeyguard(); Loading Loading @@ -451,9 +450,21 @@ public class CarStatusBar extends StatusBar implements mNotificationDataManager = new NotificationDataManager(); mNotificationDataManager.setOnUnseenCountUpdateListener( () -> { // TODO: Update Notification Icon based on unseen count Log.d(TAG, "unseen count: " + mNotificationDataManager.getUnseenNotificationCount()); if (mNavigationBarView != null && mNotificationDataManager != null) { Boolean hasUnseen = mNotificationDataManager.getUnseenNotificationCount() > 0; if (mNavigationBarView != null) { mNavigationBarView.toggleNotificationUnseenIndicator(hasUnseen); } if (mLeftNavigationBarView != null) { mLeftNavigationBarView.toggleNotificationUnseenIndicator(hasUnseen); } if (mRightNavigationBarView != null) { mRightNavigationBarView.toggleNotificationUnseenIndicator(hasUnseen); } } }); CarHeadsUpNotificationManager carHeadsUpNotificationManager = Loading
packages/CarSystemUI/res/drawable/car_ic_notification_unseen.xml +1 −1 File changed.Contains only whitespace changes. Show changes