Remove old fashioned expand/collapse techniques in SearchView examples.

These are not the recommended patterns any more.

Bug: 5086888
Change-Id: If354ea5af0eaff33d0e572177a9e804d899d07e1
This commit is contained in:
Amith Yamasani
2011-08-10 18:36:11 -07:00
parent f9e27297b0
commit 5591368aec
2 changed files with 1 additions and 33 deletions

View File

@@ -19,22 +19,6 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<Button
android:id="@+id/open_button"
android:text="@string/open_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
/>
<Button
android:id="@+id/close_button"
android:text="@string/close_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
/>
<TextView <TextView
android:id="@+id/status_text" android:id="@+id/status_text"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@@ -39,12 +39,9 @@ import java.util.List;
* This demonstrates the usage of SearchView in an ActionBar as a menu item. * This demonstrates the usage of SearchView in an ActionBar as a menu item.
* It sets a SearchableInfo on the SearchView for suggestions and submitting queries to. * It sets a SearchableInfo on the SearchView for suggestions and submitting queries to.
*/ */
public class SearchViewActionBar extends Activity implements SearchView.OnQueryTextListener, public class SearchViewActionBar extends Activity implements SearchView.OnQueryTextListener {
SearchView.OnCloseListener, Button.OnClickListener {
private SearchView mSearchView; private SearchView mSearchView;
private Button mOpenButton;
private Button mCloseButton;
private TextView mStatusView; private TextView mStatusView;
@Override @Override
@@ -55,10 +52,6 @@ public class SearchViewActionBar extends Activity implements SearchView.OnQueryT
setContentView(R.layout.searchview_actionbar); setContentView(R.layout.searchview_actionbar);
mStatusView = (TextView) findViewById(R.id.status_text); mStatusView = (TextView) findViewById(R.id.status_text);
mOpenButton = (Button) findViewById(R.id.open_button);
mCloseButton = (Button) findViewById(R.id.close_button);
mOpenButton.setOnClickListener(this);
mCloseButton.setOnClickListener(this);
} }
@Override @Override
@@ -99,7 +92,6 @@ public class SearchViewActionBar extends Activity implements SearchView.OnQueryT
} }
mSearchView.setOnQueryTextListener(this); mSearchView.setOnQueryTextListener(this);
mSearchView.setOnCloseListener(this);
} }
public boolean onQueryTextChange(String newText) { public boolean onQueryTextChange(String newText) {
@@ -117,14 +109,6 @@ public class SearchViewActionBar extends Activity implements SearchView.OnQueryT
return false; return false;
} }
public void onClick(View view) {
if (view == mCloseButton) {
mSearchView.setIconified(true);
} else if (view == mOpenButton) {
mSearchView.setIconified(false);
}
}
protected boolean isAlwaysExpanded() { protected boolean isAlwaysExpanded() {
return false; return false;
} }