Shadow not displaying. SetElevation not working
See original GitHub issuePlease complete the following information:
- Library-Version [v1.1.4]
- Affected Device(s) [Android Emulator Pixel 3a with Android 9.0 API 28 - Google Play]
- Min API [21]
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
class TagBalloonFactory : Balloon.Factory() {
override fun create(context: Context, lifecycle: LifecycleOwner?): Balloon {
return createBalloon(context) {
setLayout(R.layout.layout_custom_tag)
setArrowSize(10)
setArrowOrientation(ArrowOrientation.BOTTOM)
setArrowPosition(0.5f)
setElevation(10f)
setPadding(4)
isRtlSupport(BalloonUtils.isRtlLayout())
setCornerRadius(4f)
setBalloonAnimationStyle(R.style.ElasticAndFadeOut)
setBackgroundColorResource(R.color.white_93)
setAutoDismissDuration(2000L)
setDismissWhenClicked(true)
setDismissWhenShowAgain(true)
setLifecycleOwner(lifecycle)
}
}
}
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! 💪
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Android "elevation" not showing a shadow - Stack Overflow
I've been playing around with shadows on Lollipop for a bit and this is what I've found: It appears that a parent ViewGroup...
Read more >Create Shadows and Clip Views - Android Developers
Assign Elevation to Your Views; Customize View Shadows and Outlines ... however, the Z value of a view does not affect the view's...
Read more >PopupWindow setElevation not working [37048070]
PopupWindow is always displayed without elevation, no matter if you use setElevation or the view it inflates has elevation. STEPS TO REPRODUCE
Read more >Elevation & shadows - Material Design
In the physical world, objects can be stacked or affixed to one another, but cannot pass through each other. Objects also cast shadows...
Read more >elevation attribute not working android Code Example - Code Grepper
android elevation not working · android elevation not showing emulator · android elevation card include not working · elevation not showing shadow android ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, @GuillemRoca , @rajal2009 It is fixed on version 1.1.7. Thank you for your issue! 😃
I’ve finally had time to test it and it works as intended! Great work and great library! 😄