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
3
votes
1 answer

How to find the color of a view

I have a multi pane view: much like this: The way I got this is by using elevation:
lostintranslation
  • 23,756
  • 50
  • 159
  • 262
3
votes
5 answers

Android elevation of View in CardView is not shown

I have a RelativeLayout inside a CardView that i want to elevate in Android Lollipop but the elevation is not shown (the shadow is not shown): My layout file:
2
votes
0 answers

Android TV card outline shadow on focus (same as Play Store)

I'd like to reproduce the cardview outline that Google does on the new Play Store on Android TV. You can see a capture below with the effect around the Disney+ card icon. The color change on every card focus. What would you recommend to achieve…
Hrk
  • 2,725
  • 5
  • 29
  • 44
2
votes
2 answers

CardView default elevation value

I'm trying to show a badge(Pink TextView) on my CardView as below: The elevation value of the CardView is not set, so it should be default and the elevation of the badge is set to 2dp. With API Level > 22 there is no problem, but with API Level <=…
Aydinozkan
  • 2,508
  • 2
  • 21
  • 26
2
votes
2 answers

ImageView elevation: shadow is cropped at the bottom

I want to add shadow around ImageView I tried elevation
user924
  • 8,146
  • 7
  • 57
  • 139
2
votes
2 answers

Android drag elevation translationz on cardview with itemTouchHelper in Recyclerview

i have a problem figuring out how to give cardViews temporarily elevation on drag. I use a recycler view with cardViews and this is my itemtouchhelper: class ListTouchHelper extends ItemTouchHelper.Callback { private final…
2
votes
5 answers

Elevation not working on TabLayout

I am setting elevation on the TabLayout inside a ViewPager but it is not showing at all. I tried a lot of answers here on stackoverflow but couldn't solve the problem. Setting android:clipToPadding="false" in the CoordinatorLayout does not solve the…
Ali
  • 839
  • 11
  • 21
2
votes
0 answers
2
votes
2 answers

Elevation not working on BottomNavigationView

The elevation on my BottomNavigationView isn't woking, when I start my app all the other UI components get their specific elevation but the BottomNavigationView. Here's the XML:
Ale4303
  • 429
  • 3
  • 10
  • 29
2
votes
1 answer

Android screenshot of view with shadow

I'm trying to take a screenshot of a CardView that has a shadow (elevation). However, the screenshot comes out without the shadow. Any ideas? This is my code: View v = mView.RootView; v.DrawingCacheEnabled = true; Bitmap b = v.DrawingCache;
amitairos
  • 2,907
  • 11
  • 50
  • 84
2
votes
0 answers

Android how to set the transparency of shadow

I have a RelativeLayout which is on a picture. What I want to show is we can see the picture beneath the layout just through the shadow. Of course, the picture is much larger than the layout. Maybe elevation can not do this. In other words, how can…
cheng
  • 21
  • 2
2
votes
1 answer

Elevation on SlidingTabLayout in pre lollipop device

"Elevation" make Sliding Tab Layout worked fine on Lollipop device but tabs will disappeared on pre-lollipop device. I wondering is there any way to add elevation on SlidingTabLayout for pre-Lollipop devices. Here is my .XML file :
2
votes
1 answer

setElevation( ) for LinearLayout before 5.0 devices

Hi I'm trying to apply a shadow to a linearlayout with the following code if () layout.setElevation(4); but this call requires API level 21 to work. How can I apply a shadow to layouts for devices with version < 5.0? Is it…
Mallika Khullar
  • 1,725
  • 3
  • 22
  • 37
2
votes
0 answers

Android, elevation attribute ignored by LinearLayout

I am trying to add elevation to various components of my app to give it a little more material look. Directly below the layout that is giving me issues, I have a LinearLayout that is casting a shadow on its sibling, but this element will not show a…