Categories

How to Create an Image Slider with Picasso + ViewPager – Android Studio Tutorial



In this video we will use the ViewPager widget together with the Picasso image loading library to create an image slider that loads it’s images from the web. For this we will create a PagerAdapter and override the getCount, instantiateItem, isViewFromObject and destroyItem methods. We will then dynamically create ImageViews and add them as pages to our ViewPager. Into these ImageViews we load the images from URLs we store in a string array with help of Picasso.

Example code, GitHub link, instructions etc:

____________________
❗ Subscribe to the channel:

⏯ Watch more tutorials:

⭐ Become a channel member for exclusive tutorials and other perks:

㊙ Help translating the videos:

💚 Support the content:

💬 Join the Discord chat:

🎧 Audiobooks and podcasts for programmers:

👶 How to get started with Android development:

📣 Follow Coding in Flow on social media:

Facebook:

Instagram:

Twitter:

Blog:

Nguồn: https://midlandlangarseva.com/

Xem thêm bài viết khác: https://midlandlangarseva.com/cong-nghe/

Article Categories:
Công Nghệ

Comments

  • my app keeps stopping ,please help…..

    pushkar deotale June 29, 2020 1:03 pm Reply
  • My app keeps crashing for some reason :///

    JinJoeToe June 29, 2020 1:03 pm Reply
  • I can't find ViewPager when I type everything exactly as you did in the XML file at the beginning! What is the problem??

    JinJoeToe June 29, 2020 1:03 pm Reply
  • I'm new to Android Studio and I was wondering if it would be possible to have a GridLayout with Images whom you can click on and then swipe through with the ViewPager (with Picasso), something like the typical gallery on our phones???

    JinJoeToe June 29, 2020 1:03 pm Reply
  • update this tutorial using ViewPager2

    luke cross June 29, 2020 1:03 pm Reply
  • How you got to learn lot of thing?

    luke cross June 29, 2020 1:03 pm Reply
  • It shows the following error:
    Cannot resolve class android.support.v4.view.ViewPager
    The hint is to add that same dependency, but when i do that, the error is still there

    Guilherme Ribeiro June 29, 2020 1:03 pm Reply
  • Its not working for me.First page is blank

    StudioFusionArt June 29, 2020 1:03 pm Reply
  • ço ari biurufol

    luke cross June 29, 2020 1:03 pm Reply
  • Thank you great video. Did anyone play this video with subtitles?

    Alex Surik June 29, 2020 1:03 pm Reply
  • hello my friend ( so how do we make these pictures automatically ) I would be glad if you answer

    Player Player June 29, 2020 1:03 pm Reply
  • nice video

    studio June 29, 2020 1:03 pm Reply
  • How do I make it zoom?

    Ezequiel Biglia June 29, 2020 1:03 pm Reply
  • please relaunching with ViewPager2.

    Oscar Ivan June 29, 2020 1:03 pm Reply
  • Thanx so much that was so helpful

    Khalid LACHHAB June 29, 2020 1:03 pm Reply
  • How to make add to favourite button and show on the favourite list

    Abhishek s June 29, 2020 1:03 pm Reply
  • Nice work
    but i have question please how i can start at position 10 for example not from the 0

    Ahmed Elsayed June 29, 2020 1:03 pm Reply
  • help i dont have the support.v4.view.ViewPager from 0:59
    i have this
    androidx.viewpager.widget.ViewPager

    ian chu June 29, 2020 1:03 pm Reply
  • Thank you !! it is great information for me !! 🙂
    I have one question. How do you zoom this?

    한은열 June 29, 2020 1:03 pm Reply
  • thanks a lot

    HISSABIS June 29, 2020 1:03 pm Reply
  • Exactly i was looking for!

    Uthpala Bandara June 29, 2020 1:03 pm Reply
  • Hello my app is launching real good but the images are not showing …. i have added all the dependencies and permission if some one can help me it will be life saving…

    abbas yousafzai June 29, 2020 1:03 pm Reply
  • How can I set the current image, as wallpaper?

    AlexCurioso June 29, 2020 1:03 pm Reply
  • thanx man .. awesome work .. great explanation

    Mina Amir June 29, 2020 1:03 pm Reply
  • how can we add share option in image? Ive done in XML, I need help for code.

    Dibas Dauliya June 29, 2020 1:03 pm Reply
  • Very useful tutorial ,Thanks for sharing your knowledge and Good Luck

    Danish Wasim June 29, 2020 1:03 pm Reply
  • How can we do to autoplay sound in every switch images? Thanks!

    Tech GeekBoy June 29, 2020 1:03 pm Reply
  • Nice tutorial with perfect presentation 👍

    Ravindra Kumar June 29, 2020 1:03 pm Reply
  • Sir plz make a video in this topic
    "Continuous Shared Element Transitions: RecyclerView to ViewPager"

    https://android-developers.googleblog.com/2018/02/continuous-shared-element-transitions.html?m=1

    Plz sir I need help

    Avijit Samanta June 29, 2020 1:03 pm Reply
  • how to add next, prev buttons in this?

    Bir Nepal June 29, 2020 1:03 pm Reply
  • Error is showing while adding latest dependency

    NEPID GAMER June 29, 2020 1:03 pm Reply
  • Very good explanation. How do I load images dynamically using JSON in imageUrls

    Santhi Sagar June 29, 2020 1:03 pm Reply
  • I'm retrieving Images from firebase into viewpager there is no error but images are not coming into view my firebase has image links and it is correctly retrieving into the app(I have checked through logcat) is there something I'm missing.

    if anyone can solve this it would be a great help

    CHIRAG GUPTA June 29, 2020 1:03 pm Reply

Leave a Reply

Your email address will not be published. Required fields are marked *