add shadow on Pilldroid icon for custom dialog

This commit is contained in:
jacques 2023-08-03 18:28:34 +02:00
parent 85154e36e0
commit 4e54c38452
4 changed files with 53 additions and 23 deletions

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item >
<shape
android:shape="rectangle">
<solid android:color="#CCCBCB" />
<corners android:radius="50dp"/>
</shape>
</item>
<item android:right="5dp" android:bottom="2dp">
<shape
android:shape="rectangle">
<solid android:color="@android:color/white"/>
<corners android:radius="50dp"/>
</shape>
</item>
</layer-list>

View file

@ -25,21 +25,12 @@
android:background="@drawable/background_dialog"
android:orientation="vertical">
<ImageView
android:id="@+id/head_icon"
android:layout_width="61dp"
android:layout_height="61dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="12dp"
android:src="@drawable/tickmark"
tools:ignore="ContentDescription,ImageContrastCheck" />
<TextView
android:id="@+id/msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="22dp"
android:layout_marginTop="18dp"
android:layout_marginTop="25dp"
android:layout_marginRight="12dp"
android:fontFamily="@font/opensans_semibold"
android:text="@string/app_name"
@ -51,7 +42,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="22dp"
android:layout_marginTop="18dp"
android:layout_marginTop="25dp"
android:layout_marginRight="12dp"
android:fontFamily="@font/opensans_regular"
android:text="@string/app_name"
@ -61,7 +52,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
@ -102,4 +93,18 @@
android:orientation="horizontal"
app:layout_constraintGuide_begin="20dp" />
</androidx.cardview.widget.CardView>
<ImageView
android:id="@+id/head_icon"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="82dp"
android:background="@drawable/shadow_bg"
android:elevation="@dimen/ten_dp"
android:src="@drawable/ic_launcher_foreground"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription,Pilldroid icon" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -8,7 +8,7 @@
<androidx.cardview.widget.CardView
android:id="@+id/cardView"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
@ -25,26 +25,18 @@
android:background="@drawable/background_dialog"
android:orientation="vertical">
<ImageView
android:id="@+id/image"
android:layout_width="61dp"
android:layout_height="61dp"
android:layout_gravity="center"
android:layout_marginTop="12dp"
android:src="@drawable/tickmark"
tools:ignore="ContentDescription,ImageContrastCheck" />
<TextView
android:id="@+id/msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="22dp"
android:layout_marginTop="18dp"
android:layout_marginTop="50dp"
android:layout_marginRight="12dp"
android:fontFamily="@font/opensans_semibold"
android:text="@string/app_name"
android:textSize="16dp"
tools:ignore="HardcodedText,RtlHardcoded,SpUsage" />
<TextView
android:id="@+id/cpl"
android:layout_width="wrap_content"
@ -79,4 +71,19 @@
tools:ignore="HardcodedText,RtlHardcoded,SpUsage" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<ImageView
android:id="@+id/image"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="92dp"
android:background="@drawable/shadow_bg"
android:elevation="@dimen/ten_dp"
android:src="@drawable/ic_launcher_foreground"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription,ImageContrastCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -89,6 +89,7 @@
android:layout_width="60dp"
android:layout_height="60dp"
android:contentDescription="@string/app_name"
android:background="@drawable/shadow_bg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"