Questions tagged [android-elevation]

Android elevation is a feature introduced in Android Lollipop 5.0, is part of new Google Material Design Recommendation. Also involves translationZ property.

Android elevation is a feature introduced in Android Lollipop 5.0, is part of new Google Material Design Recommendation. Also involves translationZ feature.

Material design introduces elevation for UI elements. Elevation helps users understand the relative importance of each element and focus their attention to the task at hand.

Assign Elevation to Your Views

197 questions
0
votes
2 answers

Handle both NavigationView and page content

My NavigationView is displayed behind the page content. So I tried to use bringToFronton my NavigationView : the page content goes behind the NavigationView, BUT becomes unclickable/unscrollable (page content is a recyclerView with multiple…
0
votes
1 answer

My Android app is showing bounds of TextViews but the actual TextViews aren't visible, what should I do?

This is the code that I have used in my Android app to display certain info related to some person's BMI. Few minutes ago, the code was working and everything was perfect but since I have made some changes that I don't remember specifically, the…
0
votes
0 answers

How to get point's elevation ? ( without internet )

How to get point's elevation ( without internet) ? I have coordinates of that point and need to calculate its elevation in offline mode. I am using GoogleMaps ( caching it and using it offline ).
user5583732
0
votes
1 answer

How to find original toolbar shadow in Android SDK?

I am using a toolbar with an elevation of 4dp. The shadow below the toolbar isn't generated on devices older than v21. I can, of course, approximate the shadow with custom drawable but where is the exact code or drawable (XML or 9-patch) in android…
Mehmed
  • 2,555
  • 4
  • 32
  • 55
0
votes
1 answer

Unwanted card shadow on android 4.2.2

I implemented a LisView that has nested card views with a custom ImageView for the shadow. Here's the layout :
Ion Farima
  • 280
  • 1
  • 3
  • 11
0
votes
1 answer

Programmatically added elevation is not showing on Lollipop or Marshmallow devices

I am trying to add elevation to a LinearLayout (in a fragment). On my device with Android Nougat everything is fine but on Marshmellow or Lollipop there are no shadows at all. What could be the problem? LinearLayout ll = (LinearLayout)…
0
votes
1 answer

Android Recycler View with Inner Elevation

I'd like to do something like this in a recycle view, but I don't know how to proceed. In this recyclerview, there are 2 items (but can be more, it's dynamic), with no space between them, and elevation on the common background. I tried to set a…
Tanguy C
  • 123
  • 1
  • 6
0
votes
0 answers

Why are the views not being elevated using android:elevation

I am trying to use the android:elevation attribute but it has no effect on the views. What I am doing wrong? Here is the xml code with one FrameLayout and one Button but none of them is showing any shadow.
0
votes
1 answer

tablayout shadow/elevation for pre-lollipop

I have a tablayout inside an AppBarLayout. I am trying to add a shadow view below the tabbarlayout for pre-lollipop versions. The shadow view shows up, however when I scroll down, the shadow view doesn't seem transparent. It look like as though…
0
votes
1 answer
0
votes
1 answer

Elevation/Shadow to a dialog for pre-21 or pre-lollipop

There are posts related to elevation for views for pre-lollipop devices. I applied techniques that could be applied to the dialog but I still can not have elevation/shadow to my dialog. I tried this in the style but it did not work.
cgr
  • 4,423
  • 2
  • 24
  • 48
0
votes
0 answers

Drop shadow on android popup menu

I'm trying to get a drop shadow on a popup menu which is defined as given below -
daft300punk
  • 161
  • 2
  • 15
0
votes
1 answer

Using app:elevation in code - Android

I'm trying to set the elevation of a AppBarLayout via code. When I do app:elevation in the XML it works without a hitch, however when I do appBarLayout.setElevation(0); It doesn't work. My assumption is its calling the equivalent of…
spogebob92
  • 1,334
  • 3
  • 22
  • 30
0
votes
0 answers

How to have an Elevated Button with Color background for Prelollipop?

As posted in https://stackoverflow.com/a/30931750, for Prelollipop, we could have shadow (elevation) for our button by setting the following. android:background="@android:drawable/dialog_holo_light_frame" However, if I need to add another color to…
Elye
  • 30,821
  • 26
  • 115
  • 272
0
votes
1 answer

Too much shadow on top when using elevation attribute

My designer says that the white area on this image has too much shadow on the top. This is my code: