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 17 package com.android.systemui.shared.recents; 18 19 import android.view.MotionEvent; 20 import com.android.systemui.shared.recents.ISystemUiProxy; 21 22 oneway interface IOverviewProxy { onBind(in ISystemUiProxy sysUiProxy)23 void onBind(in ISystemUiProxy sysUiProxy); 24 25 /** 26 * Called once immediately prior to the first onMotionEvent() call, providing a hint to the 27 * target the initial source of the subsequent motion events. 28 * 29 * @param downHitTarget is one of the {@link NavigationBarCompat.HitTarget}s 30 */ onPreMotionEvent(int downHitTarget)31 void onPreMotionEvent(int downHitTarget); 32 33 /** 34 * Proxies motion events from the nav bar in SystemUI to the OverviewProxyService. The sender 35 * guarantees the following order of events: 36 * 37 * Normal gesture: DOWN, (MOVE/POINTER_DOWN/POINTER_UP)*, UP 38 * Quick scrub: DOWN, (MOVE/POINTER_DOWN/POINTER_UP)*, SCRUB_START, SCRUB_PROGRESS*, SCRUB_END 39 * 40 * Once quick scrub is sent, then no further motion events will be provided. 41 */ onMotionEvent(in MotionEvent event)42 void onMotionEvent(in MotionEvent event); 43 44 /** 45 * Sent when the user starts to actively scrub the nav bar to switch tasks. Once this event is 46 * sent the caller will stop sending any motion events and will no longer preemptively cancel 47 * any recents animations started as a part of the motion event handling. 48 */ onQuickScrubStart()49 void onQuickScrubStart(); 50 51 /** 52 * Sent when the user stops actively scrubbing the nav bar to switch tasks. 53 */ onQuickScrubEnd()54 void onQuickScrubEnd(); 55 56 /** 57 * Sent for each movement over the nav bar while the user is scrubbing it to switch tasks. 58 */ onQuickScrubProgress(float progress)59 void onQuickScrubProgress(float progress); 60 61 /** 62 * Sent when overview button is pressed to toggle show/hide of overview. 63 */ onOverviewToggle()64 void onOverviewToggle(); 65 66 /** 67 * Sent when overview is to be shown. 68 */ onOverviewShown(boolean triggeredFromAltTab)69 void onOverviewShown(boolean triggeredFromAltTab); 70 71 /** 72 * Sent when overview is to be hidden. 73 */ onOverviewHidden(boolean triggeredFromAltTab, boolean triggeredFromHomeKey)74 void onOverviewHidden(boolean triggeredFromAltTab, boolean triggeredFromHomeKey); 75 76 /** 77 * Sent when a user swipes up over the navigation bar to launch overview. Swipe up is determined 78 * by passing the touch slop in the direction towards launcher from navigation bar. During and 79 * after this event is sent the caller will continue to send motion events. The motion 80 * {@param event} passed after the touch slop was exceeded will also be passed after by 81 * {@link onMotionEvent}. Since motion events will be sent, motion up or cancel can still be 82 * sent to cancel overview regardless the current state of launcher (eg. if overview is already 83 * visible, this event will still be sent if user swipes up). When this signal is sent, 84 * navigation bar will not handle any gestures such as quick scrub and the home button will 85 * cancel (long) press. 86 */ onQuickStep(in MotionEvent event)87 void onQuickStep(in MotionEvent event); 88 89 /** 90 * Sent when there was an action on one of the onboarding tips view. 91 */ onTip(int actionType, int viewType)92 void onTip(int actionType, int viewType); 93 } 94