Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit ed0ce56

Browse files
committed
Don't show search pop up for honeycomb++ search (appears in actionbar instead)
For apps that are Honeycomb+, clicking search was showing 2 search fields: a pop up dialog and a field in the Action Bar. Search in the ActionBar only happens for Honeycomb+; the popup dialog should only happen for < Honeycomb. This changes the logic to match that: the search dialog will only pop up now when there is no search in the ActionBar.
1 parent ba41502 commit ed0ce56

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

app/src/main/java/com/zulip/android/ZulipActivity.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import android.support.v4.widget.DrawerLayout;
3434
import android.support.v4.widget.SimpleCursorAdapter;
3535
import android.util.Log;
36-
import android.view.Gravity;
3736
import android.view.Menu;
3837
import android.view.MenuInflater;
3938
import android.view.MenuItem;
@@ -457,8 +456,7 @@ public boolean onPrepareOptionsMenu(Menu menu) {
457456
searchView.setSearchableInfo(searchManager
458457
.getSearchableInfo(getComponentName()));
459458

460-
searchView
461-
.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
459+
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
462460
@Override
463461
public boolean onQueryTextSubmit(String s) {
464462
doNarrow(new NarrowFilterSearch(s));
@@ -494,7 +492,8 @@ public boolean onOptionsItemSelected(MenuItem item) {
494492
FragmentManager.POP_BACK_STACK_INCLUSIVE);
495493
break;
496494
case R.id.search:
497-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
495+
// show a pop up dialog only if gingerbread or under
496+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
498497
AlertDialog.Builder builder = new AlertDialog.Builder(this);
499498
builder.setTitle("Search Zulip");
500499
final EditText editText = new EditText(this);

0 commit comments

Comments
 (0)