summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/allapps/search
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2019-05-29 01:09:06 -0700
committerSunny Goyal <sunnygoyal@google.com>2019-06-13 10:39:46 -0700
commit5b636ebfd4a8a2ef53a11d0190c59dd0fb9aad75 (patch)
tree1760e85afd070e4b4d57a38f8ae5687ef3bffe57 /src/com/android/launcher3/allapps/search
parent3d6e96d5265cdea78ad4e01b0f9fde0eea539094 (diff)
downloadandroid_packages_apps_Trebuchet-5b636ebfd4a8a2ef53a11d0190c59dd0fb9aad75.tar.gz
android_packages_apps_Trebuchet-5b636ebfd4a8a2ef53a11d0190c59dd0fb9aad75.tar.bz2
android_packages_apps_Trebuchet-5b636ebfd4a8a2ef53a11d0190c59dd0fb9aad75.zip
Optimizing some layouts in taskview
> Recycling DigitalWellBeingToast so that the view is not inflated everytime > Simplifying DigitalWellBeingToast to use a single text view > Adding support for footers in taskView without creating additional layout Bug: 122345781 Change-Id: Ia889819b93eb8644532ea95c6767554874d5e2d1
Diffstat (limited to 'src/com/android/launcher3/allapps/search')
-rw-r--r--src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
index 1ff484b49..31fcc8c64 100644
--- a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
+++ b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
@@ -20,6 +20,7 @@ import static android.view.View.MeasureSpec.getSize;
import static android.view.View.MeasureSpec.makeMeasureSpec;
import static com.android.launcher3.LauncherState.ALL_APPS_HEADER;
+import static com.android.launcher3.Utilities.prefixTextWithIcon;
import static com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR;
import android.content.Context;
@@ -40,6 +41,7 @@ import com.android.launcher3.ExtendedEditText;
import com.android.launcher3.Insettable;
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
+import com.android.launcher3.Utilities;
import com.android.launcher3.allapps.AllAppsContainerView;
import com.android.launcher3.allapps.AllAppsStore;
import com.android.launcher3.allapps.AlphabeticalAppsList;
@@ -89,14 +91,7 @@ public class AppsSearchContainerLayout extends ExtendedEditText
mFixedTranslationY = getTranslationY();
mMarginTopAdjusting = mFixedTranslationY - getPaddingTop();
- // Update the hint to contain the icon.
- // Prefix the original hint with two spaces. The first space gets replaced by the icon
- // using span. The second space is used for a singe space character between the hint
- // and the icon.
- SpannableString spanned = new SpannableString(" " + getHint());
- spanned.setSpan(new TintedDrawableSpan(getContext(), R.drawable.ic_allapps_search),
- 0, 1, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
- setHint(spanned);
+ setHint(prefixTextWithIcon(getContext(), R.drawable.ic_allapps_search, getHint()));
}
@Override