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

Commit eac269ac authored by Charlie Anderson's avatar Charlie Anderson
Browse files

Add custom talkback action for unarchiving apps

Bug: 373746865
Test: manually with Talkback
Flag: EXEMPT bugfix
Change-Id: I8c9efc029c2172e0dacd644b34f4930f50a7f8aa
parent 859bbaa7
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -355,8 +355,9 @@
    <!-- Title for an app whose download has been started. -->
    <string name="app_waiting_download_title"><xliff:g id="name" example="Messenger">%1$s</xliff:g> waiting to install</string>
    <!-- Title for an app which is archived. -->
    <string name="app_archived_title"><xliff:g id="name" example="Messenger">%1$s</xliff:g> is archived. Tap to download and restore.</string>

    <string name="app_archived_title"><xliff:g id="name" example="Messenger">%1$s</xliff:g> is archived.</string>
    <!-- Accessibility Action for an app which is archived. -->
    <string name="app_unarchiving_action">download and restore</string>

    <!-- Title shown on the alert dialog prompting the user to update the application in market
     in order to re-enable the disabled shortcuts -->
+12 −0
Original line number Diff line number Diff line
@@ -57,12 +57,14 @@ import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewDebug;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.TextView;

import androidx.annotation.DrawableRes;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import androidx.annotation.VisibleForTesting;
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;

import com.android.launcher3.accessibility.BaseAccessibilityDelegate;
import com.android.launcher3.dot.DotInfo;
@@ -519,6 +521,16 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
        }
    }

    @Override
    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
        super.onInitializeAccessibilityNodeInfo(info);
        if (getTag() instanceof ItemInfoWithIcon infoWithIcon && infoWithIcon.isInactiveArchive()) {
            info.addAction(new AccessibilityNodeInfo.AccessibilityAction(
                    AccessibilityNodeInfoCompat.ACTION_CLICK,
                    getContext().getString(R.string.app_unarchiving_action)));
        }
    }

    /** This is used for testing to forcefully set the display. */
    @VisibleForTesting
    public void setDisplay(int display) {