Search in sources :

Example 1 with RingtoneSoundChooserFragment

use of james.alarmio.fragments.RingtoneSoundChooserFragment 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);
    Aesthetic.Companion.get().colorPrimary().take(1).subscribe(new Consumer<Integer>() {

        @Override
        public void accept(Integer integer) throws Exception {
            view.setBackgroundColor(integer);
        }
    });
    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(com.google.android.material.tabs.TabLayout) AlarmSoundChooserFragment(james.alarmio.fragments.AlarmSoundChooserFragment) SimplePagerAdapter(james.alarmio.adapters.SimplePagerAdapter) ViewPager(androidx.viewpager.widget.ViewPager) RingtoneSoundChooserFragment(james.alarmio.fragments.RingtoneSoundChooserFragment) Nullable(androidx.annotation.Nullable)

Aggregations

Nullable (androidx.annotation.Nullable)1 ViewPager (androidx.viewpager.widget.ViewPager)1 TabLayout (com.google.android.material.tabs.TabLayout)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