Java Code Examples for androidx.fragment.app.FragmentStatePagerAdapter#BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT

The following examples show how to use androidx.fragment.app.FragmentStatePagerAdapter#BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MainActivity.java    From LollipopContactsRecyclerViewFastScroller with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Toolbar toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    //note : part of the design library sample code was taken from : https://github.com/sitepoint-editors/Design-Demo/

    DesignDemoPagerAdapter adapter = new DesignDemoPagerAdapter(getSupportFragmentManager(), FragmentStatePagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
    ViewPager viewPager = findViewById(R.id.viewpager);
    viewPager.setAdapter(adapter);
    TabLayout tabLayout = findViewById(R.id.tablayout);
    tabLayout.setupWithViewPager(viewPager);
}
 
Example 2
Source File: PagerAdapter.java    From DNSHero with GNU General Public License v3.0 4 votes vote down vote up
public PagerAdapter(FragmentManager fm, Fragment... fragments) {
    super(fm, FragmentStatePagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
    this.fragments = fragments;
}
 
Example 3
Source File: StatePagerAdapter.java    From Aria2App with GNU General Public License v3.0 4 votes vote down vote up
public StatePagerAdapter(@NonNull FragmentManager fm, List<F> fragments) {
    super(fm, FragmentStatePagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
    this.fragments = fragments;
}
 
Example 4
Source File: StatePagerAdapter.java    From Aria2App with GNU General Public License v3.0 4 votes vote down vote up
@SafeVarargs
public StatePagerAdapter(@NonNull FragmentManager fm, F... fragments) {
    super(fm, FragmentStatePagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
    this.fragments = Arrays.asList(fragments);
}
 
Example 5
Source File: ChoiceBookActivity.java    From HaoReader with GNU General Public License v3.0 4 votes vote down vote up
PagerAdapter(@NonNull FragmentManager fm, List<FindKindBean> findKindBeans) {
    super(fm, FragmentStatePagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
    this.kindBeans = findKindBeans;
}
 
Example 6
Source File: PagerAdapter.java    From PretendYoureXyzzyAndroid with GNU General Public License v3.0 4 votes vote down vote up
public PagerAdapter(FragmentManager fm, Fragment... fragments) {
    super(fm, FragmentStatePagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
    this.fragments = Arrays.asList(fragments);
}
 
Example 7
Source File: QrActivity.java    From deltachat-android with GNU General Public License v3.0 4 votes vote down vote up
ProfilePagerAdapter(FragmentManager fragmentManager) {
    super(fragmentManager, FragmentStatePagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
}