Making CellLayout inflatable without LauncherActivtiy
This will allow creating cellLayout with a different device profile
or a different activtiy which can be used when displaying multiple
activities in multi-display or generating a preview for changing
display properties.
Change-Id: I386731d95e33c48bdef270ce9c0d3e9feefb6262
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 36967cd..b6fa071 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -122,6 +122,7 @@
import com.android.launcher3.util.TraceHelper;
import com.android.launcher3.util.UiThreadHelper;
import com.android.launcher3.util.ViewOnDrawExecutor;
+import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.views.OptionsPopupView;
import com.android.launcher3.widget.LauncherAppWidgetHostView;
import com.android.launcher3.widget.PendingAddShortcutInfo;
@@ -940,6 +941,7 @@
mDropTargetBar.setup(mDragController);
mAllAppsController.setupViews(mAppsView);
+ mHotseat.setOnInterceptTouchListener(mWorkspace::onInterceptHotseatTouch);
}
/**
@@ -2392,6 +2394,13 @@
}
/**
+ * Just a wrapper around the type cast to allow easier tracking of calls.
+ */
+ public static <T extends Launcher> T cast(ActivityContext activityContext) {
+ return (T) activityContext;
+ }
+
+ /**
* Callback for listening for onResume
*/
public interface OnResumeCallback {