Created
March 9, 2017 13:53
-
-
Save manojdcoder/7ae72215f00388407fd60a53f9ae9510 to your computer and use it in GitHub Desktop.
Android Custom Notification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/custom_image_notification_content" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<ImageView | |
android:id="@+id/custom_image_notification_left_icon" | |
android:layout_width="44dp" | |
android:layout_height="44dp" | |
android:layout_marginRight="10dp" | |
android:layout_gravity="center_vertical" | |
android:src="@drawable/appicon" /> | |
<ImageView | |
android:id="@+id/custom_image_notification_image" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:scaleType="centerCrop" | |
android:src="@drawable/banner" /> | |
</LinearLayout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.custom_image_notification); | |
contentView.setImageViewResource(R.id.custom_image_notification_left_icon, R.drawable.appicon); | |
contentView.setImageViewBitmap(R.id.custom_image_notification_image, R.drawable.banner); | |
notification.contentView = contentView; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment