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;
*/
@RemoteViews.RemoteView
public class NotificationExpandButton extends ImageView {
+ private View mLabeledBy;
+
public NotificationExpandButton(Context context) {
super(context);
}
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;
}
}
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;
protected int mColor;
private ImageView mIcon;
- private ImageView mExpandButton;
+ private NotificationExpandButton mExpandButton;
private NotificationHeaderView mNotificationHeader;
private TextView mHeaderText;
private ImageView mWorkProfileImage;
}
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);
}