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

Commit 51de33b2 authored by Annie Chin's avatar Annie Chin Committed by Android (Google) Code Review
Browse files

Merge "Alarm content description now includes either existing label or...

Merge "Alarm content description now includes either existing label or "Alarm."" into ub-deskclock-dazzle
parents ac428195 e10d62be
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -88,7 +88,8 @@ public final class CollapsedAlarmViewHolder extends AlarmTimeViewHolder {
        boolean boundPreemptiveDismiss =
                bindPreemptiveDismissButton(context, alarm, alarmInstance);
        hairLine.setVisibility(boundPreemptiveDismiss ? View.GONE : View.VISIBLE);
        itemView.setContentDescription(clock.getContentDescription());
        itemView.setContentDescription(clock.getContentDescription() + " " +
                alarm.getLabelOrDefault(context));
    }

    private void bindReadOnlyLabel(Context context, Alarm alarm) {
+5 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;

import com.android.deskclock.R;
import com.android.deskclock.data.DataModel;

import java.util.Calendar;
@@ -306,6 +307,10 @@ public final class Alarm implements Parcelable, ClockContract.AlarmsColumns {
        deleteAfterUse = p.readInt() == 1;
    }

    public String getLabelOrDefault(Context context) {
        return label.isEmpty() ? context.getString(R.string.default_label) : label;
    }

    /**
     * Whether the alarm is in a state to show preemptive dismiss. Valid states are SNOOZE_STATE
     * HIGH_NOTIFICATION, LOW_NOTIFICATION, and HIDE_NOTIFICATION.