Search in sources :

Example 1 with StagedSplitBounds

use of com.android.launcher3.util.SplitConfigurationOptions.StagedSplitBounds in project android_packages_apps_Launcher3 by AOSPA.

the class RemoteTargetGluer method assignTargetsForSplitScreen.

/**
 * Assigns the provided splitIDs to the {@link #mRemoteTargetHandles}, with index 0 will being
 * the left/top task, index 1 right/bottom
 */
public RemoteTargetHandle[] assignTargetsForSplitScreen(RemoteAnimationTargets targets, int[] splitIds) {
    // only one set if single/fullscreen task
    RemoteAnimationTargetCompat topLeftTarget;
    RemoteAnimationTargetCompat bottomRightTarget;
    if (mRemoteTargetHandles.length == 1) {
        // If we're not in split screen, the splitIds count doesn't really matter since we
        // should always hit this case.
        mRemoteTargetHandles[0].mTransformParams.setTargetSet(targets);
        if (targets.apps.length > 0) {
            // Unclear why/when target.apps length == 0, but it sure does happen :(
            topLeftTarget = targets.apps[0];
            mRemoteTargetHandles[0].mTaskViewSimulator.setPreview(topLeftTarget, null);
        }
    } else {
        // split screen
        topLeftTarget = targets.findTask(splitIds[0]);
        bottomRightTarget = targets.findTask(splitIds[1]);
        // remoteTargetHandle[0] denotes topLeft task, so we pass in the bottomRight to exclude,
        // vice versa
        mStagedSplitBounds = new StagedSplitBounds(topLeftTarget.screenSpaceBounds, bottomRightTarget.screenSpaceBounds, splitIds[0], splitIds[1]);
        mRemoteTargetHandles[0].mTransformParams.setTargetSet(createRemoteAnimationTargetsForTarget(targets, bottomRightTarget));
        mRemoteTargetHandles[0].mTaskViewSimulator.setPreview(topLeftTarget, mStagedSplitBounds);
        mRemoteTargetHandles[1].mTransformParams.setTargetSet(createRemoteAnimationTargetsForTarget(targets, topLeftTarget));
        mRemoteTargetHandles[1].mTaskViewSimulator.setPreview(bottomRightTarget, mStagedSplitBounds);
    }
    return mRemoteTargetHandles;
}
Also used : StagedSplitBounds(com.android.launcher3.util.SplitConfigurationOptions.StagedSplitBounds) RemoteAnimationTargetCompat(com.android.systemui.shared.system.RemoteAnimationTargetCompat)

Example 2 with StagedSplitBounds

use of com.android.launcher3.util.SplitConfigurationOptions.StagedSplitBounds in project android_packages_apps_404Launcher by P-404.

the class RemoteTargetGluer method assignTargetsForSplitScreen.

/**
 * Assigns the provided splitIDs to the {@link #mRemoteTargetHandles}, with index 0 will being
 * the left/top task, index 1 right/bottom
 */
public RemoteTargetHandle[] assignTargetsForSplitScreen(RemoteAnimationTargets targets, int[] splitIds) {
    // only one set if single/fullscreen task
    RemoteAnimationTargetCompat topLeftTarget;
    RemoteAnimationTargetCompat bottomRightTarget;
    if (mRemoteTargetHandles.length == 1) {
        // If we're not in split screen, the splitIds count doesn't really matter since we
        // should always hit this case.
        mRemoteTargetHandles[0].mTransformParams.setTargetSet(targets);
        if (targets.apps.length > 0) {
            // Unclear why/when target.apps length == 0, but it sure does happen :(
            topLeftTarget = targets.apps[0];
            mRemoteTargetHandles[0].mTaskViewSimulator.setPreview(topLeftTarget, null);
        }
    } else {
        // split screen
        topLeftTarget = targets.findTask(splitIds[0]);
        bottomRightTarget = targets.findTask(splitIds[1]);
        // remoteTargetHandle[0] denotes topLeft task, so we pass in the bottomRight to exclude,
        // vice versa
        mStagedSplitBounds = new StagedSplitBounds(topLeftTarget.screenSpaceBounds, bottomRightTarget.screenSpaceBounds, splitIds[0], splitIds[1]);
        mRemoteTargetHandles[0].mTransformParams.setTargetSet(createRemoteAnimationTargetsForTarget(targets, bottomRightTarget));
        mRemoteTargetHandles[0].mTaskViewSimulator.setPreview(topLeftTarget, mStagedSplitBounds);
        mRemoteTargetHandles[1].mTransformParams.setTargetSet(createRemoteAnimationTargetsForTarget(targets, topLeftTarget));
        mRemoteTargetHandles[1].mTaskViewSimulator.setPreview(bottomRightTarget, mStagedSplitBounds);
    }
    return mRemoteTargetHandles;
}
Also used : StagedSplitBounds(com.android.launcher3.util.SplitConfigurationOptions.StagedSplitBounds) RemoteAnimationTargetCompat(com.android.systemui.shared.system.RemoteAnimationTargetCompat)

Example 3 with StagedSplitBounds

use of com.android.launcher3.util.SplitConfigurationOptions.StagedSplitBounds in project android_packages_apps_Launcher3 by ArrowOS.

