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 17 package com.android.systemui.shared.system.smartspace; 18 19 import android.graphics.Rect; 20 import com.android.systemui.shared.system.smartspace.SmartspaceState; 21 22 // Methods for System UI to interface with Launcher to perform the unlock animation. 23 interface ILauncherUnlockAnimationController { 24 // Prepares Launcher for the unlock animation by setting scale/alpha/etc. to their starting 25 // values. prepareForUnlock(boolean animateSmartspace, in Rect lockscreenSmartspaceBounds, int selectedPage)26 void prepareForUnlock(boolean animateSmartspace, in Rect lockscreenSmartspaceBounds, 27 int selectedPage); 28 29 // Set the unlock percentage. This is used when System UI is controlling each frame of the 30 // unlock animation, such as during a swipe to unlock touch gesture. Will not apply this change 31 // if the unlock amount is animating unless forceIfAnimating is true. setUnlockAmount(float amount, boolean forceIfAnimating)32 oneway void setUnlockAmount(float amount, boolean forceIfAnimating); 33 34 // Play a full unlock animation from 0f to 1f. This is used when System UI is unlocking from a 35 // single action, such as biometric auth, and doesn't need to control individual frames. playUnlockAnimation(boolean unlocked, long duration, long startDelay)36 oneway void playUnlockAnimation(boolean unlocked, long duration, long startDelay); 37 38 // Set the selected page on Launcher's smartspace. setSmartspaceSelectedPage(int selectedPage)39 oneway void setSmartspaceSelectedPage(int selectedPage); 40 41 // Set the visibility of Launcher's smartspace. setSmartspaceVisibility(int visibility)42 void setSmartspaceVisibility(int visibility); 43 44 // Tell SystemUI the smartspace's current state. Launcher code should call this whenever the 45 // smartspace state may have changed. dispatchSmartspaceStateToSysui()46 oneway void dispatchSmartspaceStateToSysui(); 47 }