Want to create custom notification to statusBar like this ??
Follow next,
Requirements -
- Little bit knowledge of xml
- Android Studio
- Curiosity
Let’s get started
Step 2 (Xml Section)
In your android studio create any design.
Example -
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@mipmap/ic_launcher" />
<TextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Hii, this is a custom image notification with text.
This notification is built by Vraj Panchal and made on Appzard
by using Notification Style component.
How is this notification ??
Thankyou 😊😊"
android:textColor="#151515"
android:textSize="17dp"
android:textStyle="bold" />
Step 3 (Xml in notepad)
Copy paste your xml from android studio to notepad into relative view like this -
and save file as .xml
Step 4 (Final Setup)
Import .xml file in asset.
Then,
In Notification Style component , set custom notification source to .xml file
Step 5 (Blocks Section)
Here, viewId is set to “image” because in your xml file you set ImageView id to image.
Next,
Same here viewId is set to “text” as you have set TextView id to text in your xml file.
Yup Completed
CustomNotificationStyle.xml
TestNotification.apk
You can try creating more codes like this one and post your work here.
Kindness multiplies Kindness, So be Kind