113dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng/*
213dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng * Copyright (C) 2017 The Android Open Source Project
313dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng *
413dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng * Licensed under the Apache License, Version 2.0 (the "License");
513dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng * you may not use this file except in compliance with the License.
613dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng * You may obtain a copy of the License at
713dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng *
813dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng *      http://www.apache.org/licenses/LICENSE-2.0
913dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng *
1013dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng * Unless required by applicable law or agreed to in writing, software
1113dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng * distributed under the License is distributed on an "AS IS" BASIS,
1213dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng * See the License for the specific language governing permissions and
1413dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng * limitations under the License.
1513dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng */
1613dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng
1738d31c211b6dad8368fb4bcb3f3a3d5555be6397Winson Chungpackage com.android.systemui.shared.recents;
1813dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng
1913dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ngimport android.view.MotionEvent;
2038d31c211b6dad8368fb4bcb3f3a3d5555be6397Winson Chungimport com.android.systemui.shared.recents.ISystemUiProxy;
2113dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng
2213dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ngoneway interface IOverviewProxy {
2338d31c211b6dad8368fb4bcb3f3a3d5555be6397Winson Chung    void onBind(in ISystemUiProxy sysUiProxy);
244965884784468e42485fbd52335905a56a6d7c5aWinson Chung
254965884784468e42485fbd52335905a56a6d7c5aWinson Chung    /**
26c4e062015dc5a89d8a81e85028202d6d1837ac62Winson Chung     * Called once immediately prior to the first onMotionEvent() call, providing a hint to the
27c4e062015dc5a89d8a81e85028202d6d1837ac62Winson Chung     * target the initial source of the subsequent motion events.
28c4e062015dc5a89d8a81e85028202d6d1837ac62Winson Chung     *
29c4e062015dc5a89d8a81e85028202d6d1837ac62Winson Chung     * @param downHitTarget is one of the {@link NavigationBarCompat.HitTarget}s
30c4e062015dc5a89d8a81e85028202d6d1837ac62Winson Chung     */
31c4e062015dc5a89d8a81e85028202d6d1837ac62Winson Chung    void onPreMotionEvent(int downHitTarget);
32c4e062015dc5a89d8a81e85028202d6d1837ac62Winson Chung
33c4e062015dc5a89d8a81e85028202d6d1837ac62Winson Chung    /**
344965884784468e42485fbd52335905a56a6d7c5aWinson Chung     * Proxies motion events from the nav bar in SystemUI to the OverviewProxyService. The sender
354965884784468e42485fbd52335905a56a6d7c5aWinson Chung     * guarantees the following order of events:
364965884784468e42485fbd52335905a56a6d7c5aWinson Chung     *
374965884784468e42485fbd52335905a56a6d7c5aWinson Chung     * Normal gesture: DOWN, (MOVE/POINTER_DOWN/POINTER_UP)*, UP
384965884784468e42485fbd52335905a56a6d7c5aWinson Chung     * Quick scrub: DOWN, (MOVE/POINTER_DOWN/POINTER_UP)*, SCRUB_START, SCRUB_PROGRESS*, SCRUB_END
394965884784468e42485fbd52335905a56a6d7c5aWinson Chung     *
40fba396946326323b40f9580eb7db243ab9ea1099Matthew Ng     * Once quick scrub is sent, then no further motion events will be provided.
414965884784468e42485fbd52335905a56a6d7c5aWinson Chung     */
4213dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng    void onMotionEvent(in MotionEvent event);
434965884784468e42485fbd52335905a56a6d7c5aWinson Chung
444965884784468e42485fbd52335905a56a6d7c5aWinson Chung    /**
454965884784468e42485fbd52335905a56a6d7c5aWinson Chung     * Sent when the user starts to actively scrub the nav bar to switch tasks. Once this event is
4658bd439042d8b5dfc2702649fbac3f5bb321b894Winson Chung     * sent the caller will stop sending any motion events and will no longer preemptively cancel
4758bd439042d8b5dfc2702649fbac3f5bb321b894Winson Chung     * any recents animations started as a part of the motion event handling.
484965884784468e42485fbd52335905a56a6d7c5aWinson Chung     */
49a8f2426df625915553c3d85af8e6241f47fdf160Matthew Ng    void onQuickScrubStart();
504965884784468e42485fbd52335905a56a6d7c5aWinson Chung
514965884784468e42485fbd52335905a56a6d7c5aWinson Chung    /**
5258bd439042d8b5dfc2702649fbac3f5bb321b894Winson Chung     * Sent when the user stops actively scrubbing the nav bar to switch tasks.
534965884784468e42485fbd52335905a56a6d7c5aWinson Chung     */
54a8f2426df625915553c3d85af8e6241f47fdf160Matthew Ng    void onQuickScrubEnd();
554965884784468e42485fbd52335905a56a6d7c5aWinson Chung
564965884784468e42485fbd52335905a56a6d7c5aWinson Chung    /**
5758bd439042d8b5dfc2702649fbac3f5bb321b894Winson Chung     * Sent for each movement over the nav bar while the user is scrubbing it to switch tasks.
584965884784468e42485fbd52335905a56a6d7c5aWinson Chung     */
59a8f2426df625915553c3d85af8e6241f47fdf160Matthew Ng    void onQuickScrubProgress(float progress);
608a8c89ce402b46ede6ec4cb2fbd9d7a40e2a2e7fMatthew Ng
618a8c89ce402b46ede6ec4cb2fbd9d7a40e2a2e7fMatthew Ng    /**
628a8c89ce402b46ede6ec4cb2fbd9d7a40e2a2e7fMatthew Ng     * Sent when overview button is pressed to toggle show/hide of overview.
638a8c89ce402b46ede6ec4cb2fbd9d7a40e2a2e7fMatthew Ng     */
648a8c89ce402b46ede6ec4cb2fbd9d7a40e2a2e7fMatthew Ng    void onOverviewToggle();
658a8c89ce402b46ede6ec4cb2fbd9d7a40e2a2e7fMatthew Ng
668a8c89ce402b46ede6ec4cb2fbd9d7a40e2a2e7fMatthew Ng    /**
678a8c89ce402b46ede6ec4cb2fbd9d7a40e2a2e7fMatthew Ng     * Sent when overview is to be shown.
688a8c89ce402b46ede6ec4cb2fbd9d7a40e2a2e7fMatthew Ng     */
698a8c89ce402b46ede6ec4cb2fbd9d7a40e2a2e7fMatthew Ng    void onOverviewShown(boolean triggeredFromAltTab);
708a8c89ce402b46ede6ec4cb2fbd9d7a40e2a2e7fMatthew Ng
718a8c89ce402b46ede6ec4cb2fbd9d7a40e2a2e7fMatthew Ng    /**
728a8c89ce402b46ede6ec4cb2fbd9d7a40e2a2e7fMatthew Ng     * Sent when overview is to be hidden.
738a8c89ce402b46ede6ec4cb2fbd9d7a40e2a2e7fMatthew Ng     */
748a8c89ce402b46ede6ec4cb2fbd9d7a40e2a2e7fMatthew Ng    void onOverviewHidden(boolean triggeredFromAltTab, boolean triggeredFromHomeKey);
752ea93b708dbc49235b42e76a587d5f353638040fMatthew Ng
762ea93b708dbc49235b42e76a587d5f353638040fMatthew Ng    /**
772ea93b708dbc49235b42e76a587d5f353638040fMatthew Ng     * Sent when a user swipes up over the navigation bar to launch overview. Swipe up is determined
782ea93b708dbc49235b42e76a587d5f353638040fMatthew Ng     * by passing the touch slop in the direction towards launcher from navigation bar. During and
792ea93b708dbc49235b42e76a587d5f353638040fMatthew Ng     * after this event is sent the caller will continue to send motion events. The motion
802ea93b708dbc49235b42e76a587d5f353638040fMatthew Ng     * {@param event} passed after the touch slop was exceeded will also be passed after by
812ea93b708dbc49235b42e76a587d5f353638040fMatthew Ng     * {@link onMotionEvent}. Since motion events will be sent, motion up or cancel can still be
822ea93b708dbc49235b42e76a587d5f353638040fMatthew Ng     * sent to cancel overview regardless the current state of launcher (eg. if overview is already
832ea93b708dbc49235b42e76a587d5f353638040fMatthew Ng     * visible, this event will still be sent if user swipes up). When this signal is sent,
84fba396946326323b40f9580eb7db243ab9ea1099Matthew Ng     * navigation bar will not handle any gestures such as quick scrub and the home button will
85fba396946326323b40f9580eb7db243ab9ea1099Matthew Ng     * cancel (long) press.
862ea93b708dbc49235b42e76a587d5f353638040fMatthew Ng     */
872ea93b708dbc49235b42e76a587d5f353638040fMatthew Ng    void onQuickStep(in MotionEvent event);
88b96238a120b3b44f28ab66f72ae0b4c52ed1edf5Hyunyoung Song
89b96238a120b3b44f28ab66f72ae0b4c52ed1edf5Hyunyoung Song    /**
90b96238a120b3b44f28ab66f72ae0b4c52ed1edf5Hyunyoung Song     * Sent when there was an action on one of the onboarding tips view.
91b96238a120b3b44f28ab66f72ae0b4c52ed1edf5Hyunyoung Song     */
92b96238a120b3b44f28ab66f72ae0b4c52ed1edf5Hyunyoung Song    void onTip(int actionType, int viewType);
9313dbf878bd2521ae16ef6df644f1bcbf63d16a01Matthew Ng}
94