Search in sources :

Example 6 with SearchFragment

use of org.wikipedia.search.SearchFragment in project apps-android-wikipedia by wikimedia.

the class PageActivity 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));
        getSupportFragmentManager().beginTransaction().add(R.id.activity_page_container, fragment).commitNowAllowingStateLoss();
    }
}
Also used : SearchFragment(org.wikipedia.search.SearchFragment) Fragment(android.support.v4.app.Fragment) BottomSheetDialogFragment(android.support.design.widget.BottomSheetDialogFragment) SuppressLint(android.annotation.SuppressLint)

Aggregations

SearchFragment (org.wikipedia.search.SearchFragment)6 Fragment (android.support.v4.app.Fragment)3 SuppressLint (android.annotation.SuppressLint)2 FeedFragment (org.wikipedia.feed.FeedFragment)2 HistoryFragment (org.wikipedia.history.HistoryFragment)2 NearbyFragment (org.wikipedia.nearby.NearbyFragment)2 BottomSheetDialogFragment (android.support.design.widget.BottomSheetDialogFragment)1 BackPressedHandler (org.wikipedia.BackPressedHandler)1 NavTabFragmentPagerAdapter (org.wikipedia.navtab.NavTabFragmentPagerAdapter)1