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

Commit 69e76f96 authored by Selim Cinek's avatar Selim Cinek
Browse files

The row is now labeling the expand button

To create a clear connection between the expand button
and the notification.

Test: manual, listen to expand button
Change-Id: I399c66af1252f1078895c65603eaa83003a3a819
Fixes: 35064589
parent 7c31e792
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.annotation.Nullable;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.View;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.Button;
import android.widget.ImageView;
@@ -30,6 +31,8 @@ import android.widget.RemoteViews;
 */
@RemoteViews.RemoteView
public class NotificationExpandButton extends ImageView {
    private View mLabeledBy;

    public NotificationExpandButton(Context context) {
        super(context);
    }
@@ -66,5 +69,12 @@ public class NotificationExpandButton extends ImageView {
    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
        super.onInitializeAccessibilityNodeInfo(info);
        info.setClassName(Button.class.getName());
        if (mLabeledBy != null) {
            info.setLabeledBy(mLabeledBy);
        }
    }

    public void setLabeledBy(View labeledBy) {
        mLabeledBy = labeledBy;
    }
}
+8 −7
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.view.animation.PathInterpolator;
import android.widget.ImageView;
import android.widget.TextView;

import com.android.internal.widget.NotificationExpandButton;
import com.android.systemui.Interpolators;
import com.android.systemui.ViewInvertHelper;
import com.android.systemui.statusbar.ExpandableNotificationRow;
@@ -54,7 +55,7 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper {
    protected int mColor;
    private ImageView mIcon;

    private ImageView mExpandButton;
    private NotificationExpandButton mExpandButton;
    private NotificationHeaderView mNotificationHeader;
    private TextView mHeaderText;
    private ImageView mWorkProfileImage;
@@ -106,13 +107,13 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper {
    }

    protected void resolveHeaderViews() {
        mIcon = (ImageView) mView.findViewById(com.android.internal.R.id.icon);
        mHeaderText = (TextView) mView.findViewById(com.android.internal.R.id.header_text);
        mExpandButton = (ImageView) mView.findViewById(com.android.internal.R.id.expand_button);
        mWorkProfileImage = (ImageView) mView.findViewById(com.android.internal.R.id.profile_badge);
        mIcon = mView.findViewById(com.android.internal.R.id.icon);
        mHeaderText = mView.findViewById(com.android.internal.R.id.header_text);
        mExpandButton = mView.findViewById(com.android.internal.R.id.expand_button);
        mExpandButton.setLabeledBy(mRow);
        mWorkProfileImage = mView.findViewById(com.android.internal.R.id.profile_badge);
        mColor = resolveColor(mExpandButton);
        mNotificationHeader = (NotificationHeaderView) mView.findViewById(
                com.android.internal.R.id.notification_header);
        mNotificationHeader = mView.findViewById(com.android.internal.R.id.notification_header);
        getDozer().setColor(mColor);
    }