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;
}
Aggregations