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

Commit fca8f293 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add work/personal Talkback to DocsUI apps" into rvc-dev

parents a1355716 fb7953f4
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -123,6 +123,14 @@ public final class UserId {
        return getPackageManager(context).getUserBadgedIcon(drawable, mUserHandle);
    }

    /**
     * Returns the value of {@link PackageManager#getUserBadgedLabel(CharSequence, UserHandle)} for
     * the user and given label.
     */
    public CharSequence getUserBadgedLabel(Context context, CharSequence label) {
        return getPackageManager(context).getUserBadgedLabel(label, mUserHandle);
    }

    /**
     * Returns true if this user refers to the system user; false otherwise.
     */
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.documentsui.dirlist;

import android.os.UserManager;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
@@ -127,6 +128,8 @@ public class AppsRowManager {

        app_icon.setImageDrawable(data.getIconDrawable(view.getContext()));
        title.setText(data.getTitle());
        title.setContentDescription(
                data.getUserId().getUserBadgedLabel(view.getContext(), data.getTitle()));
        summary.setText(data.getSummary());
        summary.setVisibility(data.getSummary() != null ? View.VISIBLE : View.GONE);
        view.setOnClickListener(v -> data.onClicked());
+4 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.UserManager;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
@@ -28,6 +30,7 @@ import com.android.documentsui.ActionHandler;
import com.android.documentsui.IconUtils;
import com.android.documentsui.R;
import com.android.documentsui.base.UserId;
import com.android.documentsui.dirlist.AppsRowItemData;

/**
 * An {@link Item} for apps that supports some picking actions like
@@ -85,6 +88,7 @@ public class AppItem extends Item {
        final ImageView actionIcon = (ImageView) convertView.findViewById(R.id.action_icon);

        titleView.setText(title);
        titleView.setContentDescription(userId.getUserBadgedLabel(convertView.getContext(), title));

        bindIcon(icon);
        bindActionIcon(actionIconArea, actionIcon);
+4 −1
Original line number Diff line number Diff line
@@ -18,7 +18,9 @@ package com.android.documentsui.sidebar;

import android.content.Context;
import android.content.pm.ResolveInfo;
import android.os.UserManager;
import android.provider.DocumentsProvider;
import android.text.TextUtils;
import android.view.View;

import com.android.documentsui.ActionHandler;
@@ -51,7 +53,8 @@ class RootAndAppItem extends RootItem {
        final Context context = convertView.getContext();

        String contentDescription =
                context.getResources().getString(R.string.open_external_app, root.title);
                context.getResources().getString(
                        R.string.open_external_app, userId.getUserBadgedLabel(context, root.title));

        bindAction(convertView, View.VISIBLE, R.drawable.ic_exit_to_app, contentDescription);
        bindIconAndTitle(convertView);