Search in sources :

Example 1 with AlarmSoundChooserFragment

use of james.alarmio.fragments.AlarmSoundChooserFragment in project Alarmio by TheAndroidMaster.

the class SoundChooserDialog method onCreateView.

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    view = inflater.inflate(R.layout.dialog_sound_chooser, container, false);
    view.setBackgroundColor(colorWindowBackground);
    TabLayout tabLayout = view.findViewById(R.id.tabLayout);
    ViewPager viewPager = view.findViewById(R.id.viewPager);
    AlarmSoundChooserFragment alarmFragment = new AlarmSoundChooserFragment();
    RingtoneSoundChooserFragment ringtoneFragment = new RingtoneSoundChooserFragment();
    RadioSoundChooserFragment radioFragment = new RadioSoundChooserFragment();
    alarmFragment.setListener(this);
    ringtoneFragment.setListener(this);
    radioFragment.setListener(this);
    viewPager.setAdapter(new SimplePagerAdapter(getChildFragmentManager(), alarmFragment, ringtoneFragment, radioFragment));
    tabLayout.setupWithViewPager(viewPager);
    return view;
}
Also used : RadioSoundChooserFragment(james.alarmio.fragments.RadioSoundChooserFragment) TabLayout(android.support.design.widget.TabLayout) AlarmSoundChooserFragment(james.alarmio.fragments.AlarmSoundChooserFragment) SimplePagerAdapter(james.alarmio.adapters.SimplePagerAdapter) ViewPager(android.support.v4.view.ViewPager) RingtoneSoundChooserFragment(james.alarmio.fragments.RingtoneSoundChooserFragment) Nullable(android.support.annotation.Nullable)

Aggregations

Nullable (android.support.annotation.Nullable)1 TabLayout (android.support.design.widget.TabLayout)1 ViewPager (android.support.v4.view.ViewPager)1 SimplePagerAdapter (james.alarmio.adapters.SimplePagerAdapter)1 AlarmSoundChooserFragment (james.alarmio.fragments.AlarmSoundChooserFragment)1 RadioSoundChooserFragment (james.alarmio.fragments.RadioSoundChooserFragment)1 RingtoneSoundChooserFragment (james.alarmio.fragments.RingtoneSoundChooserFragment)1