ChaosLeung / PinView

A PIN view library for Android. Use to enter PIN/OTP/password etc.
Apache License 2.0
634 stars 121 forks source link

is there a way to add elevation and translationZ to single item ? #69

Open MohamedHelmy95 opened 3 years ago

MohamedHelmy95 commented 3 years ago

What kind of issue is this?

Description:

I want to add a shadow effect around single item

What did I do:

I created my own style inheriting from your default style

<style name="MyPinView" parent="PinWidget.PinView"> <item name="android:elevation">4dp</item> <item name="android:translationZ">4dp</item> <item name="elevation">4dp</item> </style> but it's not working

akankshapaul048 commented 2 years ago

I want the same effect in my app, Did you find a solution?

MohamedHelmy95 commented 2 years ago

Hello @akankshapaul048 the only way I got it working is by creating a MaterialShapeDrawable that draws the shape of the background I need and draws shadows also. more info here : https://medium.com/ackee/create-beautiful-shapes-with-materialshapedrawable-874dd46e0fd5