|
|
@ -135,6 +135,7 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi |
|
|
|
protected ServerStatusView serverStatusView; |
|
|
|
protected ServerStatusView serverStatusView; |
|
|
|
@SystemService |
|
|
|
@SystemService |
|
|
|
protected SearchManager searchManager; |
|
|
|
protected SearchManager searchManager; |
|
|
|
|
|
|
|
private MenuItem searchMenu = null; |
|
|
|
|
|
|
|
|
|
|
|
// Settings
|
|
|
|
// Settings
|
|
|
|
@Bean |
|
|
|
@Bean |
|
|
@ -262,10 +263,11 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi |
|
|
|
// For Android 2.1+, add an expandable SearchView to the action bar
|
|
|
|
// For Android 2.1+, add an expandable SearchView to the action bar
|
|
|
|
MenuItem item = menu.findItem(R.id.action_search); |
|
|
|
MenuItem item = menu.findItem(R.id.action_search); |
|
|
|
if (android.os.Build.VERSION.SDK_INT >= 8) { |
|
|
|
if (android.os.Build.VERSION.SDK_INT >= 8) { |
|
|
|
final SearchView searchView = new SearchView(this); |
|
|
|
SearchView searchView = new SearchView(this); |
|
|
|
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName())); |
|
|
|
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName())); |
|
|
|
searchView.setQueryRefinementEnabled(true); |
|
|
|
searchView.setQueryRefinementEnabled(true); |
|
|
|
item.setActionView(searchView); |
|
|
|
item.setActionView(searchView); |
|
|
|
|
|
|
|
searchMenu = item; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
return true; |
|
|
@ -486,6 +488,14 @@ public class TorrentsActivity extends SherlockFragmentActivity implements OnNavi |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean onSearchRequested() { |
|
|
|
|
|
|
|
if (searchMenu != null) { |
|
|
|
|
|
|
|
searchMenu.expandActionView(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@OptionsItem(resName = "action_add_fromurl") |
|
|
|
@OptionsItem(resName = "action_add_fromurl") |
|
|
|
protected void startUrlEntryDialog() { |
|
|
|
protected void startUrlEntryDialog() { |
|
|
|
UrlEntryDialog.startUrlEntry(this); |
|
|
|
UrlEntryDialog.startUrlEntry(this); |
|
|
|