@Override public boolean onSearchRequested() { final FBReaderApp fbreader = (FBReaderApp) FBReaderApp.Instance(); final FBReaderApp.PopupPanel popup = fbreader.getActivePopup(); fbreader.hideActivePopup(); final SearchManager manager = (SearchManager) getSystemService(SEARCH_SERVICE); manager.setOnCancelListener( new SearchManager.OnCancelListener() { public void onCancel() { if (popup != null) { fbreader.showPopup(popup.getId()); } manager.setOnCancelListener(null); } }); startSearch(fbreader.TextSearchPatternOption.getValue(), true, null, false); return true; }
@Override public void onCreate(Bundle bundle) { super.onCreate(bundle); Thread.setDefaultUncaughtExceptionHandler( new org.geometerplus.zlibrary.ui.android.library.UncaughtExceptionHandler(this)); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); requestWindowFeature(Window.FEATURE_NO_TITLE); setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL); final SearchManager manager = (SearchManager) getSystemService(SEARCH_SERVICE); manager.setOnCancelListener(null); final TabHost host = getTabHost(); LayoutInflater.from(this).inflate(R.layout.bookmarks, host.getTabContentView(), true); myBook = SerializerUtil.deserializeBook(getIntent().getStringExtra(FBReader.BOOK_KEY)); }
private void setOnSearchableListener() { SearchManager searchDialog = (SearchManager) this.getSystemService(Context.SEARCH_SERVICE); searchDialog.setOnCancelListener( new SearchManager.OnCancelListener() { @Override public void onCancel() { tabs.animate().translationY(0); viewPager.animate().translationY(0); } }); searchDialog.setOnDismissListener( new SearchManager.OnDismissListener() { @Override public void onDismiss() { tabs.animate().translationY(0); viewPager.animate().translationY(0); } }); }
@Override public boolean onSearchRequested() { final ua.pocketbook.fb2viewer.fbreader.fbreader.FBReader fbreader = (ua.pocketbook.fb2viewer.fbreader.fbreader.FBReader) ZLApplication.Instance(); Log.i("FBReader", "onSearchRequested(), myPanel.ControlPanel = " + myPanel.ControlPanel); if (myPanel.ControlPanel != null) { final boolean visible = myPanel.ControlPanel.getVisibility() == View.VISIBLE; myPanel.ControlPanel.hide(false); SearchManager manager = (SearchManager) getSystemService(SEARCH_SERVICE); manager.setOnCancelListener( new SearchManager.OnCancelListener() { public void onCancel() { if ((myPanel.ControlPanel != null) && visible) { myPanel.ControlPanel.show(false); } } }); } startSearch(fbreader.TextSearchPatternOption.getValue(), true, null, false); return true; }