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

206 questions
6
votes
1 answer

HardwareAccelerated false removes elevation

Setting hardware accelerated to false in my androidManifest removes elevation from my views.. When hardware accelerated is false, it removes elevation When hardware accelerated is true, elevation is there but no smooth scrolling Is there any way…
6
votes
5 answers

Android button elevation shadow not working

I am trying to make a button that has a shadow using elevation with a background image being my sign in with gmail png. The button is contained within a relative layout. The elevation won't show no matter what I try to do. I tried solutions from…
Jeffrey Chou
  • 331
  • 2
  • 4
  • 15
6
votes
2 answers

Android new fragment appears below old one during fragment animation

I'm using animation between my fragment : slide in from left :
Vodet
  • 1,491
  • 1
  • 18
  • 36
6
votes
1 answer

Elevation is not shown on toolbar in pre-lollipop devices

I want to show the same elevation effect on my toobar on a KitKat device as seen on a Lollipop device. Below are screenshots for both the KitKat and Lollipop devices. I have referred to this link but my problem is not solved yet. Lollipop…
Samarth Kejriwal
  • 1,168
  • 2
  • 15
  • 30
6
votes
1 answer

Android Navigation View - items elevation

Is there a way, using the NavigationView element of the Google support library, to use elevation on the items inside a NavigationView to achieve something like this: You can see that the header of the navigation drawer has an elevation, like the…
6
votes
1 answer

Elevation + transparency bug on Android Lollipop

Using a background color for a view with some alpha (e.g. #99fe0038) and some elevation on API 21 reveals two circles: one for the view itself and another inside: Elevation and background color are set via…
makovkastar
  • 5,000
  • 2
  • 30
  • 50
5
votes
1 answer

View setBackground with drawable remove the elevation's shadows

I try to implement the Material Design's elevation concept to my RecyclerView. For each item of the RecyclerView I use this
5
votes
6 answers

CardView elevation not working with RecyclerView

CardView elevation works fine when tested in a separate application, but when the same code for the cardView is used to craft items of a RecyclerView, the elevation no longer appears. Here is the code for the RecyclerView list item:
5
votes
1 answer

Material Design elevation issue when add a fragment with TabLayout

I'm currently working on an application for v22 and use the following libraries: compile 'com.android.support:appcompat-v7:22.2.1' compile 'com.android.support:support-v4:22.2.1' compile 'com.android.support:design:22.2.1' I have only one Activity…
5
votes
2 answers

Why can't I set the elevation on a view that I add programmatically?

Disclaimer: I am using Xamarin.Android. I created a view, set its elevation, and then add it to my main layout. The view successfully gets added to the layout when I trigger the event, but there is no elevation shadow whatsoever. Here is what I am…
hellaandrew
  • 823
  • 11
  • 23
5
votes
2 answers

Using Elevation and Ripple in ImageButton

I'm trying to set elevation and ripple effect at the same time on a ImageButton. I'm running LOLLIPOP. Here is the code:
jzeferino
  • 7,700
  • 1
  • 39
  • 59
5
votes
2 answers

Android - Elevation not working

I'm migrating an Android App to use Material Design. To verify if I did everything correct i create an empty activity to test some Material Design itens (FAB, raised button, elevation on views, cards, lists, etc...). The buttons appear to OK, but…
5
votes
0 answers

Android: set elevation for above element (shadow with up direction)

What's the correct way to get this shadow between the footer buttons and the main scrollview? This is my current layout: Applying an elevation attribute to the latest RelativeLayout doesn't work:
filippo
  • 839
  • 2
  • 13
  • 25
5
votes
1 answer

How to add material-style shadow to canvas drawn elements?

As the documentation says, you can add and customize the material design shadow-style by android:elevation. This works fine with all elements I came across yet. But what if I want to get the same (or nearly the same) behavior for shapes I draw on a…
malte
  • 1,171
  • 1
  • 15
  • 28
4
votes
1 answer

How to keep a Switch thumb shadow/elevation when using a custom drawable for the thumb?

I need to remplace the default Switch thumb with my own drawable. To do so I used the android:thumb attribute, it works well minus the shadow under the thumb is no longer present. How can I use my custom thumb drawable while keeping the thumb…
MickaelG
  • 326
  • 3
  • 16