use of org.wikipedia.search.SearchFragment in project apps-android-wikipedia by wikimedia.
the class PageActivity method onSearchClose.
@Override
public void onSearchClose(boolean launchedFromIntent) {
SearchFragment fragment = searchFragment();
if (fragment != null) {
closeSearchFragment(fragment);
}
toolbarContainerView.setVisibility(View.VISIBLE);
hideSoftKeyboard();
}
use of org.wikipedia.search.SearchFragment in project apps-android-wikipedia by wikimedia.
the class MainFragment method onSearchClose.
@Override
public void onSearchClose(boolean launchedFromIntent) {
SearchFragment fragment = searchFragment();
if (fragment != null) {
closeSearchFragment(fragment);
}
Callback callback = callback();
if (callback != null) {
callback.onSearchClose(launchedFromIntent);
}
}
use of org.wikipedia.search.SearchFragment in project apps-android-wikipedia by wikimedia.
the class MainFragment method onBackPressed.
@Override
public boolean onBackPressed() {
SearchFragment searchFragment = searchFragment();
if (searchFragment != null && searchFragment.onBackPressed()) {
return true;
}
Fragment fragment = ((NavTabFragmentPagerAdapter) viewPager.getAdapter()).getCurrentFragment();
if (fragment instanceof BackPressedHandler && ((BackPressedHandler) fragment).onBackPressed()) {
return true;
}
return false;
}
use of org.wikipedia.search.SearchFragment in project apps-android-wikipedia by wikimedia.
the class MainFragment method openSearchFragment.
@SuppressLint("CommitTransaction")
private void openSearchFragment(@NonNull SearchInvokeSource source, @Nullable String query) {
Fragment fragment = searchFragment();
if (fragment == null) {
fragment = SearchFragment.newInstance(source, StringUtils.trim(query));
getChildFragmentManager().beginTransaction().add(R.id.fragment_main_container, fragment).commitNowAllowingStateLoss();
}
}
use of org.wikipedia.search.SearchFragment in project apps-android-wikipedia by wikimedia.
the class PageActivity method onBackPressed.
// Note: back button first handled in {@link #onOptionsItemSelected()};
@Override
public void onBackPressed() {
if (isCabOpen()) {
finishActionMode();
return;
}
SearchFragment searchFragment = searchFragment();
if (searchFragment != null && searchFragment.onBackPressed()) {
if (searchFragment.isLaunchedFromIntent()) {
finish();
}
return;
}
app.getSessionFunnel().backPressed();
if (pageFragment.onBackPressed()) {
return;
}
finish();
}
Aggregations