Loading core/java/android/widget/SearchView.java +13 −2 Original line number Diff line number Diff line Loading @@ -151,6 +151,14 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { } }; private Runnable mReleaseCursorRunnable = new Runnable() { public void run() { if (mSuggestionsAdapter != null && mSuggestionsAdapter instanceof SuggestionsAdapter) { mSuggestionsAdapter.changeCursor(null); } } }; // For voice searching private final Intent mVoiceWebSearchIntent; private final Intent mVoiceAppSearchIntent; Loading Loading @@ -759,6 +767,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { @Override protected void onDetachedFromWindow() { removeCallbacks(mUpdateDrawableStateRunnable); post(mReleaseCursorRunnable); super.onDetachedFromWindow(); } Loading Loading @@ -1028,7 +1037,9 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { } } mQueryTextView.setInputType(inputType); if (mSuggestionsAdapter != null) { mSuggestionsAdapter.changeCursor(null); } // attach the suggestions adapter, if suggestions are available // The existence of a suggestions authority is the proxy for "suggestions available here" if (mSearchable.getSuggestAuthority() != null) { Loading Loading @@ -1177,7 +1188,6 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { public void onActionViewCollapsed() { clearFocus(); updateViewsVisibility(true); mQueryTextView.setText(""); mQueryTextView.setImeOptions(mCollapsedImeOptions); mExpandedInActionView = false; } Loading @@ -1192,6 +1202,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { mExpandedInActionView = true; mCollapsedImeOptions = mQueryTextView.getImeOptions(); mQueryTextView.setImeOptions(mCollapsedImeOptions | EditorInfo.IME_FLAG_NO_FULLSCREEN); mQueryTextView.setText(""); setIconified(false); } Loading core/java/android/widget/SuggestionsAdapter.java +4 −4 Original line number Diff line number Diff line Loading @@ -29,9 +29,7 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.ColorStateList; import android.content.res.Resources; import android.database.Cursor; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.StateListDrawable; import android.net.Uri; import android.os.Bundle; import android.text.Spannable; Loading @@ -39,7 +37,6 @@ import android.text.SpannableString; import android.text.TextUtils; import android.text.style.TextAppearanceSpan; import android.util.Log; import android.util.SparseArray; import android.util.TypedValue; import android.view.View; import android.view.ViewGroup; Loading Loading @@ -113,7 +110,6 @@ class SuggestionsAdapter extends ResourceCursorAdapter implements OnClickListene mOutsideDrawablesCache = outsideDrawablesCache; // mStartSpinnerRunnable = new Runnable() { // public void run() { // // mSearchView.setWorking(true); // TODO: Loading Loading @@ -185,6 +181,10 @@ class SuggestionsAdapter extends ResourceCursorAdapter implements OnClickListene * the results. */ Cursor cursor = null; if (mSearchView.getVisibility() != View.VISIBLE || mSearchView.getWindowVisibility() != View.VISIBLE) { return null; } //mSearchView.getWindow().getDecorView().post(mStartSpinnerRunnable); // TODO: try { cursor = mSearchManager.getSuggestions(mSearchable, query, QUERY_LIMIT); Loading core/res/res/layout/search_view.xml +1 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ android:singleLine="true" android:ellipsize="end" android:background="@null" android:inputType="text|textAutoComplete" android:inputType="text|textAutoComplete|textNoSuggestions" android:imeOptions="actionSearch" android:dropDownHeight="wrap_content" android:dropDownAnchor="@id/search_edit_frame" Loading Loading
core/java/android/widget/SearchView.java +13 −2 Original line number Diff line number Diff line Loading @@ -151,6 +151,14 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { } }; private Runnable mReleaseCursorRunnable = new Runnable() { public void run() { if (mSuggestionsAdapter != null && mSuggestionsAdapter instanceof SuggestionsAdapter) { mSuggestionsAdapter.changeCursor(null); } } }; // For voice searching private final Intent mVoiceWebSearchIntent; private final Intent mVoiceAppSearchIntent; Loading Loading @@ -759,6 +767,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { @Override protected void onDetachedFromWindow() { removeCallbacks(mUpdateDrawableStateRunnable); post(mReleaseCursorRunnable); super.onDetachedFromWindow(); } Loading Loading @@ -1028,7 +1037,9 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { } } mQueryTextView.setInputType(inputType); if (mSuggestionsAdapter != null) { mSuggestionsAdapter.changeCursor(null); } // attach the suggestions adapter, if suggestions are available // The existence of a suggestions authority is the proxy for "suggestions available here" if (mSearchable.getSuggestAuthority() != null) { Loading Loading @@ -1177,7 +1188,6 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { public void onActionViewCollapsed() { clearFocus(); updateViewsVisibility(true); mQueryTextView.setText(""); mQueryTextView.setImeOptions(mCollapsedImeOptions); mExpandedInActionView = false; } Loading @@ -1192,6 +1202,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { mExpandedInActionView = true; mCollapsedImeOptions = mQueryTextView.getImeOptions(); mQueryTextView.setImeOptions(mCollapsedImeOptions | EditorInfo.IME_FLAG_NO_FULLSCREEN); mQueryTextView.setText(""); setIconified(false); } Loading
core/java/android/widget/SuggestionsAdapter.java +4 −4 Original line number Diff line number Diff line Loading @@ -29,9 +29,7 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.ColorStateList; import android.content.res.Resources; import android.database.Cursor; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.StateListDrawable; import android.net.Uri; import android.os.Bundle; import android.text.Spannable; Loading @@ -39,7 +37,6 @@ import android.text.SpannableString; import android.text.TextUtils; import android.text.style.TextAppearanceSpan; import android.util.Log; import android.util.SparseArray; import android.util.TypedValue; import android.view.View; import android.view.ViewGroup; Loading Loading @@ -113,7 +110,6 @@ class SuggestionsAdapter extends ResourceCursorAdapter implements OnClickListene mOutsideDrawablesCache = outsideDrawablesCache; // mStartSpinnerRunnable = new Runnable() { // public void run() { // // mSearchView.setWorking(true); // TODO: Loading Loading @@ -185,6 +181,10 @@ class SuggestionsAdapter extends ResourceCursorAdapter implements OnClickListene * the results. */ Cursor cursor = null; if (mSearchView.getVisibility() != View.VISIBLE || mSearchView.getWindowVisibility() != View.VISIBLE) { return null; } //mSearchView.getWindow().getDecorView().post(mStartSpinnerRunnable); // TODO: try { cursor = mSearchManager.getSuggestions(mSearchable, query, QUERY_LIMIT); Loading
core/res/res/layout/search_view.xml +1 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ android:singleLine="true" android:ellipsize="end" android:background="@null" android:inputType="text|textAutoComplete" android:inputType="text|textAutoComplete|textNoSuggestions" android:imeOptions="actionSearch" android:dropDownHeight="wrap_content" android:dropDownAnchor="@id/search_edit_frame" Loading