OSDN Git Service

Stop trying to play tricks with the focusability of the search widget's
authorMike LeBeau <mlebeau@android.com>
Tue, 28 Jul 2009 21:19:06 +0000 (14:19 -0700)
committerMike LeBeau <mlebeau@android.com>
Tue, 28 Jul 2009 21:19:06 +0000 (14:19 -0700)
TextView, as we weren't always doing it right, and it doesn't seem to
help or hurt the frequency of the home screen sliding up when the
widget is selected (that seems to be separate, see http://b/1819752).

res/layout/widget_search.xml
src/com/android/launcher/Search.java

index 7ecf5bf..a83e675 100644 (file)
@@ -40,6 +40,7 @@
             android:layout_height="wrap_content"
             android:layout_weight="1.0"
             android:editable="false"
+            android:focusable="true"
             android:inputType="none"
             android:background="@drawable/textfield_searchwidget"
             android:textAppearance="?android:attr/textAppearanceMediumInverse"
index a0402a9..8a7c352 100644 (file)
@@ -194,10 +194,6 @@ public class Search extends LinearLayout
             // keyboard is not currently available.
             if (getContext().getResources().getConfiguration().hardKeyboardHidden ==
                     Configuration.HARDKEYBOARDHIDDEN_YES) {
-                // Make sure the text field is not focusable, so it's not responsible for
-                // causing the whole view to shift up to accommodate the keyboard.
-                mSearchText.setFocusable(false);
-                
                 InputMethodManager inputManager = (InputMethodManager)
                         getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
                 inputManager.showSoftInputUnchecked(0, null);
@@ -227,10 +223,6 @@ public class Search extends LinearLayout
     public void stopSearch(boolean animate) {
         setQuery("");
         
-        // Set the search field back to focusable after making it unfocusable in
-        // startSearch, so that the home screen doesn't try to shift around when the
-        // keyboard comes up.
-        mSearchText.setFocusable(true);
         // Only restore if we are not already restored.
         if (getAnimation() == mMorphAnimation) {
             if (animate && !isAtTop()) {