[Search] Apply background to entire SearchInput view instead of just EditText
Bug: 199555357
Test: visual
Change-Id: Ice966416e901e7c601b44529d0422798e943e222
diff --git a/src/com/android/launcher3/ExtendedEditText.java b/src/com/android/launcher3/ExtendedEditText.java
index 21bc479..92432a8 100644
--- a/src/com/android/launcher3/ExtendedEditText.java
+++ b/src/com/android/launcher3/ExtendedEditText.java
@@ -26,7 +26,6 @@
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
-import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.views.ActivityContext;
@@ -99,18 +98,6 @@
}
}
- /**
- * Sets whether EditText background should be visible
- * @param maxAlpha defines the maximum alpha the background should animates to
- */
- public void setBackgroundVisibility(boolean visible, float maxAlpha) {}
-
- /**
- * Returns whether a visible background is set on EditText
- */
- public boolean getBackgroundVisibility() {
- return getBackground() != null;
- }
public void showKeyboard() {
mShowImeAfterFirstLayout = !showSoftInput();
@@ -150,9 +137,6 @@
if (!TextUtils.isEmpty(getText())) {
setText("");
}
- if (FeatureFlags.ENABLE_DEVICE_SEARCH.get()) {
- return;
- }
if (isFocused()) {
View nextFocus = focusSearch(View.FOCUS_DOWN);
if (nextFocus != null) {
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index e779ee8..424ea22 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -59,7 +59,6 @@
import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
import com.android.launcher3.DragSource;
import com.android.launcher3.DropTarget.DragObject;
-import com.android.launcher3.ExtendedEditText;
import com.android.launcher3.Insettable;
import com.android.launcher3.InsettableFrameLayout;
import com.android.launcher3.R;
@@ -639,6 +638,7 @@
public void onClearSearchResult() {
mIsSearching = false;
+ mHeader.setCollapsed(false);
rebindAdapters();
getActiveRecyclerView().scrollToTop();
}
@@ -814,14 +814,13 @@
invalidateHeader();
}
if (mSearchUiManager.getEditText() != null) {
- ExtendedEditText editText = mSearchUiManager.getEditText();
- boolean bgVisible = editText.getBackgroundVisibility();
+ boolean bgVisible = mSearchUiManager.getBackgroundVisibility();
if (scrolledOffset == 0 && !mIsSearching) {
bgVisible = true;
} else if (scrolledOffset > mHeaderThreshold) {
bgVisible = false;
}
- editText.setBackgroundVisibility(bgVisible, 1 - prog);
+ mSearchUiManager.setBackgroundVisibility(bgVisible, 1 - prog);
}
}
diff --git a/src/com/android/launcher3/allapps/SearchUiManager.java b/src/com/android/launcher3/allapps/SearchUiManager.java
index 924a392..7478b53 100644
--- a/src/com/android/launcher3/allapps/SearchUiManager.java
+++ b/src/com/android/launcher3/allapps/SearchUiManager.java
@@ -49,6 +49,19 @@
ExtendedEditText getEditText();
/**
+ * Sets whether EditText background should be visible
+ * @param maxAlpha defines the maximum alpha the background should animates to
+ */
+ default void setBackgroundVisibility(boolean visible, float maxAlpha) {}
+
+ /**
+ * Returns whether a visible background is set on EditText
+ */
+ default boolean getBackgroundVisibility() {
+ return false;
+ }
+
+ /**
* sets highlight result's title
*/
default void setFocusedResultTitle(@Nullable CharSequence title) { }