Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the click event of layout inside the bubble? #6

Open
aZyreTech opened this issue Oct 2, 2019 · 2 comments
Open

How to get the click event of layout inside the bubble? #6

aZyreTech opened this issue Oct 2, 2019 · 2 comments

Comments

@aZyreTech
Copy link

suppose i have a button inside bubble layout then how do i get the click event of that button ?

@michio-mada
Copy link

Get the view via getExpandableView()

from there you can set View.OnClickListener for your button.

@ismailnurudeen
Copy link

The easiest way is to save a reference to the view after inflating and use findViewById to get any view inside of it which you can set a click listeners on.

i.e
In kotlin

val bubbleLayout=LayoutInflater.from(context).inflate(R.layout.your_layout,null)

Then do;

bubbleLayout.findViewById<Button>(R.id.my_button).setOnClickListener{
}

or even shorter,

bubbleLayout.my_button.setOnClickListener{
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants