Loading src/com/android/launcher3/notification/NotificationListener.java +2 −2 Original line number Diff line number Diff line Loading @@ -232,8 +232,8 @@ public class NotificationListener extends NotificationListenerService { boolean isGroupHeader = (notification.flags & Notification.FLAG_GROUP_SUMMARY) != 0; CharSequence title = notification.extras.getCharSequence(Notification.EXTRA_TITLE); CharSequence text = notification.extras.getCharSequence(Notification.EXTRA_TEXT); boolean missingTitleOrText = TextUtils.isEmpty(title) || TextUtils.isEmpty(text); return (notification.contentIntent == null || isGroupHeader || missingTitleOrText); boolean missingTitleAndText = TextUtils.isEmpty(title) && TextUtils.isEmpty(text); return (isGroupHeader || missingTitleAndText); } public interface NotificationsChangedListener { Loading src/com/android/launcher3/notification/NotificationMainView.java +14 −3 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.Context; import android.content.res.ColorStateList; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.RippleDrawable; import android.text.TextUtils; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; Loading Loading @@ -83,11 +84,21 @@ public class NotificationMainView extends FrameLayout implements SwipeHelper.Cal public void applyNotificationInfo(NotificationInfo mainNotification, View iconView, boolean animate) { mNotificationInfo = mainNotification; mTitleView.setText(mNotificationInfo.title); mTextView.setText(mNotificationInfo.text); CharSequence title = mNotificationInfo.title; CharSequence text = mNotificationInfo.text; if (!TextUtils.isEmpty(title) && !TextUtils.isEmpty(text)) { mTitleView.setText(title); mTextView.setText(text); } else { mTitleView.setMaxLines(2); mTitleView.setText(TextUtils.isEmpty(title) ? text : title); mTextView.setVisibility(GONE); } iconView.setBackground(mNotificationInfo.getIconForBackground(getContext(), mBackgroundColor)); if (mNotificationInfo.intent != null) { setOnClickListener(mNotificationInfo); } setTranslationX(0); // Add a dummy ItemInfo so that logging populates the correct container and item types // instead of DEFAULT_CONTAINERTYPE and DEFAULT_ITEMTYPE, respectively. Loading Loading
src/com/android/launcher3/notification/NotificationListener.java +2 −2 Original line number Diff line number Diff line Loading @@ -232,8 +232,8 @@ public class NotificationListener extends NotificationListenerService { boolean isGroupHeader = (notification.flags & Notification.FLAG_GROUP_SUMMARY) != 0; CharSequence title = notification.extras.getCharSequence(Notification.EXTRA_TITLE); CharSequence text = notification.extras.getCharSequence(Notification.EXTRA_TEXT); boolean missingTitleOrText = TextUtils.isEmpty(title) || TextUtils.isEmpty(text); return (notification.contentIntent == null || isGroupHeader || missingTitleOrText); boolean missingTitleAndText = TextUtils.isEmpty(title) && TextUtils.isEmpty(text); return (isGroupHeader || missingTitleAndText); } public interface NotificationsChangedListener { Loading
src/com/android/launcher3/notification/NotificationMainView.java +14 −3 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.Context; import android.content.res.ColorStateList; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.RippleDrawable; import android.text.TextUtils; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; Loading Loading @@ -83,11 +84,21 @@ public class NotificationMainView extends FrameLayout implements SwipeHelper.Cal public void applyNotificationInfo(NotificationInfo mainNotification, View iconView, boolean animate) { mNotificationInfo = mainNotification; mTitleView.setText(mNotificationInfo.title); mTextView.setText(mNotificationInfo.text); CharSequence title = mNotificationInfo.title; CharSequence text = mNotificationInfo.text; if (!TextUtils.isEmpty(title) && !TextUtils.isEmpty(text)) { mTitleView.setText(title); mTextView.setText(text); } else { mTitleView.setMaxLines(2); mTitleView.setText(TextUtils.isEmpty(title) ? text : title); mTextView.setVisibility(GONE); } iconView.setBackground(mNotificationInfo.getIconForBackground(getContext(), mBackgroundColor)); if (mNotificationInfo.intent != null) { setOnClickListener(mNotificationInfo); } setTranslationX(0); // Add a dummy ItemInfo so that logging populates the correct container and item types // instead of DEFAULT_CONTAINERTYPE and DEFAULT_ITEMTYPE, respectively. Loading