I want to show images as slide show in android. That images will come from the server in the json data format. Can you tell me how i can pass that images in the images slider that will display the images. number of images coming from the server in json, it is totally dynamic, a group of images...
To start a slideshow, just head to an album, select a picture and tap the overflow dropdown menu. From there, simply select slideshow and you're good to go.
Intially you need to do is to take the count of the images coming from the json.As you get all the images you can show it to user using the horizondal pages.It helps to change the image in each swipe like in this link .Otherwise you can use two frames and can set two animations and show it like an slider.I think this piece of code will help you.
if (imagesetflag == true) {
Right_to_left_in = AnimationUtils.loadAnimation(this,
R.anim.right_to_left_in);
Right_to_left_out = AnimationUtils.loadAnimation(this,
R.anim.right_to_left_out);
left_to_Right_in = AnimationUtils.loadAnimation(this,
R.anim.left_to_right_in);
Left_to_Right_out = AnimationUtils.loadAnimation(this,
R.anim.left_to_right_out);
frame1.setImageBitmapReset(decryptedimage, 0, true);
TVpagenum.setText("Page no:" + Currentpage + "/"
+ countOfPages);
frame1.bringToFront();
frame1.setVisibility(View.VISIBLE);
frame2.setVisibility(View.INVISIBLE);
frame1.setAnimation(Right_to_left_in);
frame2.setAnimation(Right_to_left_out);
imagesetflag = false;
} else {
Right_to_left_in = AnimationUtils.loadAnimation(this,
R.anim.right_to_left_in);
Right_to_left_out = AnimationUtils.loadAnimation(this,
R.anim.right_to_left_out);
left_to_Right_in = AnimationUtils.loadAnimation(this,
R.anim.left_to_right_in);
Left_to_Right_out = AnimationUtils.loadAnimation(this,
R.anim.left_to_right_out);
frame2.setImageBitmapReset(decryptedimage, 0, true);
TVpagenum.setText("Page no:" + Currentpage + "/"
+ countOfPages);
frame2.bringToFront();
frame2.setVisibility(View.VISIBLE);
frame1.setVisibility(View.INVISIBLE);
frame2.setAnimation(Right_to_left_in);
frame1.setAnimation(Right_to_left_out);
imagesetflag = true;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With