AndroidDev AndroidDev - 8 days ago 7
Android Question

How to implement the Material-design Elevation for Pre-lollipop

Google has shown some nice ways that elevation effect are shown on Lollipop here.

android:elevation="2dp"


for buttons,

android:stateListAnimator="@anim/button_state_list_animator"


How can I mimic the elevation effect on pre-Lollipop versions without 3rd party library?

Answer

You can mimic the elevation on pre-Lollipop with a official method.

I achieve same effect using,

  android:background="@android:drawable/dialog_holo_light_frame"

My tested output:

enter image description here

reference - http://stackoverflow.com/a/25683148/3879847

Thanks to user @Repo..

Comments