question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Shadow not displaying. SetElevation not working

See original GitHub issue

Please 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:closed
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
skydovescommented, May 17, 2020

Hi, @GuillemRoca , @rajal2009 It is fixed on version 1.1.7. Thank you for your issue! 😃

2reactions
GuillemRocacommented, Jul 6, 2020

I’ve finally had time to test it and it works as intended! Great work and great library! 😄

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found