use of com.heinrichreimersoftware.materialintro.view.InkPageIndicator in project Phonograph by kabouzeid.
the class NowPlayingScreenPreferenceDialog method onCreateDialog.
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
@SuppressLint("InflateParams") View view = LayoutInflater.from(getContext()).inflate(R.layout.preference_dialog_now_playing_screen, null);
ViewPager viewPager = view.findViewById(R.id.now_playing_screen_view_pager);
viewPager.setAdapter(new NowPlayingScreenAdapter(getContext()));
viewPager.addOnPageChangeListener(this);
viewPager.setPageMargin((int) ViewUtil.convertDpToPixel(32, getResources()));
viewPager.setCurrentItem(PreferenceUtil.getInstance(getContext()).getNowPlayingScreen().ordinal());
InkPageIndicator pageIndicator = view.findViewById(R.id.page_indicator);
pageIndicator.setViewPager(viewPager);
pageIndicator.onPageSelected(viewPager.getCurrentItem());
return new MaterialDialog.Builder(getContext()).title(R.string.pref_title_now_playing_screen_appearance).positiveText(android.R.string.ok).negativeText(android.R.string.cancel).onAny(this).customView(view, false).build();
}
Aggregations