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

Commit 1103bfca authored by Sid Soundararajan's avatar Sid Soundararajan
Browse files

Add support for dismissing in Talkback Mode

This should let the user be able to access dismiss in talkback
mode. However, because talkback relies on focus changes to work,
the focus change animator is disabled. This means some visuals
will not work the same as when talkback is turned off.

BUG: 28594452
Change-Id: Idb443fe559bd7a636ff381e6727f81d41d0bd325
parent c991879f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -16,5 +16,5 @@ limitations under the License.
<resources xmlns:android="http://schemas.android.com/apk/res/android">
    <item format="float" type="integer" name="unselected_scale">1.0</item>
    <item format="float" type="integer" name="selected_scale">1.259</item>
    <item format="float" type="integer" name="dismiss_unselected_alpha">0.1</item>
    <item format="float" type="integer" name="dismiss_unselected_alpha">0.3</item>
</resources>
+1 −0
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ public class ViewFocusAnimator implements View.OnFocusChangeListener {

        mTargetView.getDismissIconView().setAlpha(mDismissIconAlpha * level);
        mTargetView.getThumbnailView().setZ(z);
        mTargetView.getDismissIconView().setZ(z);
    }

    public float getFocusProgress() {
+20 −0
Original line number Diff line number Diff line
@@ -38,6 +38,8 @@ import android.widget.LinearLayout;
import android.widget.TextView;

import com.android.systemui.R;
import com.android.systemui.recents.Recents;
import com.android.systemui.recents.misc.SystemServicesProxy;
import com.android.systemui.recents.tv.animations.DismissAnimationsHolder;
import com.android.systemui.recents.tv.animations.RecentsRowFocusAnimationHolder;
import com.android.systemui.recents.tv.animations.ViewFocusAnimator;
@@ -85,6 +87,24 @@ public class TaskCardView extends LinearLayout {
        mCornerRadius = getResources().getDimensionPixelSize(
                R.dimen.recents_task_view_rounded_corners_radius);
        mRecentsRowFocusAnimationHolder = new RecentsRowFocusAnimationHolder(this, title);
        SystemServicesProxy ssp = Recents.getSystemServices();
        if (ssp.isTouchExplorationEnabled()) {
            mDismissIconView.setFocusable(true);
            mDismissIconView.setFocusableInTouchMode(true);
            mDismissIconView.setOnFocusChangeListener(new OnFocusChangeListener() {
                @Override
                public void onFocusChange(View v, boolean hasFocus) {
                    if (hasFocus) {
                        setDismissState(true);
                    } else {
                        setDismissState(false);
                    }
                }
            });
        } else {
            mDismissIconView.setFocusable(false);
            mDismissIconView.setFocusableInTouchMode(false);
        }
        mViewFocusAnimator = new ViewFocusAnimator(this);
    }