Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51425313 authored by Gus Prevas's avatar Gus Prevas
Browse files

Swaps position of expand button and bell icon.

This change puts the expand caret at the end of the notification header
if the new interruption model is turned on, and moves the bell icon on
noisy notifications from the end of the header to directly after the
header text.

Test: manually
Change-Id: I2a97f80920598f5f99f2d9c3b14d58858e1de1bb
parent 7a12c506
Loading
Loading
Loading
Loading
+0 −5
Original line number Original line Diff line number Diff line
@@ -218,11 +218,6 @@ public class NotificationHeaderView extends ViewGroup {
                layoutRight = end - paddingEnd;
                layoutRight = end - paddingEnd;
                end = layoutLeft = layoutRight - child.getMeasuredWidth();
                end = layoutLeft = layoutRight - child.getMeasuredWidth();
            }
            }
            if (child == mAudiblyAlertedIcon) {
                int paddingEnd = mContentEndMargin;
                layoutRight = end - paddingEnd;
                end = layoutLeft = layoutRight - child.getMeasuredWidth();
            }
            if (getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
            if (getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
                int ltrLeft = layoutLeft;
                int ltrLeft = layoutLeft;
                layoutLeft = getWidth() - layoutRight;
                layoutLeft = getWidth() - layoutRight;
+11 −11
Original line number Original line Diff line number Diff line
@@ -116,28 +116,28 @@
        android:contentDescription="@string/expand_button_content_description_collapsed"
        android:contentDescription="@string/expand_button_content_description_collapsed"
        />
        />
    <ImageView
    <ImageView
        android:id="@+id/profile_badge"
        android:id="@+id/alerted_icon"
        android:layout_width="@dimen/notification_badge_size"
        android:layout_width="@dimen/notification_alerted_size"
        android:layout_height="@dimen/notification_badge_size"
        android:layout_height="@dimen/notification_alerted_size"
        android:layout_gravity="center"
        android:layout_gravity="center"
        android:layout_marginStart="4dp"
        android:layout_marginStart="4dp"
        android:paddingTop="1dp"
        android:paddingTop="1dp"
        android:scaleType="fitCenter"
        android:scaleType="fitCenter"
        android:visibility="gone"
        android:visibility="gone"
        android:contentDescription="@string/notification_work_profile_content_description"
        android:contentDescription="@string/notification_alerted_content_description"
        android:src="@drawable/ic_notifications_alerted"
        android:tint="@color/notification_secondary_text_color_light"
    />
    />
    <ImageView
    <ImageView
        android:id="@+id/alerted_icon"
        android:id="@+id/profile_badge"
        android:layout_width="@dimen/notification_alerted_size"
        android:layout_width="@dimen/notification_badge_size"
        android:layout_height="@dimen/notification_alerted_size"
        android:layout_height="@dimen/notification_badge_size"
        android:layout_gravity="center"
        android:layout_gravity="center"
        android:layout_marginStart="4dp"
        android:layout_marginStart="4dp"
        android:paddingTop="1dp"
        android:paddingTop="1dp"
        android:scaleType="fitCenter"
        android:scaleType="fitCenter"
        android:visibility="gone"
        android:visibility="gone"
        android:contentDescription="@string/notification_alerted_content_description"
        android:contentDescription="@string/notification_work_profile_content_description"
        android:src="@drawable/ic_notifications_alerted"
        android:tint="@color/notification_secondary_text_color_light"
        />
        />
    <LinearLayout
    <LinearLayout
        android:id="@+id/app_ops"
        android:id="@+id/app_ops"
+3 −1
Original line number Original line Diff line number Diff line
@@ -38,6 +38,7 @@ import com.android.systemui.statusbar.TransformableView;
import com.android.systemui.statusbar.ViewTransformationHelper;
import com.android.systemui.statusbar.ViewTransformationHelper;
import com.android.systemui.statusbar.notification.CustomInterpolatorTransformation;
import com.android.systemui.statusbar.notification.CustomInterpolatorTransformation;
import com.android.systemui.statusbar.notification.ImageTransformState;
import com.android.systemui.statusbar.notification.ImageTransformState;
import com.android.systemui.statusbar.notification.NotificationUtils;
import com.android.systemui.statusbar.notification.TransformState;
import com.android.systemui.statusbar.notification.TransformState;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;


@@ -69,7 +70,8 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper {
    protected NotificationHeaderViewWrapper(Context ctx, View view, ExpandableNotificationRow row) {
    protected NotificationHeaderViewWrapper(Context ctx, View view, ExpandableNotificationRow row) {
        super(ctx, view, row);
        super(ctx, view, row);
        mShowExpandButtonAtEnd = ctx.getResources().getBoolean(
        mShowExpandButtonAtEnd = ctx.getResources().getBoolean(
                R.bool.config_showNotificationExpandButtonAtEnd);
                R.bool.config_showNotificationExpandButtonAtEnd)
                || NotificationUtils.useNewInterruptionModel(ctx);
        mTransformationHelper = new ViewTransformationHelper();
        mTransformationHelper = new ViewTransformationHelper();


        // we want to avoid that the header clashes with the other text when transforming
        // we want to avoid that the header clashes with the other text when transforming