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
1
vote
1 answer

Toolbar xml shadow (elevation) can get working only on Android 21+

So I've added Navigation Drawer and because of it I have to use Toolbar in my layout xml file (instead of using theme with action bar Theme.AppCompat.Light.DarkActionBar, and now it's…
user155
  • 775
  • 1
  • 7
  • 25
1
vote
0 answers

ViewStub is not getting Elevation

I have two views ImageView and ViewStub between some other views. ViewStub contains a button, which I want to inflate in the main layout. Even If I keep the elevation of both i .e.ImageView and ViewStub the same (2dp). ImageView is getting elevation…
burhan sabir
  • 51
  • 1
  • 9
1
vote
0 answers

android:descendantFocusability="afterDescendants" change the layout (seems scrolled)

I have changed my layout from: android:descendantFocusability="blocksDescendants" to android:descendantFocusability="afterDescendants" as follows:
Elad Benda
  • 35,076
  • 87
  • 265
  • 471
1
vote
0 answers

Android problem with nine-patch png elevation profile

I am working with an ui showing chat records where needs message bubbles(for containing message text),I konw i shoud using 9-patch png and so i did,but i got an confusing problem.[Click here to view image][1] https://i.stack.imgur.com/qK2FY.jpg As…
XJUNZ
  • 11
  • 2
1
vote
2 answers

Recyclerview elevation progressively changes when scrolling

I have a recyclerview, which i've added a elevation to. It seems that elevation gets higher depending on where on the screen the item is located vertically, the shadow grows as the item gets scrolled down. I've tried adding a background color, which…
CrimzonWeb
  • 171
  • 3
  • 15
1
vote
0 answers

Android elevation applied as if the shape were not rotated

I have a layer-list that I am using as the background to RelativeLayout in my app. (this layout is being used as an overlay on top of other apps/browsers in android which is why you see chrome in the screenshot below). One of the shapes in the…
1
vote
0 answers

Recyclerview cell's shadow getting clipped during drag

When a cell is about to be dragged I increase the elevation in code using cardView.setCardElevation api. When the drag starts the elevation shadow gets clipped for some reason. When a cell is dropped and i check the elevation before decresing it, it…
1
vote
0 answers

how to give an elevation to a ConstraintLayout which has a vector background

I have a ConstraintLayout with a vector background. I want to set an elevation to the layout. If i remove the vector background then the elevation work but not otherwise. I am using the vector background to get a curved layout. So both are…
1
vote
1 answer

Elevation on Top of a Navigation Tab Bar for Shadow

I'm trying to use the Elevation from Material Design to create Shadow on a Navigation Tab Bar. Follow other guides I learn that I need: Put the padding on the parent view. Use ClipToPadding false on Parent. Declare the Elevation on the Child…
Canato
  • 3,598
  • 5
  • 33
  • 57
1
vote
0 answers

ViewCompat.setElevation doesn't draw view over another view below LOLLIPOP?

Using the code below, I'm trying to draw a View over another view when one of the views is clicked, and reverse it when clicked again. in API level 25 and it works fine, but on another phone with API 17, it doesn't work private void elevationTest()…
SIMMORSAL
  • 1,402
  • 1
  • 16
  • 32
1
vote
1 answer

Elevation above 2dp causes buttons to disappear

In my code below, I have a white view with an elevation of 8dp. The blue button has an elevation of 10dp so in theory it should show. However, it doesn't. It only shows the part in which it is not directly over the white view. I know it's something…
user8494778
1
vote
0 answers

Android - React Naitve - Shadow opacity higher when the component is bigger

I'm having an issue in Android when adding elevation to a View. As we can see, in the first example, the shadow casted by adding elevation is the same size for both rectangles. In the second example however, the shadow for the grey rectangle is…
Amaros
  • 503
  • 5
  • 20
1
vote
1 answer

Elevate an Image in Pre-lollipop devices (<21)

Issue :Give elevation for an image in my layout. Layout Structure: Constraint Layout-> Card View The image to be elevated in half on constraint layout and half on card view. I could not use the shadow approach since my image is not completely on a…
1
vote
2 answers

Error:In ConstraintSet

I'm working in a project and I would like to use Constraint! If I use it, when i want build the gradle or intall the apk in a pohne, i've this error: "Error:In ConstraintSet, unable to find attribute android:elevation" This is my gradle…
Paul
  • 511
  • 1
  • 5
  • 7