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

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

Merge "Fixing keyboard navigation when Overview list is empty" into ub-launcher3-edmonton

parents db28a992 1b0c5032
Loading
Loading
Loading
Loading
+0 −7
Original line number Original line Diff line number Diff line
@@ -18,8 +18,6 @@ package com.android.launcher3.uioverrides;
import static com.android.launcher3.LauncherAnimUtils.ALL_APPS_TRANSITION_MS;
import static com.android.launcher3.LauncherAnimUtils.ALL_APPS_TRANSITION_MS;
import static com.android.launcher3.anim.Interpolators.DEACCEL_2;
import static com.android.launcher3.anim.Interpolators.DEACCEL_2;


import android.view.View;

import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.Launcher;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.LauncherState;
@@ -61,11 +59,6 @@ public class AllAppsState extends LauncherState {
        return 0f;
        return 0f;
    }
    }


    @Override
    public View getFinalFocus(Launcher launcher) {
        return launcher.getAppsView();
    }

    @Override
    @Override
    public float[] getWorkspaceScaleAndTranslation(Launcher launcher) {
    public float[] getWorkspaceScaleAndTranslation(Launcher launcher) {
        float[] scaleAndTranslation = LauncherState.OVERVIEW.getWorkspaceScaleAndTranslation(
        float[] scaleAndTranslation = LauncherState.OVERVIEW.getWorkspaceScaleAndTranslation(
+0 −5
Original line number Original line Diff line number Diff line
@@ -83,11 +83,6 @@ public class OverviewState extends LauncherState {
        DiscoveryBounce.showForOverviewIfNeeded(launcher);
        DiscoveryBounce.showForOverviewIfNeeded(launcher);
    }
    }


    @Override
    public View getFinalFocus(Launcher launcher) {
        return launcher.getOverviewPanel();
    }

    public PageAlphaProvider getWorkspacePageAlphaProvider(Launcher launcher) {
    public PageAlphaProvider getWorkspacePageAlphaProvider(Launcher launcher) {
        return new PageAlphaProvider(DEACCEL_2) {
        return new PageAlphaProvider(DEACCEL_2) {
            @Override
            @Override
+2 −10
Original line number Original line Diff line number Diff line
@@ -271,6 +271,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
                .getDimensionPixelSize(R.dimen.recents_empty_message_text_padding);
                .getDimensionPixelSize(R.dimen.recents_empty_message_text_padding);
        setWillNotDraw(false);
        setWillNotDraw(false);
        updateEmptyMessage();
        updateEmptyMessage();
        setFocusable(false);
    }
    }


    public boolean isRtl() {
    public boolean isRtl() {
@@ -931,16 +932,6 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
        return true;
        return true;
    }
    }


    @Override
    public void onVisibilityAggregated(boolean isVisible) {
        super.onVisibilityAggregated(isVisible);
        if (isVisible && !isFocused()) {
            // Having focus, even in touch mode, keeps us from losing [Alt+]Tab by preventing
            // switching to keyboard mode.
            requestFocus();
        }
    }

    private void runDismissAnimation(PendingAnimation pendingAnim) {
    private void runDismissAnimation(PendingAnimation pendingAnim) {
        AnimatorPlaybackController controller = AnimatorPlaybackController.wrap(
        AnimatorPlaybackController controller = AnimatorPlaybackController.wrap(
                pendingAnim.anim, DISMISS_TASK_DURATION);
                pendingAnim.anim, DISMISS_TASK_DURATION);
@@ -1285,6 +1276,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
    private void onChildViewsChanged() {
    private void onChildViewsChanged() {
        final int childCount = getChildCount();
        final int childCount = getChildCount();
        mClearAllButton.setVisibility(childCount == 0 ? INVISIBLE : VISIBLE);
        mClearAllButton.setVisibility(childCount == 0 ? INVISIBLE : VISIBLE);
        setFocusable(childCount != 0);
    }
    }


    public void revealClearAllButton() {
    public void revealClearAllButton() {
+10 −3
Original line number Original line Diff line number Diff line
@@ -113,8 +113,15 @@ public class RecentsViewContainer extends InsettableFrameLayout {


    @Override
    @Override
    public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
    public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
        if (mRecentsView.getChildCount() > 0) {
            // Carousel is first in tab order.
            // Carousel is first in tab order.
            views.add(mRecentsView);
            views.add(mRecentsView);
            views.add(mClearAllButton);
            views.add(mClearAllButton);
        }
        }
    }
    }

    public boolean requestFocus(int direction, Rect previouslyFocusedRect) {
        return mRecentsView.requestFocus(direction, previouslyFocusedRect) ||
                super.requestFocus(direction, previouslyFocusedRect);
    }
}
 No newline at end of file
+1 −5
Original line number Original line Diff line number Diff line
@@ -18,11 +18,11 @@ package com.android.launcher3;
import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_AUTO;
import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_AUTO;
import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS;
import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS;
import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;
import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;

import static com.android.launcher3.anim.Interpolators.ACCEL_2;
import static com.android.launcher3.anim.Interpolators.ACCEL_2;
import static com.android.launcher3.states.RotationHelper.REQUEST_NONE;
import static com.android.launcher3.states.RotationHelper.REQUEST_NONE;


import android.graphics.Rect;
import android.graphics.Rect;
import android.view.View;
import android.view.animation.Interpolator;
import android.view.animation.Interpolator;


import com.android.launcher3.states.SpringLoadedState;
import com.android.launcher3.states.SpringLoadedState;
@@ -196,10 +196,6 @@ public class LauncherState {


    public void onStateDisabled(Launcher launcher) { }
    public void onStateDisabled(Launcher launcher) { }


    public View getFinalFocus(Launcher launcher) {
        return launcher.getWorkspace();
    }

    public int getVisibleElements(Launcher launcher) {
    public int getVisibleElements(Launcher launcher) {
        if (launcher.getDeviceProfile().isVerticalBarLayout()) {
        if (launcher.getDeviceProfile().isVerticalBarLayout()) {
            return HOTSEAT_ICONS | VERTICAL_SWIPE_INDICATOR;
            return HOTSEAT_ICONS | VERTICAL_SWIPE_INDICATOR;
Loading