summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/allapps
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-07-18 04:25:55 -0700
committerSunny Goyal <sunnygoyal@google.com>2017-07-19 11:03:35 -0700
commit2b50b53183b8163744248c0001ea93f61570ed7b (patch)
treeb00561e3681110f6402f5418e8c32ed74eae85fe /src/com/android/launcher3/allapps
parent751ea1c10e8e2348a9c0d0a22f8b9df3c9416c1f (diff)
downloadandroid_packages_apps_Trebuchet-2b50b53183b8163744248c0001ea93f61570ed7b.tar.gz
android_packages_apps_Trebuchet-2b50b53183b8163744248c0001ea93f61570ed7b.tar.bz2
android_packages_apps_Trebuchet-2b50b53183b8163744248c0001ea93f61570ed7b.zip
Updating UserEventDispatcher to make some methods accessible.
> Removing helper methods around fillInLogContainerData so that its easier to create events with 3 and more srcTargets > Removing setPredictedApps from userEventDispatcher as its specific to Launcher and does not apply to other activities. Instead moving it to AllAppsRecyclerView Bug: 63719473 Change-Id: Ib92621e41ede4ffe03892642ab173772b5a84dd1
Diffstat (limited to 'src/com/android/launcher3/allapps')
-rw-r--r--src/com/android/launcher3/allapps/AllAppsContainerView.java2
-rw-r--r--src/com/android/launcher3/allapps/AllAppsRecyclerView.java16
2 files changed, 12 insertions, 6 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index ccef4f2f5..20951921c 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -359,7 +359,7 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
@Override
public void fillInLogContainerData(View v, ItemInfo info, Target target, Target targetParent) {
- targetParent.containerType = mAppsRecyclerView.getContainerType(v);
+ // This is filled in {@link AllAppsRecyclerView}
}
@Override
diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
index fb785fbb0..25144584e 100644
--- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
@@ -30,18 +30,21 @@ import android.view.View;
import com.android.launcher3.BaseRecyclerView;
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.DeviceProfile;
+import com.android.launcher3.ItemInfo;
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.logging.UserEventDispatcher.LogContainerProvider;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
+import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
import java.util.List;
/**
* A RecyclerView with custom fast scroll support for the all apps view.
*/
-public class AllAppsRecyclerView extends BaseRecyclerView {
+public class AllAppsRecyclerView extends BaseRecyclerView implements LogContainerProvider {
private AlphabeticalAppsList mApps;
private AllAppsFastScrollHelper mFastScrollHelper;
@@ -231,9 +234,10 @@ public class AllAppsRecyclerView extends BaseRecyclerView {
updateEmptySearchBackgroundBounds();
}
- public int getContainerType(View v) {
+ @Override
+ public void fillInLogContainerData(View v, ItemInfo info, Target target, Target targetParent) {
if (mApps.hasFilter()) {
- return ContainerType.SEARCHRESULT;
+ targetParent.containerType = ContainerType.SEARCHRESULT;
} else {
if (v instanceof BubbleTextView) {
BubbleTextView icon = (BubbleTextView) v;
@@ -242,11 +246,13 @@ public class AllAppsRecyclerView extends BaseRecyclerView {
List<AlphabeticalAppsList.AdapterItem> items = mApps.getAdapterItems();
AlphabeticalAppsList.AdapterItem item = items.get(position);
if (item.viewType == AllAppsGridAdapter.VIEW_TYPE_PREDICTION_ICON) {
- return ContainerType.PREDICTION;
+ targetParent.containerType = ContainerType.PREDICTION;
+ target.predictedRank = item.rowAppIndex;
+ return;
}
}
}
- return ContainerType.ALLAPPS;
+ targetParent.containerType = ContainerType.ALLAPPS;
}
}