use of com.hkm.slider.SliderLayout in project UltimateRecyclerView by cymcsg.
the class SliderHeader method initSlider.
private View initSlider(UltimateRecyclerView listview) {
final View view = LayoutInflater.from(getApplication()).inflate(R.layout.list_item_header, null, false);
final ViewTreeObserver vto = listview.getViewTreeObserver();
vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
@Override
public void onGlobalLayout() {
view.getViewTreeObserver().removeOnGlobalLayoutListener(this);
//Log.d("vto", "globallayout");
final SliderLayout sl = (SliderLayout) view.findViewById(R.id.header_slider);
try {
sl.setOffscreenPageLimit(1);
sl.setSliderTransformDuration(500, new LinearOutSlowInInterpolator());
sl.setPresetTransformer(TransformerL.Default);
sl.setPresetIndicator(SliderLayout.PresetIndicators.Center_Bottom);
sl.getPagerIndicator().setDefaultIndicatorColor(R.color.accent, R.color.primaryDark);
sl.getPagerIndicator().setVisibility(View.GONE);
setup_double_faces(sl);
} catch (Exception e) {
e.printStackTrace();
}
}
});
return view;
}
Aggregations