Giter VIP home page Giter VIP logo

Comments (10)

ImRetroo avatar ImRetroo commented on September 5, 2024 2

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.

mdkamal054 avatar mdkamal054 commented on September 5, 2024 1

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.

cz9dev avatar cz9dev commented on September 5, 2024 1

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.

Devraj-Sharma avatar Devraj-Sharma commented on September 5, 2024 1

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.

Chandra-Sekhar-Bala avatar Chandra-Sekhar-Bala commented on September 5, 2024

Thanks for the suggestion @mdkamal054 and @cz9dev . But It's still not working. Here's my code, line no 80.

from imageslideshow.

mdkamal054 avatar mdkamal054 commented on September 5, 2024

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.

ApunichGULSHER avatar ApunichGULSHER commented on September 5, 2024

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.

ApunichGULSHER avatar ApunichGULSHER commented on September 5, 2024

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.

Chandra-Sekhar-Bala avatar Chandra-Sekhar-Bala commented on September 5, 2024

@ApunichGULSHER Nope, not yet. Let me know if you have any.

from imageslideshow.

denzcoskun avatar denzcoskun commented on September 5, 2024

I tried and it works. Please check your use cases.

from imageslideshow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.