the class RemoteTargetGluer method assignTargetsForSplitScreen.

/**
 * Assigns the provided splitIDs to the {@link #mRemoteTargetHandles}, with index 0 will being
 * the left/top task, index 1 right/bottom
 */
public RemoteTargetHandle[] assignTargetsForSplitScreen(RemoteAnimationTargets targets, int[] splitIds) {
    // only one set if single/fullscreen task
    RemoteAnimationTargetCompat topLeftTarget;
    RemoteAnimationTargetCompat bottomRightTarget;
    if (mRemoteTargetHandles.length == 1) {
        // If we're not in split screen, the splitIds count doesn't really matter since we
        // should always hit this case.
        mRemoteTargetHandles[0].mTransformParams.setTargetSet(targets);
        if (targets.apps.length > 0) {
            // Unclear why/when target.apps length == 0, but it sure does happen :(
            topLeftTarget = targets.apps[0];
            mRemoteTargetHandles[0].mTaskViewSimulator.setPreview(topLeftTarget, null);
        }
    } else {
        // split screen
        topLeftTarget = targets.findTask(splitIds[0]);
        bottomRightTarget = targets.findTask(splitIds[1]);
        // remoteTargetHandle[0] denotes topLeft task, so we pass in the bottomRight to exclude,
        // vice versa
        mStagedSplitBounds = new StagedSplitBounds(topLeftTarget.screenSpaceBounds, bottomRightTarget.screenSpaceBounds, splitIds[0], splitIds[1]);
        mRemoteTargetHandles[0].mTransformParams.setTargetSet(createRemoteAnimationTargetsForTarget(targets, bottomRightTarget));
        mRemoteTargetHandles[0].mTaskViewSimulator.setPreview(topLeftTarget, mStagedSplitBounds);
        mRemoteTargetHandles[1].mTransformParams.setTargetSet(createRemoteAnimationTargetsForTarget(targets, topLeftTarget));
        mRemoteTargetHandles[1].mTaskViewSimulator.setPreview(bottomRightTarget, mStagedSplitBounds);
    }
    return mRemoteTargetHandles;
}
Also used : StagedSplitBounds(com.android.launcher3.util.SplitConfigurationOptions.StagedSplitBounds) RemoteAnimationTargetCompat(com.android.systemui.shared.system.RemoteAnimationTargetCompat)

Example 4 with StagedSplitBounds

use of com.android.launcher3.util.SplitConfigurationOptions.StagedSplitBounds in project android_packages_apps_Launcher3 by ProtonAOSP.

the class RemoteTargetGluer method assignTargetsForSplitScreen.

/**
 * Assigns the provided splitIDs to the {@link #mRemoteTargetHandles}, with index 0 will being
 * the left/top task, index 1 right/bottom
 */
public RemoteTargetHandle[] assignTargetsForSplitScreen(RemoteAnimationTargets targets, int[] splitIds) {
    // only one set if single/fullscreen task
    RemoteAnimationTargetCompat topLeftTarget;
    RemoteAnimationTargetCompat bottomRightTarget;
    if (mRemoteTargetHandles.length == 1) {
        // If we're not in split screen, the splitIds count doesn't really matter since we
        // should always hit this case.
        mRemoteTargetHandles[0].mTransformParams.setTargetSet(targets);
        if (targets.apps.length > 0) {
            // Unclear why/when target.apps length == 0, but it sure does happen :(
            topLeftTarget = targets.apps[0];
            mRemoteTargetHandles[0].mTaskViewSimulator.setPreview(topLeftTarget, null);
        }
    } else {
        // split screen
        topLeftTarget = targets.findTask(splitIds[0]);
        bottomRightTarget = targets.findTask(splitIds[1]);
        // remoteTargetHandle[0] denotes topLeft task, so we pass in the bottomRight to exclude,
        // vice versa
        mStagedSplitBounds = new StagedSplitBounds(topLeftTarget.screenSpaceBounds, bottomRightTarget.screenSpaceBounds, splitIds[0], splitIds[1]);
        mRemoteTargetHandles[0].mTransformParams.setTargetSet(createRemoteAnimationTargetsForTarget(targets, bottomRightTarget));
        mRemoteTargetHandles[0].mTaskViewSimulator.setPreview(topLeftTarget, mStagedSplitBounds);
        mRemoteTargetHandles[1].mTransformParams.setTargetSet(createRemoteAnimationTargetsForTarget(targets, topLeftTarget));
        mRemoteTargetHandles[1].mTaskViewSimulator.setPreview(bottomRightTarget, mStagedSplitBounds);
    }
    return mRemoteTargetHandles;
}
Also used : StagedSplitBounds(com.android.launcher3.util.SplitConfigurationOptions.StagedSplitBounds) RemoteAnimationTargetCompat(com.android.systemui.shared.system.RemoteAnimationTargetCompat)

Aggregations

StagedSplitBounds (com.android.launcher3.util.SplitConfigurationOptions.StagedSplitBounds)4 RemoteAnimationTargetCompat (com.android.systemui.shared.system.RemoteAnimationTargetCompat)4