Loading res/drawable/bg_widgets_searchbox.xml +1 −1 Original line number Diff line number Diff line Loading @@ -14,6 +14,6 @@ limitations under the License. --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="#FFFFF7" /> <solid android:color="?android:attr/textColorPrimaryInverse" /> <corners android:radius="24dp" /> </shape> No newline at end of file res/layout/widgets_search_bar.xml +4 −1 Original line number Diff line number Diff line Loading @@ -19,12 +19,15 @@ android:hint="@string/widgets_full_sheet_search_bar_hint" android:maxLines="1" android:layout_weight="1" android:inputType="text"/> android:inputType="text" android:textColor="?android:attr/textColorSecondary" android:textColorHint="?android:attr/textColorTertiary"/> <ImageButton android:id="@+id/widgets_search_cancel_button" android:layout_height="wrap_content" android:layout_width="wrap_content" android:padding="8dp" android:src="@drawable/ic_gm_close_24" android:background="?android:selectableItemBackground" android:layout_gravity="center" Loading src/com/android/launcher3/widget/picker/WidgetsFullSheet.java +21 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.animation.AnimatorListenerAdapter; import android.animation.PropertyValuesHolder; import android.content.Context; import android.content.pm.LauncherApps; import android.content.res.Configuration; import android.graphics.Rect; import android.os.Process; import android.os.UserHandle; Loading Loading @@ -232,6 +233,7 @@ public class WidgetsFullSheet extends BaseWidgetSheet mInsets.set(insets); setBottomPadding(mAdapters.get(AdapterHolder.PRIMARY).mWidgetsRecyclerView, insets.bottom); setBottomPadding(mAdapters.get(AdapterHolder.SEARCH).mWidgetsRecyclerView, insets.bottom); if (mHasWorkProfile) { setBottomPadding(mAdapters.get(AdapterHolder.WORK).mWidgetsRecyclerView, insets.bottom); } Loading Loading @@ -276,6 +278,8 @@ public class WidgetsFullSheet extends BaseWidgetSheet int maxSpansPerRow = getMeasuredWidth() / (deviceProfile.cellWidthPx + paddingPx); mAdapters.get(AdapterHolder.PRIMARY).mWidgetsListAdapter.setMaxHorizontalSpansPerRow( maxSpansPerRow); mAdapters.get(AdapterHolder.SEARCH).mWidgetsListAdapter.setMaxHorizontalSpansPerRow( maxSpansPerRow); if (mHasWorkProfile) { mAdapters.get(AdapterHolder.WORK).mWidgetsListAdapter.setMaxHorizontalSpansPerRow( maxSpansPerRow); Loading Loading @@ -471,6 +475,23 @@ public class WidgetsFullSheet extends BaseWidgetSheet + marginLayoutParams.topMargin; } @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); if (mIsInSearchMode) { mSearchAndRecommendationViewHolder.mSearchBar.reset(); } } @Override public boolean onBackPressed() { if (mIsInSearchMode) { mSearchAndRecommendationViewHolder.mSearchBar.reset(); return true; } return super.onBackPressed(); } /** A holder class for holding adapters & their corresponding recycler view. */ private final class AdapterHolder { static final int PRIMARY = 0; Loading src/com/android/launcher3/widget/picker/search/LauncherWidgetsSearchBar.java +5 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,11 @@ public class LauncherWidgetsSearchBar extends LinearLayout implements WidgetsSea algo, mEditText, mCancelButton, searchModeListener); } @Override public void reset() { mController.clearSearchResult(); } @Override protected void onFinishInflate() { super.onFinishInflate(); Loading src/com/android/launcher3/widget/picker/search/WidgetsSearchBar.java +5 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,11 @@ public interface WidgetsSearchBar { */ void initialize(List<WidgetsListBaseEntry> allWidgets, SearchModeListener searchModeListener); /** * Clears search bar. */ void reset(); /** * Sets the vertical location, in pixels, of this search bar relative to its top position. */ Loading Loading
res/drawable/bg_widgets_searchbox.xml +1 −1 Original line number Diff line number Diff line Loading @@ -14,6 +14,6 @@ limitations under the License. --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="#FFFFF7" /> <solid android:color="?android:attr/textColorPrimaryInverse" /> <corners android:radius="24dp" /> </shape> No newline at end of file
res/layout/widgets_search_bar.xml +4 −1 Original line number Diff line number Diff line Loading @@ -19,12 +19,15 @@ android:hint="@string/widgets_full_sheet_search_bar_hint" android:maxLines="1" android:layout_weight="1" android:inputType="text"/> android:inputType="text" android:textColor="?android:attr/textColorSecondary" android:textColorHint="?android:attr/textColorTertiary"/> <ImageButton android:id="@+id/widgets_search_cancel_button" android:layout_height="wrap_content" android:layout_width="wrap_content" android:padding="8dp" android:src="@drawable/ic_gm_close_24" android:background="?android:selectableItemBackground" android:layout_gravity="center" Loading
src/com/android/launcher3/widget/picker/WidgetsFullSheet.java +21 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.animation.AnimatorListenerAdapter; import android.animation.PropertyValuesHolder; import android.content.Context; import android.content.pm.LauncherApps; import android.content.res.Configuration; import android.graphics.Rect; import android.os.Process; import android.os.UserHandle; Loading Loading @@ -232,6 +233,7 @@ public class WidgetsFullSheet extends BaseWidgetSheet mInsets.set(insets); setBottomPadding(mAdapters.get(AdapterHolder.PRIMARY).mWidgetsRecyclerView, insets.bottom); setBottomPadding(mAdapters.get(AdapterHolder.SEARCH).mWidgetsRecyclerView, insets.bottom); if (mHasWorkProfile) { setBottomPadding(mAdapters.get(AdapterHolder.WORK).mWidgetsRecyclerView, insets.bottom); } Loading Loading @@ -276,6 +278,8 @@ public class WidgetsFullSheet extends BaseWidgetSheet int maxSpansPerRow = getMeasuredWidth() / (deviceProfile.cellWidthPx + paddingPx); mAdapters.get(AdapterHolder.PRIMARY).mWidgetsListAdapter.setMaxHorizontalSpansPerRow( maxSpansPerRow); mAdapters.get(AdapterHolder.SEARCH).mWidgetsListAdapter.setMaxHorizontalSpansPerRow( maxSpansPerRow); if (mHasWorkProfile) { mAdapters.get(AdapterHolder.WORK).mWidgetsListAdapter.setMaxHorizontalSpansPerRow( maxSpansPerRow); Loading Loading @@ -471,6 +475,23 @@ public class WidgetsFullSheet extends BaseWidgetSheet + marginLayoutParams.topMargin; } @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); if (mIsInSearchMode) { mSearchAndRecommendationViewHolder.mSearchBar.reset(); } } @Override public boolean onBackPressed() { if (mIsInSearchMode) { mSearchAndRecommendationViewHolder.mSearchBar.reset(); return true; } return super.onBackPressed(); } /** A holder class for holding adapters & their corresponding recycler view. */ private final class AdapterHolder { static final int PRIMARY = 0; Loading
src/com/android/launcher3/widget/picker/search/LauncherWidgetsSearchBar.java +5 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,11 @@ public class LauncherWidgetsSearchBar extends LinearLayout implements WidgetsSea algo, mEditText, mCancelButton, searchModeListener); } @Override public void reset() { mController.clearSearchResult(); } @Override protected void onFinishInflate() { super.onFinishInflate(); Loading
src/com/android/launcher3/widget/picker/search/WidgetsSearchBar.java +5 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,11 @@ public interface WidgetsSearchBar { */ void initialize(List<WidgetsListBaseEntry> allWidgets, SearchModeListener searchModeListener); /** * Clears search bar. */ void reset(); /** * Sets the vertical location, in pixels, of this search bar relative to its top position. */ Loading