My UX designer has provided me with an elegant design and exported it as an Xd file. For shadows of some elements, Xd gives me below information:
Shadow color: #101F400D X: 0dp Y: 3dp Blur: 10dp
How can I create this layout in android with the above information?
elevation is not what I want!
You can use cardView or Material design cardview to get the shadow effect
If you want to follow the guideline of material design you have to implement dependency
You can use material cardview as shown below
<com.google.android.material.card.MaterialCardView android:layout_width="match_parent" android:layout_height="wrap_content" app:cardElevation="4dp" app:cardBackgroundColor="@color/colorWhite"> </androidx.constraintlayout.widget.ConstraintLayout>
You have to use a nine patch image to achieve this. Create a nine patch image using any tool like this – https://inloop.github.io/shadow4android/
Then, set this image as background to your view.