Closed rbayuokt closed 5 years ago
Hi¡ my english isnt the best but i could implement it in a fragment MainFragment.zip, maybe it can helps you. u can see it funtional in my app: bit.ly/domiyiacacias here is part of my code:
` public class MainFragment extends Fragment implements View.OnClickListener { // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER private static final String ARG_PARAM1 = "param1"; private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
private FlipperLayout flipper; // CREATED FLIPPER IN FRAGMENT
private View vista;
ImageView clasif0,clasif1,clasif2,clasif3,clasif4,clasif5,clasif6,clasif7,clasif10;
private TextView clasif0t,clasif1t,clasif2t,clasif3t,clasif4t,clasif5t,clasif6t,clasif7t,clasif10t,numeroDomiYi;
private String currentVersion = BuildConfig.VERSION_NAME;
private ArrayList<Establecimiento> BannerSecondShot;
private OnFragmentInteractionListener mListener;
public MainFragment () {
// Required empty public constructor
} `
public class FragmentLauncherHome extends Fragment {
// .setImageDrawable(R.drawable.banner_1) // Use one of setImageUrl() or setImageDrawable() functions, otherwise IllegalStateException will be thrown .setImageScaleType(ImageView.ScaleType.CENTER_CROP) //You can use any ScaleType .setDescription("Description") .setOnFlipperClickListener(new FlipperView.OnFlipperClickListener() { @Override public void onFlipperClick(FlipperView flipperView) { //Handle View Click here } }); flipperLayout.setScrollTimeInSec(5); //setting up scroll time, by default it's 3 seconds flipperLayout.getScrollTimeInSec(); //returns the scroll time in sec flipperLayout.getCurrentPagePosition(); //returns the current position of pager flipperLayout.addFlipperView(view2);
}
error : Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void technolifestyle.com.imageslider.FlipperLayout.setScrollTimeInSec(int)' on a null object reference