diff --git a/res/layout/all_apps_prediction_bar_icon.xml b/res/layout/all_apps_prediction_bar_icon.xml index 341d8ef4f8..f15aeaf75c 100644 --- a/res/layout/all_apps_prediction_bar_icon.xml +++ b/res/layout/all_apps_prediction_bar_icon.xml @@ -18,7 +18,7 @@ xmlns:launcher="http://schemas.android.com/apk/res-auto" style="@style/Icon.AllApps" android:id="@+id/icon" - android:layout_width="wrap_content" + android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:paddingTop="@dimen/all_apps_prediction_icon_top_padding" diff --git a/src/com/android/launcher3/testing/LauncherExtension.java b/src/com/android/launcher3/testing/LauncherExtension.java index d5a340dd20..6f1acfefd4 100644 --- a/src/com/android/launcher3/testing/LauncherExtension.java +++ b/src/com/android/launcher3/testing/LauncherExtension.java @@ -1,5 +1,6 @@ package com.android.launcher3.testing; +import android.content.ComponentName; import android.content.Intent; import android.graphics.Color; import android.graphics.Rect; @@ -11,6 +12,7 @@ import android.widget.FrameLayout; import com.android.launcher3.AppInfo; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherCallbacks; +import com.android.launcher3.compat.UserHandleCompat; import com.android.launcher3.logging.UserEventLogger; import com.android.launcher3.allapps.AllAppsSearchBarController; import com.android.launcher3.util.ComponentKey; @@ -280,7 +282,15 @@ public class LauncherExtension extends Launcher { @Override public List getPredictedApps() { - return new ArrayList<>(); + // Return a mock set of predicted apps for UI testing + ArrayList ar = new ArrayList<>(); + for (int i = 0; i < 6; i++) { + ComponentKey ck = new ComponentKey(new ComponentName("com.android.settings", + "com.android.settings.Settings"), UserHandleCompat.myUserHandle()); + ar.add(ck); + } + return ar; + } @Override