1 /* 2 * Copyright (C) 2017 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.launcher3.uioverrides.states; 17 18 import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERVIEW; 19 20 import android.content.Context; 21 22 import com.android.launcher3.Launcher; 23 import com.android.launcher3.LauncherState; 24 import com.android.launcher3.R; 25 import com.android.launcher3.util.Themes; 26 27 /** 28 * Definition for overview state 29 */ 30 public class OverviewState extends LauncherState { 31 OverviewState(int id)32 public OverviewState(int id) { 33 super(id, LAUNCHER_STATE_OVERVIEW, FLAG_DISABLE_RESTORE); 34 } 35 36 @Override getTransitionDuration(Context context)37 public int getTransitionDuration(Context context) { 38 return 250; 39 } 40 newBackgroundState(int id)41 public static OverviewState newBackgroundState(int id) { 42 return new OverviewState(id); 43 } 44 newSwitchState(int id)45 public static OverviewState newSwitchState(int id) { 46 return new OverviewState(id); 47 } 48 49 /** 50 * New Overview substate that represents the overview in modal mode (one task shown on its own) 51 */ newModalTaskState(int id)52 public static OverviewState newModalTaskState(int id) { 53 return new OverviewState(id); 54 } 55 56 /** 57 * New Overview substate that represents the overview in modal mode (one task shown on its own) 58 */ newSplitSelectState(int id)59 public static OverviewState newSplitSelectState(int id) { 60 return new OverviewState(id); 61 } 62 63 @Override getWorkspaceScrimColor(Launcher launcher)64 public int getWorkspaceScrimColor(Launcher launcher) { 65 return Themes.getAttrColor(launcher, R.attr.overviewScrimColor); 66 } 67 } 68