Skip to content

Commit 336bd08

Browse files
committed
krishna
1 parent 5c6c685 commit 336bd08

File tree

3 files changed

+16
-25
lines changed

3 files changed

+16
-25
lines changed

app/src/main/java/com/mrprogrammer/customtoast/HeadToast.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ fun HeadToast(
2020

2121

2222
val images=layout.findViewById<ImageView>(R.id.image);
23+
24+
2325
val frame = layout.findViewById<FrameLayout>(R.id.button_accent_border);
2426
val background =layout.findViewById<RelativeLayout>(R.id.button_click_parent);
27+
images.setImageDrawable(ContextCompat.getDrawable(activity, icon))
2528

2629

2730

28-
images.setImageDrawable(ContextCompat.getDrawable(activity, icon))
29-
3031

3132
frame.setBackgroundColor(ContextCompat.getColor(activity, bordercolor))
3233
background.setBackgroundColor(ContextCompat.getColor(activity, background_bg))

app/src/main/res/layout/main_toast_success.xml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,25 @@
22
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
android:id="@+id/toast_container"
5-
android:layout_width="match_parent"
5+
android:layout_gravity="center"
6+
android:layout_width="wrap_content"
67
android:layout_height="match_parent">
78

89
<RelativeLayout
910
android:id="@+id/button_parent"
10-
android:layout_width="match_parent"
11+
android:layout_width="wrap_content"
1112
android:layout_height="wrap_content"
1213
android:layout_centerHorizontal="true"
1314
android:layout_centerVertical="true">
1415

1516
<androidx.cardview.widget.CardView
1617
android:id="@+id/button_card_parent"
17-
android:layout_width="match_parent"
18-
android:layout_height="56dp"
18+
android:layout_width="wrap_content"
19+
android:layout_height="36dp"
1920
android:layout_centerHorizontal="true"
2021
android:layout_centerVertical="true"
2122

22-
app:cardCornerRadius="4dp"
23+
app:cardCornerRadius="10dp"
2324
app:cardElevation="20dp">
2425

2526
<RelativeLayout
@@ -44,7 +45,7 @@
4445

4546
<ImageView
4647
android:id="@+id/image"
47-
android:layout_width="35dp"
48+
android:layout_width="25dp"
4849
android:layout_height="match_parent"
4950
android:layout_marginStart="10dp"
5051
android:padding="2dp"
@@ -57,18 +58,7 @@
5758
android:orientation="vertical">
5859

5960
<TextView
60-
android:layout_width="wrap_content"
61-
android:layout_height="wrap_content"
62-
android:layout_centerVertical="true"
63-
android:layout_marginStart="10dp"
64-
android:ellipsize="end"
65-
android:lines="1"
66-
android:text="Success"
67-
android:textColor="#131313"
68-
android:textSize="15sp"
69-
android:textStyle="bold" />
70-
71-
<TextView
61+
android:layout_marginEnd="15dp"
7262
android:id="@+id/toast_text"
7363
android:layout_width="wrap_content"
7464
android:layout_height="wrap_content"

app/src/main/res/values/colors.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@
99
<color name="white">#FFFFFFFF</color>
1010

1111

12-
<color name="success">#8eebb5</color>
12+
<color name="success">#B0FFD1</color>
1313
<color name="success_left">#3EAA56</color>
1414

1515

16-
<color name="warning">#fece8d</color>
16+
<color name="warning">#FFD8A2</color>
1717
<color name="warning_left">#FFA62E</color>
1818

1919

20-
<color name="information">#9ec5fc</color>
20+
<color name="information">#C9E0FF</color>
2121
<color name="information_left">#1677FF</color>
2222

2323

2424

25-
<color name="error">#fa9f97</color>
25+
<color name="error">#FFC0BA</color>
2626
<color name="error_left">#F54334</color>
2727

2828

29-
<color name="message">#9f9fa1</color>
29+
<color name="message">#D1D1D1</color>
3030
<color name="message_left">#4C4A45</color>
3131

3232

0 commit comments

Comments
 (0)