resolve merge conflicts of fb4014daa3 to ub-launcher3-master.
Change-Id: I6d84a7f3fad757bf139b6ea0001ac6ab88850996
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java
index 142932f..da32e7e 100644
--- a/src/com/android/launcher3/Folder.java
+++ b/src/com/android/launcher3/Folder.java
@@ -1362,7 +1362,7 @@
}
@Override
- public void fillInLaunchSourceData(Bundle sourceData) {
+ public void fillInLaunchSourceData(View v, Bundle sourceData) {
// Fill in from the folder icon's launch source provider first
Stats.LaunchSourceUtils.populateSourceDataFromAncestorProvider(mFolderIcon, sourceData);
sourceData.putString(Stats.SOURCE_EXTRA_SUB_CONTAINER, Stats.SUB_CONTAINER_FOLDER);
diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java
index 98912f5..902b6ec 100644
--- a/src/com/android/launcher3/Hotseat.java
+++ b/src/com/android/launcher3/Hotseat.java
@@ -23,6 +23,7 @@
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.MotionEvent;
+import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
@@ -153,7 +154,7 @@
}
@Override
- public void fillInLaunchSourceData(Bundle sourceData) {
+ public void fillInLaunchSourceData(View v, Bundle sourceData) {
sourceData.putString(Stats.SOURCE_EXTRA_CONTAINER, Stats.CONTAINER_HOTSEAT);
}
}
diff --git a/src/com/android/launcher3/Stats.java b/src/com/android/launcher3/Stats.java
index 4aba150..59feeb7 100644
--- a/src/com/android/launcher3/Stats.java
+++ b/src/com/android/launcher3/Stats.java
@@ -33,7 +33,7 @@
* Implemented by containers to provide a launch source for a given child.
*/
public interface LaunchSourceProvider {
- void fillInLaunchSourceData(Bundle sourceData);
+ void fillInLaunchSourceData(View v, Bundle sourceData);
}
/**
@@ -72,7 +72,7 @@
}
if (provider != null) {
- provider.fillInLaunchSourceData(sourceData);
+ provider.fillInLaunchSourceData(v, sourceData);
} else if (ProviderConfig.IS_DOGFOOD_BUILD) {
throw new RuntimeException("Expected LaunchSourceProvider");
}
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 66f7cb1..4efa21f 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -4393,7 +4393,7 @@
}
@Override
- public void fillInLaunchSourceData(Bundle sourceData) {
+ public void fillInLaunchSourceData(View v, Bundle sourceData) {
sourceData.putString(Stats.SOURCE_EXTRA_CONTAINER, Stats.CONTAINER_HOMESCREEN);
sourceData.putInt(Stats.SOURCE_EXTRA_CONTAINER_PAGE, getCurrentPage());
}
diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
index 48b9494..1cb03c9 100644
--- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
@@ -25,6 +25,7 @@
import android.view.View;
import com.android.launcher3.BaseRecyclerView;
+import com.android.launcher3.BubbleTextView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.Stats;
@@ -155,12 +156,25 @@
}
@Override
- public void fillInLaunchSourceData(Bundle sourceData) {
+ public void fillInLaunchSourceData(View v, Bundle sourceData) {
sourceData.putString(Stats.SOURCE_EXTRA_CONTAINER, Stats.CONTAINER_ALL_APPS);
if (mApps.hasFilter()) {
sourceData.putString(Stats.SOURCE_EXTRA_SUB_CONTAINER,
Stats.SUB_CONTAINER_ALL_APPS_SEARCH);
} else {
+ if (v instanceof BubbleTextView) {
+ BubbleTextView icon = (BubbleTextView) v;
+ int position = getChildPosition(icon);
+ if (position != NO_POSITION) {
+ List<AlphabeticalAppsList.AdapterItem> items = mApps.getAdapterItems();
+ AlphabeticalAppsList.AdapterItem item = items.get(position);
+ if (item.viewType == AllAppsGridAdapter.PREDICTION_ICON_VIEW_TYPE) {
+ sourceData.putString(Stats.SOURCE_EXTRA_SUB_CONTAINER,
+ Stats.SUB_CONTAINER_ALL_APPS_PREDICTION);
+ return;
+ }
+ }
+ }
sourceData.putString(Stats.SOURCE_EXTRA_SUB_CONTAINER,
Stats.SUB_CONTAINER_ALL_APPS_A_Z);
}