1 /* 2 * Copyright (C) 2021 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.wm.shell.common.split; 17 18 import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD; 19 import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN; 20 import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW; 21 import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; 22 import static android.window.TransitionInfo.FLAG_FIRST_CUSTOM; 23 24 import android.annotation.IntDef; 25 26 /** Helper utility class of methods and constants that are available to be imported in Launcher. */ 27 public class SplitScreenConstants { 28 29 /** 30 * Split position isn't specified normally meaning to use what ever it is currently set to. 31 */ 32 public static final int SPLIT_POSITION_UNDEFINED = -1; 33 34 /** 35 * Specifies that a split is positioned at the top half of the screen if 36 * in portrait mode or at the left half of the screen if in landscape mode. 37 */ 38 public static final int SPLIT_POSITION_TOP_OR_LEFT = 0; 39 40 /** 41 * Specifies that a split is positioned at the bottom half of the screen if 42 * in portrait mode or at the right half of the screen if in landscape mode. 43 */ 44 public static final int SPLIT_POSITION_BOTTOM_OR_RIGHT = 1; 45 46 @IntDef(prefix = {"SPLIT_POSITION_"}, value = { 47 SPLIT_POSITION_UNDEFINED, 48 SPLIT_POSITION_TOP_OR_LEFT, 49 SPLIT_POSITION_BOTTOM_OR_RIGHT 50 }) 51 public @interface SplitPosition { 52 } 53 54 public static final int[] CONTROLLED_ACTIVITY_TYPES = {ACTIVITY_TYPE_STANDARD}; 55 public static final int[] CONTROLLED_WINDOWING_MODES = 56 {WINDOWING_MODE_FULLSCREEN, WINDOWING_MODE_UNDEFINED}; 57 public static final int[] CONTROLLED_WINDOWING_MODES_WHEN_ACTIVE = 58 {WINDOWING_MODE_FULLSCREEN, WINDOWING_MODE_UNDEFINED, WINDOWING_MODE_MULTI_WINDOW}; 59 60 /** Flag applied to a transition change to identify it as a divider bar for animation. */ 61 public static final int FLAG_IS_DIVIDER_BAR = FLAG_FIRST_CUSTOM; 62 } 63