Closed GuillemRoca closed 4 years ago
Yes, I am also using setElevation and setArrowColor but not working.
it's just display normal background without elevation and arrow color can not be changed
@GuillemRoca @rajal2009 Hi, I checked this issue just now and I will try to fix it soon! If you have any idea, please let me know or make a pull request! Thank you for your issue :)
@rajal2009
Also, I checked the setArrowColor
method is not working when the color is white
.
It will be fixed on the next release! Thank you for your issue :)
Hello @skydoves!
After a brief investigation, I believe this could be caused by this.
In the method:
private fun initializeBalloonListeners() {
this.onBalloonClickListener = builder.onBalloonClickListener
this.onBalloonDismissListener = builder.onBalloonDismissListener
this.onBalloonOutsideTouchListener = builder.onBalloonOutsideTouchListener
this.bodyView.setOnClickListener {
this.onBalloonClickListener?.onBalloonClick(it)
if (builder.dismissWhenClicked) dismiss()
}
with(this.bodyWindow) {
setOnDismissListener { onBalloonDismissListener?.onBalloonDismiss() }
setBackgroundDrawable(ColorDrawable(Color.WHITE))
isOutsideTouchable = true
setTouchInterceptor(object : View.OnTouchListener {
@SuppressLint("ClickableViewAccessibility")
override fun onTouch(view: View, event: MotionEvent): Boolean {
if (event.action == MotionEvent.ACTION_OUTSIDE) {
if (builder.dismissWhenTouchOutside) {
this@Balloon.dismiss()
}
onBalloonOutsideTouchListener?.onBalloonOutsideTouch(view, event)
return true
}
return false
}
})
}
}
I've changed the setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
to White and now the elevation is displayed correctly! 🍾
The bad thing is that it messes with the arrow and the background set in the API. Maybe you can help me get to the final solution.
Hi, @GuillemRoca , @rajal2009 It is fixed on version 1.1.7. Thank you for your issue! :)
Awesome! I will take a look and test it! 😄
I've finally had time to test it and it works as intended! Great work and great library! :D
Please complete the following information:
Describe the Bug:
I tried the parameter setElevation in order to display the shadow as recently you released this feature in version 1.1.3 and I couldn't manage to get it to work.
I've tested in my own app and in the sample of the repo and I couldn't manage to get it to work, I've edited all the Factories without success:
Sample code
Also shouldn't the elevation be set as the padding or the width/height which is an Int and not a Float for consistency API reasons? The elevation should also be applied in dp.
Expected Behavior:
The elevation should behave as normal and be displayed in the UI.
PS: Thanks for the awesome library! Keep up the good work! 💪