android-elevation

Elevation animation on click on CardView

无人久伴 提交于 2019-12-04 10:41:53
问题 I want to add the elevation animation to my android.support.v7.widget.CardView , just like the material style Button s do. I've tried to set a StateListAnimator : android:stateListAnimator="@anim/selector_raise" which points to my selector in res/anim : <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="true" android:state_pressed="true"> <objectAnimator android:duration="@android:integer/config

Android appbarlayout elevation appears in status bar

故事扮演 提交于 2019-12-03 22:34:15
How do I get rid of the elevation in the status bar? If I set in AppbarLayout the app:elevation to 0dp the elevation doesn't appear anymore in status bar but also not below the AppbarLayout. How do I just get the elevation under the AppbarLayout? Here's a screenshot of what I mean: puush link , notice the shadow in the status bar :( Thanks! Our concern is about shadow of AppBarLayout visible when status bar is transparent. Having an opaque status bar is not viable at all times. This happens on Lollipop & above only because of dynamic shadow rendering. On Marshmallow the wrong shadow looks even

AppBarLayout elevation change is delayed on appCompat v24.0.0

落花浮王杯 提交于 2019-12-03 13:44:24
问题 In Appcompat v24.0.0 causes rendering of shadow/elevation to AppbarLayout after Activity is visible. And a lag can easily be seen in shadow drawing to AppbarLayout . And this lag was not there in previous Appcompat library version. Tested using both Appcompat v24.0.0 and Appcompat v23.4.0 , shadow drawing clearly seen in the new version. 回答1: This is a bug in Appcompat v24.0.0 . References: https://code.google.com/p/android/issues/detail?id=213895 In order to minimize the delay in elevation

Elevation animation on click on CardView

帅比萌擦擦* 提交于 2019-12-03 06:34:30
I want to add the elevation animation to my android.support.v7.widget.CardView , just like the material style Button s do. I've tried to set a StateListAnimator : android:stateListAnimator="@anim/selector_raise" which points to my selector in res/anim : <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="true" android:state_pressed="true"> <objectAnimator android:duration="@android:integer/config_shortAnimTime" android:propertyName="translationZ" android:valueTo="@dimen/touch_raise" android:valueType=

Change Elevation of ActionBar by theme

做~自己de王妃 提交于 2019-12-03 06:10:16
I want to remove the shadow below the ActionBar. I know that I need to change the elevation to 0dp, but I want to do it in the theme. For Android 4.4- I use : <item name="android:windowContentOverlay">@null</item> But is it possible for Android 5.0 ? Stephane Mathis As shown by Antonio Jose, here is an answer : Remove shadow below actionbar For Android 5.0, if you want to set it directly into a style use: <item name="android:elevation">0dp</item> and for Support library compatibility use: <item name="elevation">0dp</item> Example of style for a AppCompat light theme: <style name="Theme.MyApp

Elevation not working for ImageView

江枫思渺然 提交于 2019-12-03 05:28:59
Elevation for ImageView is not working. I declared ImageView in XML like this: <ImageView android:id="@+id/image" android:layout_width="100dp" android:layout_height="50dp" android:elevation="10dp" android:src="@drawable/youtube" /> What else should I do for elevation to work properly for ImageView? The elevation shadow is derived from the background drawable of a View. If your ImageView has no background, you'll see no shadow. If you want to change that behavior, you need to build your own ViewOutlineProvider and call View.setOutlineProvider() to set it (and this is not trivial). Works in all

AppBarLayout elevation change is delayed on appCompat v24.0.0

与世无争的帅哥 提交于 2019-12-03 02:59:18
In Appcompat v24.0.0 causes rendering of shadow/elevation to AppbarLayout after Activity is visible. And a lag can easily be seen in shadow drawing to AppbarLayout . And this lag was not there in previous Appcompat library version. Tested using both Appcompat v24.0.0 and Appcompat v23.4.0 , shadow drawing clearly seen in the new version. This is a bug in Appcompat v24.0.0 . References: https://code.google.com/p/android/issues/detail?id=213895 In order to minimize the delay in elevation drawing, set the duration to 1ms in your own StateListAnimator and apply it to AppbarLayout . appbar_always

Elevation on AppBarLayout doesn't work

亡梦爱人 提交于 2019-11-30 22:19:34
When I try to set a specific value to elevation for AppBarLayout, the shadow disappears completely. <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" app:elevation="4dp"> <!-- Toolbar --> <android.support.v7.widget.Toolbar... <!-- Other Layouts --> </android.support.design.widget.AppBarLayout> Is this a bug or the expected behaviour? I'm using the version 26.0.0 of the design library. Setting Property Animation Creating an animation with 1ms of execution time: /animator/appbar_elevation.xml <?xml version="1.0" encoding="utf-8"?

Elevation on AppBarLayout doesn't work

走远了吗. 提交于 2019-11-30 17:55:14
问题 When I try to set a specific value to elevation for AppBarLayout, the shadow disappears completely. <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" app:elevation="4dp"> <!-- Toolbar --> <android.support.v7.widget.Toolbar... <!-- Other Layouts --> </android.support.design.widget.AppBarLayout> Is this a bug or the expected behaviour? I'm using the version 26.0.0 of the design library. 回答1: Setting Property Animation Creating

Setting Elevation in XML on AppCompat CardView on Android 5.0

♀尐吖头ヾ 提交于 2019-11-30 06:13:24
问题 From what I understand, early in the preview stage there seemed to be no way to set elevation in XML only on CardView s without a hack in Java. Now that the official release is out, is there any way of doing this in XML without writing Java code to set elevation? I have tried card_view:cardElevation to no effect. I had thought when I was using the emulators for 5.0 everything was fine. But now that I'm using the official version on my actual device all of my CardView s disappeared Pre