Comments (10)
Hi! First you need to load the ImageList and then you can set the ItemClickListener; If you set the ItemClickListener before load the ImageList, it will not work. Greetings!!
from imageslideshow.
binding.imageSlider.setItemClickListener(object :
com.denzcoskun.imageslider.interfaces.ItemClickListener {
override fun onItemSelected(position: Int) {
// do something here
}
})
I think you have import wrong ItemClickListener user this code
from imageslideshow.
a example with kotlin:
imageSlider.setItemClickListener(object : ItemClickListener { override fun onItemSelected(position: Int) { when (position) { 0 -> { val uri = Uri.parse("https://link1.example.com") rateAction(uri) } 1 -> { val uri = Uri.parse("https://link2.example.com") rateAction(uri) } 2 -> { val uri = Uri.parse("https://link3.example.com") rateAction(uri) } } } })
from imageslideshow.
hey, same problem I am working in fragment and click listner is not working for me, I tried a lot.
But I took a different approach, I use image Slider as a parent layout and placed a linear layout in it having background color transparent, and seted clicklistner on linear layout.
Now it is working for me. Those who are facing the same problem, try this method.
from imageslideshow.
Thanks for the suggestion @mdkamal054 and @cz9dev . But It's still not working. Here's my code, line no 80.
from imageslideshow.
do something like this may be it work i use this when i implement slider
viewModel.popularAnimeList.observe(this) {
binding.imageSlider.setImageList(imageList = it)
binding.imageSlider.setItemClickListener(object :
com.denzcoskun.imageslider.interfaces.ItemClickListener {
override fun onItemSelected(position: Int) {
Log.d(CONSTANTS.TAG, "onItemSelected: $position")
}
})
}
from imageslideshow.
Hii @mdkamal054, it's still not working
bind.imageSlider.setItemClickListener(object: com.denzcoskun.imageslider.interfaces.ItemClickListener{
override fun doubleClick(position: Int) {
Toast.makeText(requireContext(), position, Toast.LENGTH_SHORT).show()
}
override fun onItemSelected(position: Int) {
Toast.makeText(requireContext(), position, Toast.LENGTH_SHORT).show()
}
})
from imageslideshow.
Thanks for the suggestion @mdkamal054 and @cz9dev . But It's still not working. Here's my code, line no 80.
Have you found solution?
from imageslideshow.
@ApunichGULSHER Nope, not yet. Let me know if you have any.
from imageslideshow.
I tried and it works. Please check your use cases.
from imageslideshow.
Related Issues (20)
- click listener not working HOT 1
- meven issue
- Feature request - load MP4 video HOT 1
- Change title position HOT 4
- Can't Use Inside Scrollview With Width And Height Of Match Parent ! HOT 2
- cant use button to go left slide or right slide HOT 1
- Pass intent the image id/drawable HOT 1
- Error On Loading Image From External Source HOT 1
- How to remove background colour of Title and indicator dots. HOT 1
- setItemClickListener not working HOT 1
- How to get URL from firebase firestore HOT 1
- Is it possible to assign an id to each imageList? HOT 3
- Opening a respective photo in a new view by clicking on it and then pinch to zoom the photo in that activity.
- adding a feature for GIF and video adding in the This library. Adding Video and Images in one slider only.
- Is it possible to add a button inside the carousel to delete? HOT 1
- loading infinity HOT 2
- mavel issue
- Its not working when i give image path from SQLite database.The images slides but at the palce of image its show error message
- making text and image separate , instead of in same frame
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imageslideshow.