Merge "Fix UI bugs for widget picker search." into sc-dev am: df9582e559
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14167727 Change-Id: Ia714fbf0f6d9e503430829654298e7f054ceecb5
This commit is contained in:
@@ -17,7 +17,8 @@
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
android:viewportWidth="24.0"
|
||||
android:autoMirrored="true">
|
||||
<path
|
||||
android:fillColor="?android:attr/textColorTertiary"
|
||||
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z" />
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
android:id="@+id/widgets_search_bar_edit_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="12dp"
|
||||
android:paddingVertical="12dp"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:drawablePadding="8dp"
|
||||
android:drawableStart="@drawable/ic_allapps_search"
|
||||
android:background="@null"
|
||||
@@ -21,6 +23,7 @@
|
||||
android:maxLines="1"
|
||||
android:layout_weight="1"
|
||||
android:inputType="text"
|
||||
android:imeOptions="actionSearch"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textColorHint="?android:attr/textColorTertiary"/>
|
||||
|
||||
@@ -28,7 +31,9 @@
|
||||
android:id="@+id/widgets_search_cancel_button"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:paddingVertical="12dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:src="@drawable/ic_gm_close_24"
|
||||
android:background="?android:selectableItemBackground"
|
||||
android:layout_gravity="center"
|
||||
|
||||
@@ -392,6 +392,7 @@ public class WidgetsFullSheet extends BaseWidgetSheet
|
||||
mAdapters.get(AdapterHolder.SEARCH).mWidgetsListAdapter.setWidgetsOnSearch(entries);
|
||||
updateNoSearchResultsView(
|
||||
mAdapters.get(AdapterHolder.SEARCH).mWidgetsListAdapter.getItemCount() == 0);
|
||||
mAdapters.get(AdapterHolder.SEARCH).mWidgetsRecyclerView.scrollToTop();
|
||||
}
|
||||
|
||||
private void setViewVisibilityBasedOnSearch(boolean isInSearchMode) {
|
||||
|
||||
@@ -243,4 +243,19 @@ public class WidgetsRecyclerView extends BaseRecyclerView implements OnItemTouch
|
||||
*/
|
||||
int getHeaderViewHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scrollToTop() {
|
||||
if (mScrollbar != null) {
|
||||
mScrollbar.reattachThumbToScroll();
|
||||
}
|
||||
|
||||
if (getLayoutManager() instanceof LinearLayoutManager) {
|
||||
if (getCurrentScrollY() == 0) {
|
||||
// We are at the top, so don't scrollToPosition (would cause unnecessary relayout).
|
||||
return;
|
||||
}
|
||||
}
|
||||
scrollToPosition(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ public class WidgetsSearchBarController implements TextWatcher,
|
||||
@Override
|
||||
public void clearSearchResult() {
|
||||
mSearchAlgorithm.cancel(/* interruptActiveRequests= */ true);
|
||||
mInput.getText().clear();
|
||||
mInput.setText("");
|
||||
clearFocus();
|
||||
mSearchModeListener.exitSearchMode();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user