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:
@@ -39,12 +39,9 @@ import java.util.List;
|
||||
* 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.
|
||||
*/
|
||||
public class SearchViewActionBar extends Activity implements SearchView.OnQueryTextListener,
|
||||
SearchView.OnCloseListener, Button.OnClickListener {
|
||||
public class SearchViewActionBar extends Activity implements SearchView.OnQueryTextListener {
|
||||
|
||||
private SearchView mSearchView;
|
||||
private Button mOpenButton;
|
||||
private Button mCloseButton;
|
||||
private TextView mStatusView;
|
||||
|
||||
@Override
|
||||
@@ -55,10 +52,6 @@ public class SearchViewActionBar extends Activity implements SearchView.OnQueryT
|
||||
setContentView(R.layout.searchview_actionbar);
|
||||
|
||||
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
|
||||
@@ -99,7 +92,6 @@ public class SearchViewActionBar extends Activity implements SearchView.OnQueryT
|
||||
}
|
||||
|
||||
mSearchView.setOnQueryTextListener(this);
|
||||
mSearchView.setOnCloseListener(this);
|
||||
}
|
||||
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
@@ -117,14 +109,6 @@ public class SearchViewActionBar extends Activity implements SearchView.OnQueryT
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onClick(View view) {
|
||||
if (view == mCloseButton) {
|
||||
mSearchView.setIconified(true);
|
||||
} else if (view == mOpenButton) {
|
||||
mSearchView.setIconified(false);
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isAlwaysExpanded() {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user