Loading res/layout/all_apps_search_market.xml +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ android:fontFamily="sans-serif-medium" android:textSize="14sp" android:textColor="@color/launcher_accent_color" android:text="@string/all_apps_search_market_message" android:textAllCaps="true" android:focusable="true" android:background="@drawable/all_apps_search_market_bg" /> res/values/strings.xml +2 −3 Original line number Diff line number Diff line Loading @@ -52,9 +52,8 @@ <string name="all_apps_loading_message">Loading Apps…</string> <!-- No-search-results text. [CHAR_LIMIT=50] --> <string name="all_apps_no_search_results">No Apps found matching \"<xliff:g id="query" example="Android">%1$s</xliff:g>\"</string> <!-- Search market text. This is a format string where the first argument is the name of the activity handling the search. The format string does not need to handle both of these arguments. [CHAR_LIMIT=50] --> <string name="all_apps_search_market_message">Go to <xliff:g id="query" example="Play Store">%1$s</xliff:g></string> <!-- Label for the button which allows the user to get app search results. [CHAR_LIMIT=50] --> <string name="all_apps_search_market_message">Search for more apps</string> <!-- Drag and drop --> <skip /> Loading src/com/android/launcher3/allapps/AllAppsGridAdapter.java +1 −21 Original line number Diff line number Diff line Loading @@ -353,12 +353,6 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter. // The text to show when there are no search results and no market search handler. private String mEmptySearchMessage; // The name of the market app which handles searches, to be used in the format str // below when updating the search-market view. Only needs to be loaded once. private String mMarketAppName; // The text to show when there is a market app which can handle a specific query, updated // each time the search query changes. private String mMarketSearchMessage; // The intent to send off to the market app, updated each time the search query changes. private Intent mMarketSearchIntent; Loading Loading @@ -404,14 +398,6 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter. public void setSearchController(AllAppsSearchBarController searchController) { mSearchController = searchController; // Resolve the market app handling additional searches PackageManager pm = mLauncher.getPackageManager(); ResolveInfo marketInfo = pm.resolveActivity(mSearchController.createMarketSearchIntent(""), PackageManager.MATCH_DEFAULT_ONLY); if (marketInfo != null) { mMarketAppName = marketInfo.loadLabel(pm).toString(); } } public void setIconFocusListener(OnFocusChangeListener focusListener) { Loading @@ -425,12 +411,8 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter. public void setLastSearchQuery(String query) { Resources res = mLauncher.getResources(); mEmptySearchMessage = res.getString(R.string.all_apps_no_search_results, query); if (mMarketAppName != null) { mMarketSearchMessage = res.getString(R.string.all_apps_search_market_message, mMarketAppName); mMarketSearchIntent = mSearchController.createMarketSearchIntent(query); } } /** * Sets the callback for when views are bound. Loading Loading @@ -530,10 +512,8 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter. TextView searchView = (TextView) holder.mContent; if (mMarketSearchIntent != null) { searchView.setVisibility(View.VISIBLE); searchView.setContentDescription(mMarketSearchMessage); searchView.setGravity(mApps.hasNoFilteredResults() ? Gravity.CENTER : Gravity.START | Gravity.CENTER_VERTICAL); searchView.setText(mMarketSearchMessage); } else { searchView.setVisibility(View.GONE); } Loading Loading
res/layout/all_apps_search_market.xml +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ android:fontFamily="sans-serif-medium" android:textSize="14sp" android:textColor="@color/launcher_accent_color" android:text="@string/all_apps_search_market_message" android:textAllCaps="true" android:focusable="true" android:background="@drawable/all_apps_search_market_bg" />
res/values/strings.xml +2 −3 Original line number Diff line number Diff line Loading @@ -52,9 +52,8 @@ <string name="all_apps_loading_message">Loading Apps…</string> <!-- No-search-results text. [CHAR_LIMIT=50] --> <string name="all_apps_no_search_results">No Apps found matching \"<xliff:g id="query" example="Android">%1$s</xliff:g>\"</string> <!-- Search market text. This is a format string where the first argument is the name of the activity handling the search. The format string does not need to handle both of these arguments. [CHAR_LIMIT=50] --> <string name="all_apps_search_market_message">Go to <xliff:g id="query" example="Play Store">%1$s</xliff:g></string> <!-- Label for the button which allows the user to get app search results. [CHAR_LIMIT=50] --> <string name="all_apps_search_market_message">Search for more apps</string> <!-- Drag and drop --> <skip /> Loading
src/com/android/launcher3/allapps/AllAppsGridAdapter.java +1 −21 Original line number Diff line number Diff line Loading @@ -353,12 +353,6 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter. // The text to show when there are no search results and no market search handler. private String mEmptySearchMessage; // The name of the market app which handles searches, to be used in the format str // below when updating the search-market view. Only needs to be loaded once. private String mMarketAppName; // The text to show when there is a market app which can handle a specific query, updated // each time the search query changes. private String mMarketSearchMessage; // The intent to send off to the market app, updated each time the search query changes. private Intent mMarketSearchIntent; Loading Loading @@ -404,14 +398,6 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter. public void setSearchController(AllAppsSearchBarController searchController) { mSearchController = searchController; // Resolve the market app handling additional searches PackageManager pm = mLauncher.getPackageManager(); ResolveInfo marketInfo = pm.resolveActivity(mSearchController.createMarketSearchIntent(""), PackageManager.MATCH_DEFAULT_ONLY); if (marketInfo != null) { mMarketAppName = marketInfo.loadLabel(pm).toString(); } } public void setIconFocusListener(OnFocusChangeListener focusListener) { Loading @@ -425,12 +411,8 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter. public void setLastSearchQuery(String query) { Resources res = mLauncher.getResources(); mEmptySearchMessage = res.getString(R.string.all_apps_no_search_results, query); if (mMarketAppName != null) { mMarketSearchMessage = res.getString(R.string.all_apps_search_market_message, mMarketAppName); mMarketSearchIntent = mSearchController.createMarketSearchIntent(query); } } /** * Sets the callback for when views are bound. Loading Loading @@ -530,10 +512,8 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter. TextView searchView = (TextView) holder.mContent; if (mMarketSearchIntent != null) { searchView.setVisibility(View.VISIBLE); searchView.setContentDescription(mMarketSearchMessage); searchView.setGravity(mApps.hasNoFilteredResults() ? Gravity.CENTER : Gravity.START | Gravity.CENTER_VERTICAL); searchView.setText(mMarketSearchMessage); } else { searchView.setVisibility(View.GONE); } Loading