daimajia / AndroidImageSlider

An amazing and convenient Android image slider.
MIT License
5.62k stars 1.66k forks source link

How to get current position of image slide?? #406

Open pnilkanth12 opened 5 years ago

pnilkanth12 commented 5 years ago

I want to click slider to open current image of slider so how to do open current slide image full screen

hosein1366 commented 5 years ago

You can send a image id and send it to another Activity or Fregment and open image by image id number.

for (HashMap<String, String> name : listarray) { textSliderView = new TextSliderView(getActivity());

                // initialize a SliderLayout
                textSliderView
                        .description(name.get("slider_title"))
                        .image(name.get("slider_image"))
                        .setScaleType(BaseSliderView.ScaleType.Fit)
                        .setOnSliderClickListener(this);
                ;

                //add your extra information
                textSliderView.bundle(new Bundle());
                textSliderView.getBundle()
                        .putString("extra", name.get("slider_title"));

                imgSlider.addSlider(textSliderView);
            }

        } catch (JSONException e) {

        }
    }

    @Override
    public void onSliderClick(BaseSliderView slider) {
       Toast.makeText(getActivity(),slider.getBundle().get("extra") + "",Toast.LENGTH_SHORT).show();

    }