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

Commit 31e400d6 authored by Vinit Nayak's avatar Vinit Nayak Committed by Android (Google) Code Review
Browse files

Merge "Add toast instructing user to select second split app" into sc-v2-dev

parents 1ad55e6a 82170543
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -193,6 +193,8 @@
    <string name="action_screenshot">Screenshot</string>
    <!-- Label for a button that enters split screen selection mode. [CHAR_LIMIT=20] -->
    <string name="action_split">Split</string>
    <!-- Label for toast with instructions for split screen selection mode. [CHAR_LIMIT=50] -->
    <string name="toast_split_select_app">Tap another app to use splitscreen</string>
    <!-- Message shown when an action is blocked by a policy enforced by the app or the organization managing the device. [CHAR_LIMIT=NONE] -->
    <string name="blocked_by_policy">This action isn\'t allowed by the app or your organization</string>

+10 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ import android.view.accessibility.AccessibilityNodeInfo;
import android.view.animation.Interpolator;
import android.widget.ListView;
import android.widget.OverScroller;
import android.widget.Toast;

import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
@@ -591,6 +592,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
    private TaskView mSplitHiddenTaskView;
    private TaskView mSecondSplitHiddenTaskView;
    private SplitConfigurationOptions.StagedSplitBounds mSplitBoundsConfig;
    private final Toast mSplitToast = Toast.makeText(getContext(),
            R.string.toast_split_select_app, Toast.LENGTH_SHORT);

    /**
     * Keeps track of the index of the TaskView that split screen was initialized with so we know
@@ -2679,6 +2682,11 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
        mFirstFloatingTaskView.setAlpha(1);
        mFirstFloatingTaskView.addAnimation(anim, startingTaskRect,
                mTempRect, mSplitHiddenTaskView, true /*fadeWithThumbnail*/);
        anim.addEndListener(success -> {
            if (success) {
                mSplitToast.show();
            }
        });
    }

    /**
@@ -3810,6 +3818,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
    }

    public void confirmSplitSelect(TaskView taskView) {
        mSplitToast.cancel();
        RectF secondTaskStartingBounds = new RectF();
        Rect secondTaskEndingBounds = new Rect();
        // TODO(194414938) starting bounds seem slightly off, investigate
@@ -3851,6 +3860,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
        splitController.resetState();
        int duration = mActivity.getStateManager().getState().getTransitionDuration(getContext());
        PendingAnimation pendingAnim = new PendingAnimation(duration);
        mSplitToast.cancel();
        if (!animate) {
            resetFromSplitSelectionState();
            return pendingAnim;