mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-16 17:18:21 +00:00
Sending original motion events to launcher overlay along with inferred values
Bug: 273828110 Flag: aconfig use_activity_overlay disabled Test: Manual Change-Id: I23cd72a964a647a0fd830befa096f3328e12ff8a
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.android.systemui.plugins.shared;
|
||||
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/**
|
||||
@@ -47,7 +49,11 @@ public interface LauncherOverlayManager {
|
||||
|
||||
default void onActivityDestroyed() { }
|
||||
|
||||
interface LauncherOverlay {
|
||||
/**
|
||||
* @deprecated use LauncherOverlayTouchProxy directly
|
||||
*/
|
||||
@Deprecated
|
||||
interface LauncherOverlay extends LauncherOverlayTouchProxy {
|
||||
|
||||
/**
|
||||
* Touch interaction leading to overscroll has begun
|
||||
@@ -70,6 +76,38 @@ public interface LauncherOverlayManager {
|
||||
* @param callbacks A set of callbacks provided by Launcher in relation to the overlay
|
||||
*/
|
||||
void setOverlayCallbacks(LauncherOverlayCallbacks callbacks);
|
||||
|
||||
@Override
|
||||
default void onFlingVelocity(float velocity) { }
|
||||
|
||||
@Override
|
||||
default void onOverlayMotionEvent(MotionEvent ev, float scrollProgress) {
|
||||
switch (ev.getAction()) {
|
||||
case MotionEvent.ACTION_DOWN -> onScrollInteractionBegin();
|
||||
case MotionEvent.ACTION_MOVE -> onScrollChange(scrollProgress, false);
|
||||
case MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> onScrollInteractionEnd();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
interface LauncherOverlayTouchProxy {
|
||||
|
||||
/**
|
||||
* Called just before finishing scroll interaction to indicate the fling velocity
|
||||
*/
|
||||
void onFlingVelocity(float velocity);
|
||||
|
||||
/**
|
||||
* Called to dispatch various motion events to the overlay
|
||||
*/
|
||||
void onOverlayMotionEvent(MotionEvent ev, float scrollProgress);
|
||||
|
||||
/**
|
||||
* Called when the launcher is ready to use the overlay
|
||||
* @param callbacks A set of callbacks provided by Launcher in relation to the overlay
|
||||
*/
|
||||
default void setOverlayCallbacks(LauncherOverlayCallbacks callbacks) { }
|
||||
}
|
||||
|
||||
interface LauncherOverlayCallbacks {
|
||||
|
||||
Reference in New Issue
Block a user