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

Commit b8338c88 authored by Austin Kolander's avatar Austin Kolander
Browse files

Added labels to action buttons.

Adds labels to action buttons to support talkback.

Bug: 64113874
Test: Talkback
Change-Id: I72e2732c021018f28c0ca63e3b99dd02253d136a
parent 7549cb13
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -103,6 +103,11 @@
    <!-- Button label that hides the error bar [CHAR LIMIT=24] -->
    <string name="button_dismiss">Dismiss</string>
    <string name="button_retry">Try Again</string>
    <!-- Button label that removes the default application to open a file. -->
    <string name="button_clear">Clear</string>
    <!-- Button label that show in the providers service. Many providers have their own app such
     as google drive. Pressing this button would open in the file in the providers app. -->
    <string name="button_show_provider">Show in provider</string>

    <!-- A string used to show user that currently documents are not sorted in any given order. [CHAR_LIMIT=30] -->
    <string name="not_sorted">Not sorted</string>
+3 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.documentsui.inspector.actions;

import android.annotation.Nullable;
import android.annotation.StringRes;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
@@ -54,6 +55,8 @@ public abstract class Action {

    public abstract @Nullable String getPackageName();

    public abstract @StringRes int getButtonLabel();

    public @Nullable Drawable getAppIcon() {

        String packageName = getPackageName();
+3 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import com.android.documentsui.inspector.InspectorController;
 */
public final class ActionView extends LinearLayout implements InspectorController.ActionDisplay {

    private Context mContext;
    private final TextView mHeader;
    private final ImageView mAppIcon;
    private final TextView mAppName;
@@ -56,6 +57,7 @@ public final class ActionView extends LinearLayout implements InspectorControlle
        View view = inflater.inflate(R.layout.inspector_action_view, null);
        addView(view);

        mContext = context;
        mHeader = (TextView) findViewById(R.id.action_header);
        mAppIcon = (ImageView) findViewById(R.id.app_icon);
        mAppName = (TextView) findViewById(R.id.app_name);
@@ -69,6 +71,7 @@ public final class ActionView extends LinearLayout implements InspectorControlle

        setAppIcon(mAction.getAppIcon());
        setAppName(mAction.getAppName());
        mActionButton.setContentDescription(mContext.getString(action.getButtonLabel()));

        mActionButton.setOnClickListener(listener);
        showAction(true);
+5 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
package com.android.documentsui.inspector.actions;

import android.annotation.StringRes;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
@@ -84,4 +85,8 @@ public final class ClearDefaultAppAction extends Action {
            return null;
        }
    }

    public @StringRes int getButtonLabel() {
        return R.string.button_clear;
    }
}
 No newline at end of file
+5 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static android.provider.DocumentsContract.Document.FLAG_SUPPORTS_SETTINGS
import android.content.Context;
import android.content.pm.PackageManager;

import android.support.annotation.StringRes;
import com.android.documentsui.R;
import com.android.documentsui.base.DocumentInfo;
import com.android.documentsui.roots.ProvidersAccess;
@@ -67,4 +68,8 @@ public final class ShowInProviderAction extends Action {
    public String getPackageName() {
        return mProviders.getPackageName(mDoc.derivedUri.getAuthority());
    }

    public @StringRes int getButtonLabel() {
        return R.string.button_show_provider;
    }
}
 No newline at end of file
+2 −2

File changed.

Contains only whitespace changes.

Loading