mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 17:06:49 +00:00
Add physics motion to items in all apps.
Motion applied to: - Icons - Prediction icons - Prediction divider Bug: 38349031 Change-Id: I376e6e39080c8c80463a0ce8b104b05e4d576f17
This commit is contained in:
@@ -28,8 +28,8 @@ import android.view.View;
|
||||
import com.android.launcher3.BaseRecyclerView;
|
||||
import com.android.launcher3.BubbleTextView;
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.anim.SpringAnimationHandler;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.launcher3.graphics.DrawableFactory;
|
||||
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
|
||||
@@ -53,6 +53,8 @@ public class AllAppsRecyclerView extends BaseRecyclerView {
|
||||
private AllAppsBackgroundDrawable mEmptySearchBackground;
|
||||
private int mEmptySearchBackgroundTopOffset;
|
||||
|
||||
private SpringAnimationHandler mSpringAnimationHandler;
|
||||
|
||||
public AllAppsRecyclerView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
@@ -75,6 +77,18 @@ public class AllAppsRecyclerView extends BaseRecyclerView {
|
||||
R.dimen.all_apps_empty_search_bg_top_offset);
|
||||
}
|
||||
|
||||
public void setSpringAnimationHandler(SpringAnimationHandler springAnimationHandler) {
|
||||
mSpringAnimationHandler = springAnimationHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent e) {
|
||||
if (FeatureFlags.LAUNCHER3_PHYSICS && mSpringAnimationHandler != null) {
|
||||
mSpringAnimationHandler.addMovement(e);
|
||||
}
|
||||
return super.onTouchEvent(e);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the list of apps in this view, used to determine the fastscroll position.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user