Android Infinite Auto Image Slider Using View Pager 2 | Android Studio | Java

  Рет қаралды 112,333

Chirag Kachhadiya

Chirag Kachhadiya

Күн бұрын

Пікірлер
@shanthegamemaker958
@shanthegamemaker958 3 жыл бұрын
Thank you sooooo muchhhh bhai.... It's working... m sooo happy...it's help me.lott...
@Rabbits_Tech
@Rabbits_Tech 2 жыл бұрын
finally after 10+ tutorials i got the best video.. keep it up boss
@someshsahu4638
@someshsahu4638 2 жыл бұрын
Nice explanation thankyou so much 🙏🏼🙏🏼🙏🏼
@parthudawant7015
@parthudawant7015 3 жыл бұрын
Is there any way to start the app with the middle element focused and then the user can scroll in both directions left/right?
@vishnusharda
@vishnusharda 4 жыл бұрын
Greate sir you tutorial really help us 😍😍😍😍
@danisegabrieldeperio7434
@danisegabrieldeperio7434 4 жыл бұрын
Thank you for this tutorial Quetion: How to add indicator below the view pager 2?
@chiragkachhadiya
@chiragkachhadiya 4 жыл бұрын
For that, you can go through following video Android Onboarding Screens Using ViewPager2 | Android Studio | Java kzbin.info/www/bejne/nqPEe2ufiZ2jpJI
@bishalmaji9586
@bishalmaji9586 3 жыл бұрын
Sir ,we can set loop to view pager in this way also - private final Runnable slideTransorm=new Runnable(){ ... ... Public void run(){ if(viewPager2.getCurrentItem==sliderItem.size()-1){ viewPager2.setCurrentItem(0); } else{ viewPager2.setCurrentItem(viewPager2.getCurrentItem+1); } }
@tomas.menniti
@tomas.menniti 3 жыл бұрын
You helped me a lot. Thanks so much for sharing!
@forrestxu5291
@forrestxu5291 4 жыл бұрын
one concerns. sliderItems.addAll(sildeItems) takes more memory. Can we have alternative solutions?
@olivercortes4542
@olivercortes4542 2 жыл бұрын
you need to changer the getandset class, for a array type int. this array having all the imagen of type drawable, your constructor is necessary change to list to array tipy int[
@chcoucoulamine6024
@chcoucoulamine6024 4 жыл бұрын
Hi, thanks a lot for that explanation, can we create button in the main activity to go to a specific slide?
@surflaweb
@surflaweb 4 жыл бұрын
thanks so much.. it works according to this tutorial.. great content great video!!
@arazguliyev9043
@arazguliyev9043 2 жыл бұрын
Good Job man you helped me
@eumproject2775
@eumproject2775 2 жыл бұрын
It is really amazing and very helpfull
@badal3187
@badal3187 4 жыл бұрын
This video helped me to fulfil my desired intention. Thanks a lot.
@himanshuvaghela07
@himanshuvaghela07 4 жыл бұрын
Superb as always. You nailed it bro!! Keep posting. I'm your big fan👍
@wilsonofcanada
@wilsonofcanada 3 жыл бұрын
Other than text and images, can you place buttons or edittext in a page?
@jeanclayvieiracosta
@jeanclayvieiracosta 2 жыл бұрын
Thanks for you tutorial. Solved my problem.
@alirezaaraby
@alirezaaraby 4 жыл бұрын
Realy Helpful, Good Job.
@nerox8580
@nerox8580 2 жыл бұрын
Thank you very much for this tutorial it was really useful in my project.
@fahadammar7585
@fahadammar7585 2 жыл бұрын
Good tutorial. Kindly share the code (github etc) I will be really thankful. Looking forward to the reply.
@Crabgore
@Crabgore 4 жыл бұрын
How can i mix videos and images using this code? And stop sliding while video is playing? and then start sliding again when video stops?
@badadinfanti4553
@badadinfanti4553 4 жыл бұрын
What about removing items? Are you aware that item count is increasing 2x each time? What about performance?
@chiragkachhadiya
@chiragkachhadiya 4 жыл бұрын
Yes, you are right, if you have large number of items then infinite facility is useless. And if user swipe to the end then only we are increasing items not before. And average user will see 2-3 times whole items not more. If you really care about performance then you should remove auto sliding facility as well. Or suggest better solution in this comment section.
@afreensworld786
@afreensworld786 3 жыл бұрын
Awesome, Is it possible possible use video instead of image.
@amirtashakkori4162
@amirtashakkori4162 10 ай бұрын
Thanx, it helped alot ❤️‍🔥
@nurbakytorynbayeva3562
@nurbakytorynbayeva3562 4 жыл бұрын
The best tutorial ! thank you !
@조수민-y7s
@조수민-y7s 4 жыл бұрын
thank you so much, this is amazing! but is there a way to show both photos at the side with the first photo? so that it really seems like an infinite loop from the beginning?
@AmitKumarGrrowingSlow
@AmitKumarGrrowingSlow 4 жыл бұрын
Looks like you are underrated
@kimberlysimonton4973
@kimberlysimonton4973 4 жыл бұрын
man! why does android studio gotta make it so much code to just scroll images?!? great video btw
@FarhanAhmed-hs2vd
@FarhanAhmed-hs2vd 4 жыл бұрын
there is a glitch, the view doesn't scale and translate properly. if you scroll to last item and then remove item from dataList inside adapter and call notifyItemRemoved()
@shanthegamemaker958
@shanthegamemaker958 3 жыл бұрын
Can I ask any query .. about android..??
@topanime7563
@topanime7563 4 жыл бұрын
Thanks for the tutorial, but what should I do if I want to click the image to open up another Activity? Thank you
@Anonymous-hg2ky
@Anonymous-hg2ky 3 жыл бұрын
Best of best
@WidliAlfajar
@WidliAlfajar 4 жыл бұрын
Beautiful, really.. Can share the source code sir? I test your code, it's working, but, image to image to far, why?? The code same with you, images too (potrait)
@triaro
@triaro 4 жыл бұрын
same issue man
@ritikagupta5600
@ritikagupta5600 4 жыл бұрын
thank you very much for this video.. it works like charm :)
@shreyasmookamale5891
@shreyasmookamale5891 4 жыл бұрын
Sir when we move to other activity this slider disappears how to resolve that because i want it to be running when i come back to this activity
@snehal5429
@snehal5429 4 жыл бұрын
Thank you for the tutorial, it worked perfectly keep it up Please make a video on How to apply on click listeners on these images
@adolfochavez2021
@adolfochavez2021 4 жыл бұрын
Thanks, it helped me a lot.
@riturajsaha7831
@riturajsaha7831 4 жыл бұрын
thanks a lot for the tutorial...
@Astartes-lo1cx
@Astartes-lo1cx 2 жыл бұрын
Thanks. For me it was helpfull.
@sumitmishraclass930a3
@sumitmishraclass930a3 4 жыл бұрын
Best tutorial sir
@seyedsabbagh704
@seyedsabbagh704 4 жыл бұрын
veeeerrrryyyyyyyyyyyyyyyyyyyyyyyyyyyyyy niiiiiiiiiiccccccccceeeeeeeeeeeee
@yerlikacovv8674
@yerlikacovv8674 3 жыл бұрын
Thank you for this tutorial :) :) :) I have a question : how i can add slider click event ?
@alfredoherrera933
@alfredoherrera933 3 жыл бұрын
I want to do the same but with cardview instead of the images, could it be? could you help me please
@learnliveimproverepeat...6522
@learnliveimproverepeat...6522 4 жыл бұрын
sir,please add voice when you are writing the code!!!
@vivekyadavf
@vivekyadavf 4 жыл бұрын
🤣🤣Best answer...😂😂
@عربيانسان
@عربيانسان 5 жыл бұрын
so what is the deference between view pager 1 .. and 2 ?
@chiragkachhadiya
@chiragkachhadiya 5 жыл бұрын
ViewPager2 is the replacement of ViewPager and is much better. The biggest change in the ViewPager2 API is that it now uses the RecyclerView. You can read more about it here: developer.android.com/jetpack/androidx/releases/viewpager2
@ballerzer0
@ballerzer0 4 жыл бұрын
thanks for the tutorial I exactly followed the code but and also I copy the sizes of these 5 images but when I run the code the height of the images are too small how can I adjust the height so that I can see the images clearly.. thanks for the response
@mrwaseemmalik5766
@mrwaseemmalik5766 4 жыл бұрын
Great video btw in my case images are streaching from top and bottom.
@chiragkachhadiya
@chiragkachhadiya 4 жыл бұрын
Set scale type to center crop on image view in layout.
@vishnusharda
@vishnusharda 4 жыл бұрын
Sir please tell me we can use for showing product images in it 🙏🏼
@chiragkachhadiya
@chiragkachhadiya 4 жыл бұрын
Yes
@aminshabaninejad457
@aminshabaninejad457 4 жыл бұрын
Thanks for your tutorial. It was very useful to me. but I want to know how can I change the alpha of next and previous items?
@FlakronSaidi
@FlakronSaidi 3 жыл бұрын
Can you help me with landscape mode, to show pages like that ?
@AmaliaDevCode
@AmaliaDevCode 3 жыл бұрын
Thank you for the tutorial mate!
@CW_Tech_Gujarati
@CW_Tech_Gujarati 4 жыл бұрын
thank you so much for this tutorial. Please can you tell me how to do this using internet..?(Online image)
@danishshakeel9404
@danishshakeel9404 4 жыл бұрын
When i try to add images in main activity it gives the error constructor slideritem in class slider item cannot be applied reason actual and formal argument lists differ in length
@nastyador9022
@nastyador9022 4 жыл бұрын
+
@nikhilpatil6185
@nikhilpatil6185 3 жыл бұрын
Thx buddy ..it helps me alot ❤️
@FGPT
@FGPT 4 жыл бұрын
does the runnable thread causes performance issues in production app
@SandeepKumar-ov6fl
@SandeepKumar-ov6fl 4 жыл бұрын
Sir Mai chahta hu ki recycler view item Ko click krne pe viewpager open ho or clicked item viewpager me show ho. Pls ek video banaye 👏👏👏
@grdfirst6050
@grdfirst6050 3 жыл бұрын
nice it work, please how can i set the image on the top of activity and not in the center? will be glad for your Replay. thanks
@karuneshpalekar5212
@karuneshpalekar5212 3 жыл бұрын
How to stop the auto scroll on touch interception ? Any workaround ?
@artemcheck6332
@artemcheck6332 4 жыл бұрын
Hello! Thank you for tutorial. I have a question. Right page smaller then left page? How i can fix it?
@heetshah3033
@heetshah3033 4 жыл бұрын
the images you are taking set those images of same height and width your problem will be solved
@readmoreapp
@readmoreapp 2 жыл бұрын
Thanks. It was very helpful :)
@kadiroguzyetis8611
@kadiroguzyetis8611 3 жыл бұрын
I wanna new activity intent when click an image , how can ı do?
@nikhilpatil6185
@nikhilpatil6185 3 жыл бұрын
Bro I have a problem how can I adjust my image size cuz when my image size is big it shows big over screen ....if any plzz suggest
@YayanAgustyan
@YayanAgustyan 4 жыл бұрын
how to add the indicator, like a dot indicator, etc.
@agsdeathnote
@agsdeathnote 5 жыл бұрын
I loved it, can you upload the project to download it? please
@yudhaxn1195
@yudhaxn1195 4 жыл бұрын
how to add the lines 47-53 at 12:35 on kotlin?
@hamzakhalil5527
@hamzakhalil5527 5 жыл бұрын
I was looking for same thing Thanku ❤
@codewithmi7749
@codewithmi7749 3 жыл бұрын
hy bro can u give me idea my viepager work but images on sides not show?
@catkot8184
@catkot8184 5 жыл бұрын
awesome 😍👍
@maulanaakbar2889
@maulanaakbar2889 4 жыл бұрын
where does the sliderHanlder come from ?
@grdfirst6050
@grdfirst6050 3 жыл бұрын
Awsome
@phonegames2857
@phonegames2857 4 жыл бұрын
thank you so much evrything work amazing thx again
@chiragkachhadiya
@chiragkachhadiya 4 жыл бұрын
Thank you very much for watching.
@jesusdev4272
@jesusdev4272 4 жыл бұрын
Can you share the source code on github?
@rizkyalkusaeri
@rizkyalkusaeri 4 жыл бұрын
Sir, how can i explain it to drop this at the bottom an display the picture at fragment
@lazzyengineer8253
@lazzyengineer8253 4 жыл бұрын
sir, please tell how i can load the images direct from the internet??
@pathor7265
@pathor7265 4 жыл бұрын
Using Picasso library . That's the easiest way. All you need is the url of that image
@ratulmondal7154
@ratulmondal7154 Жыл бұрын
you save my life ;)
@RobertoMendezDominguez
@RobertoMendezDominguez 4 жыл бұрын
Thanks a lot for the tutorial, but may I ask you a question. Is it possible to slow down the speed transitioning? I've read that is not possible, but do you know how we can achieve the same behavior having a slow speed between transtions? Thx in advance!
@poojacuelix5823
@poojacuelix5823 2 жыл бұрын
how to click on slider viewpager get current position click in android
@_T_Ashish
@_T_Ashish 3 жыл бұрын
How can we get the images from a folder instead of drawables?
@andreasantanaa9144
@andreasantanaa9144 4 жыл бұрын
How to get image from api, i have an api but i dont know how to use that, how to get the image from my database using api. Please tell me how 🙏
@macyso8244
@macyso8244 3 жыл бұрын
I don't know why but it is not working for me, can I send you my doc and you cna check it out what happen ?
@fintechsoftsolutiondelhi8913
@fintechsoftsolutiondelhi8913 3 жыл бұрын
This save my day
@amrashraf170
@amrashraf170 4 жыл бұрын
Thank you for your tutorial but it's lagging when i swipe why does this happen ?
@chiragkachhadiya
@chiragkachhadiya 4 жыл бұрын
May be the resolution of images you are using. Try to load images with small resolution or small images.
@amrashraf170
@amrashraf170 4 жыл бұрын
@@chiragkachhadiya ok thank you sir
@williamwanderify
@williamwanderify 5 жыл бұрын
Hello all right, look you could not provide the funte code of the app, just for me to make corrections, thanks
@saurabhrane7937
@saurabhrane7937 4 жыл бұрын
how to second item at first, setCurrenttem not working
@uttamrajsidhawat8767
@uttamrajsidhawat8767 4 жыл бұрын
used image's size?
@idedhica
@idedhica 4 жыл бұрын
im using kotlin, and i follow your code .. but the infinite swipe is not working ... in Adapter, addAll() is not available .. i have to convert it into toMutableList(), but still not working... how to solve that ..??
@chiragkachhadiya
@chiragkachhadiya 4 жыл бұрын
Try casting list to Array List some thing like this (dataItems as ArrayList).addAll
@idedhica
@idedhica 4 жыл бұрын
@@chiragkachhadiya alright oits working .. thank you ... but if i want to add dots on the sliding .. i also has to make function in adapter right ..??
@chiragkachhadiya
@chiragkachhadiya 4 жыл бұрын
For indicators, you can follow this tutorial which is already in kotlin: kzbin.info/www/bejne/gajMmZx3ebNgZs0
@user-yi9pq9sl6z
@user-yi9pq9sl6z 2 жыл бұрын
Great.
@potterhuy7112
@potterhuy7112 4 жыл бұрын
Hello . How to use infinity with viewpager show 5 item
@potterhuy7112
@potterhuy7112 4 жыл бұрын
Visible 5 item in screen. Not like u visible 3 item.
@hritikjaiswal6754
@hritikjaiswal6754 4 жыл бұрын
image is infinite only forward side. So how I can set both side infinite scroll
@DenMaxProd
@DenMaxProd 5 жыл бұрын
Thanks for tutorial. Could you please make it in Kotlin
@chiragkachhadiya
@chiragkachhadiya 5 жыл бұрын
Sure, I will. Mean while you can check this related tutorial : kzbin.info/www/bejne/gajMmZx3ebNgZs0
@potterhuy7112
@potterhuy7112 4 жыл бұрын
Thank you for tutorial. Questition: How to show 5 item in screen . i don't know. i can show 3 item in screen with Transformer. help me.
@purushothamp6641
@purushothamp6641 4 жыл бұрын
(at 7.30Sec) SliderItem class ViewPager2 is defined but you are not used that..Please verify. Could you please forward this code
@chiragkachhadiya
@chiragkachhadiya 4 жыл бұрын
Both are used, please watch full video carefully.
@gilsonjuniorpro
@gilsonjuniorpro 5 жыл бұрын
Awesome! 👊🏼
@wilsonsim22
@wilsonsim22 4 жыл бұрын
Thank you sir!
@parisahazhirghader5539
@parisahazhirghader5539 4 жыл бұрын
that was really good
@chiragkachhadiya
@chiragkachhadiya 4 жыл бұрын
Thank you very much for watching.
@akashde8919
@akashde8919 3 жыл бұрын
@@chiragkachhadiya bro plz talk in your video it makes more understandable
@hungmai1059
@hungmai1059 2 жыл бұрын
thank you so much, can you send me project's github?
@adityaroy1851
@adityaroy1851 3 жыл бұрын
Sir make android carousel recyclerview tutorial in kotlin
@moumitamahfuz7953
@moumitamahfuz7953 3 жыл бұрын
why it don't work in horizontal mode!!
@dunghongoc1075
@dunghongoc1075 4 жыл бұрын
i'm using glide to load image but it doesn't show up
@androbuddy3022
@androbuddy3022 4 жыл бұрын
How can we add scroll listner in this
@feryeho3171
@feryeho3171 4 жыл бұрын
mantap mastah
Непосредственно Каха: сумка
0:53
К-Media
Рет қаралды 12 МЛН
Who is More Stupid? #tiktok #sigmagirl #funny
0:27
CRAZY GREAPA
Рет қаралды 10 МЛН
I Sent a Subscriber to Disneyland
0:27
MrBeast
Рет қаралды 104 МЛН
Android Play Music Online | From URL | Android Studio | Java
18:59
Chirag Kachhadiya
Рет қаралды 43 М.
Android Onboarding Screens Using ViewPager2 | Android Studio | Java
35:05
Chirag Kachhadiya
Рет қаралды 46 М.