use of com.yarolegovich.discretescrollview.DiscreteScrollView in project DiscreteScrollView by yarolegovich.
the class GalleryActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gallery);
evaluator = new ArgbEvaluator();
currentOverlayColor = ContextCompat.getColor(this, R.color.galleryCurrentItemOverlay);
overlayColor = ContextCompat.getColor(this, R.color.galleryItemOverlay);
Gallery gallery = Gallery.get();
List<Image> data = gallery.getData();
DiscreteScrollView itemPicker = (DiscreteScrollView) findViewById(R.id.item_picker);
itemPicker.setAdapter(new GalleryAdapter(data));
itemPicker.setScrollListener(this);
itemPicker.setOnItemChangedListener(this);
itemPicker.scrollToPosition(1);
findViewById(R.id.home).setOnClickListener(this);
findViewById(R.id.fab_share).setOnClickListener(this);
}
use of com.yarolegovich.discretescrollview.DiscreteScrollView in project DiscreteScrollView by yarolegovich.
the class DiscreteScrollViewOptions method configureTransitionTime.
public static void configureTransitionTime(DiscreteScrollView scrollView) {
final BottomSheetDialog bsd = new BottomSheetDialog(scrollView.getContext());
final TransitionTimeChangeListener timeChangeListener = new TransitionTimeChangeListener(scrollView);
bsd.setContentView(R.layout.dialog_transition_time);
defaultPrefs().registerOnSharedPreferenceChangeListener(timeChangeListener);
bsd.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
defaultPrefs().unregisterOnSharedPreferenceChangeListener(timeChangeListener);
}
});
bsd.findViewById(R.id.dialog_btn_dismiss).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bsd.dismiss();
}
});
bsd.show();
}
Aggregations