Advertisement
Guest User

blank_fragment

a guest
Aug 19th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. package com.cindodcindy.imagesliderfrgament;
  2.  
  3.  
  4. import android.graphics.Color;
  5. import android.os.Bundle;
  6.  
  7. import androidx.fragment.app.Fragment;
  8. import androidx.recyclerview.widget.LinearLayoutManager;
  9.  
  10. import android.view.LayoutInflater;
  11. import android.view.View;
  12. import android.view.ViewGroup;
  13. import android.widget.LinearLayout;
  14.  
  15. import com.smarteist.autoimageslider.IndicatorAnimations;
  16. import com.smarteist.autoimageslider.SliderAnimations;
  17. import com.smarteist.autoimageslider.SliderView;
  18.  
  19.  
  20. /**
  21. * A simple {@link Fragment} subclass.
  22. */
  23. public class BlankFragment extends Fragment {
  24.  
  25.  
  26. public BlankFragment() {
  27. // Required empty public constructor
  28. }
  29.  
  30.  
  31. @Override
  32. public View onCreateView(LayoutInflater inflater, ViewGroup container,
  33. Bundle savedInstanceState) {
  34. // Inflate the layout for this fragment
  35.  
  36. // setContentView(R.layout.fragment_blank);
  37.  
  38. View view = inflater.inflate(R.layout.fragment_blank, container, false);
  39.  
  40.  
  41.  
  42.  
  43.  
  44. SliderView sliderView = view.findViewById(R.id.imageSlider);//as recycleview
  45.  
  46. SliderAdpater adapter = new SliderAdpater(getActivity());//as adpater class
  47.  
  48. sliderView.setSliderAdapter(adapter);
  49.  
  50.  
  51. sliderView.setSliderAdapter(adapter);
  52.  
  53. sliderView.setIndicatorAnimation(IndicatorAnimations.WORM); //set indicator animation by using SliderLayout.IndicatorAnimations. :WORM or THIN_WORM or COLOR or DROP or FILL or NONE or SCALE or SCALE_DOWN or SLIDE and SWAP!!
  54. sliderView.setSliderTransformAnimation(SliderAnimations.SIMPLETRANSFORMATION);
  55. sliderView.setAutoCycleDirection(SliderView.AUTO_CYCLE_DIRECTION_BACK_AND_FORTH);
  56. sliderView.setIndicatorSelectedColor(Color.WHITE);
  57. sliderView.setIndicatorUnselectedColor(Color.GRAY);
  58. sliderView.setScrollTimeInSec(4); //set scroll delay in seconds :
  59. sliderView.startAutoCycle();
  60.  
  61.  
  62.  
  63.  
  64. return view;
  65. }
  66.  
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement