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

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

Merge "Update split resizing transition to match design" into sc-v2-dev

parents 2ef09f9c 222c9d38
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2021 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="match_parent"
    android:layout_width="match_parent">

    <ImageView android:id="@+id/split_resizing_icon"
               android:layout_height="wrap_content"
               android:layout_width="wrap_content"
               android:layout_gravity="center"
               android:padding="0dp"
               android:visibility="gone"
               android:background="@null"/>

</FrameLayout>
+15 −14
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2021 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
<!--
  ~ Copyright (C) 2021 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
+0 −14
Original line number Diff line number Diff line
@@ -103,8 +103,6 @@ public final class ShellCommandHandlerImpl {
                return runMoveToSideStage(args, pw);
            case "removeFromSideStage":
                return runRemoveFromSideStage(args, pw);
            case "setSideStageOutline":
                return runSetSideStageOutline(args, pw);
            case "setSideStagePosition":
                return runSetSideStagePosition(args, pw);
            case "setSideStageVisibility":
@@ -163,18 +161,6 @@ public final class ShellCommandHandlerImpl {
        return true;
    }

    private boolean runSetSideStageOutline(String[] args, PrintWriter pw) {
        if (args.length < 3) {
            // First arguments are "WMShell" and command name.
            pw.println("Error: whether to enable or disable side stage outline border should be"
                    + " provided as arguments");
            return false;
        }
        final boolean enable = new Boolean(args[2]);
        mSplitScreenOptional.ifPresent(split -> split.setSideStageOutline(enable));
        return true;
    }

    private boolean runSetSideStagePosition(String[] args, PrintWriter pw) {
        if (args.length < 3) {
            // First arguments are "WMShell" and command name.
+2 −1
Original line number Diff line number Diff line
@@ -131,7 +131,8 @@ class AppPair implements ShellTaskOrganizer.TaskListener, SplitLayout.SplitLayou
        mSplitLayout = new SplitLayout(TAG + "SplitDivider",
                mDisplayController.getDisplayContext(mRootTaskInfo.displayId),
                mRootTaskInfo.configuration, this /* layoutChangeListener */,
                mParentContainerCallbacks, mDisplayImeController, mController.getTaskOrganizer());
                mParentContainerCallbacks, mDisplayImeController, mController.getTaskOrganizer(),
                true /* applyDismissingParallax */);
        mDisplayInsetsController.addInsetsChangedListener(mRootTaskInfo.displayId, mSplitLayout);

        final WindowContainerToken token1 = task1.token;
+11 −5
Original line number Diff line number Diff line
@@ -23,16 +23,22 @@ import android.view.SurfaceSession;
 * Helpers for handling surface.
 */
public class SurfaceUtils {
    /** Creates a dim layer above indicated host surface. */
    /** Creates a dim layer above host surface. */
    public static SurfaceControl makeDimLayer(SurfaceControl.Transaction t, SurfaceControl host,
            String name, SurfaceSession surfaceSession) {
        SurfaceControl dimLayer = new SurfaceControl.Builder(surfaceSession)
        final SurfaceControl dimLayer = makeColorLayer(host, name, surfaceSession);
        t.setLayer(dimLayer, Integer.MAX_VALUE).setColor(dimLayer, new float[]{0f, 0f, 0f});
        return dimLayer;
    }

    /** Creates a color layer for host surface. */
    public static SurfaceControl makeColorLayer(SurfaceControl host, String name,
            SurfaceSession surfaceSession) {
        return new SurfaceControl.Builder(surfaceSession)
                .setParent(host)
                .setColorLayer()
                .setName(name)
                .setCallsite("SurfaceUtils.makeDimLayer")
                .setCallsite("SurfaceUtils.makeColorLayer")
                .build();
        t.setLayer(dimLayer, Integer.MAX_VALUE).setColor(dimLayer, new float[]{0f, 0f, 0f});
        return dimLayer;
    }
}
Loading