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

Commit 2a6c849e authored by Randy Pfohl's avatar Randy Pfohl
Browse files

adding in a method to set content description based on string resource id

Test: Built and tested with other cls in topic and verified talkback works properly.

Flag: None

Bug: 319747547

Change-Id: I92770e5abf1feeca0a825f1af461bd77134973e0
parent 3ff637f7
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import android.widget.FrameLayout;
import android.widget.ImageView;

import androidx.annotation.RawRes;
import androidx.annotation.StringRes;
import androidx.preference.Preference;
import androidx.preference.PreferenceViewHolder;
import androidx.vectordrawable.graphics.drawable.Animatable2Compat;
@@ -216,7 +217,7 @@ public class IllustrationPreference extends Preference {
     * To set content description of the {@link Illustration Preference}. This can use for talkback
     * environment if developer wants to have a customization content.
     *
     * @param contentDescription The resource id of the content description.
     * @param contentDescription The CharSequence of the content description.
     */
    public void setContentDescription(CharSequence contentDescription) {
        if (!TextUtils.equals(mContentDescription, contentDescription)) {
@@ -225,6 +226,16 @@ public class IllustrationPreference extends Preference {
        }
    }

    /**
     * To set content description of the {@link Illustration Preference}. This can use for talkback
     * environment if developer wants to have a customization content.
     *
     * @param contentDescriptionResId The resource id of the content description.
     */
    public void setContentDescription(@StringRes int contentDescriptionResId) {
        setContentDescription(getContext().getText(contentDescriptionResId));
    }

    /**
     * Gets the lottie illustration resource id.
     */