How to add splash art to an android notification - android

I came across this notification while doing some research and it has me wondering... how do you include this splash art in the notification list on Android?
I have not seen an Android app do this before. Checking Google's documentation (https://developer.android.com/preview/notifications.html), I don't see it mentioned.
Any thoughts or ideas on how this is accomplished?
http://postimg.org/image/mtan1vcfn/

You need a custom notification layout via RemoteViews. Have a look at the documentation.
You first create a RemoteViews with your custom layout. This is the normal XML file you are used to. Then call the Notification.Builder.setContent() and pass in your RemoteViews.
And, dont forget to set the small icon for your notification or else it just wont display.

Related

Is it possible to use a custom (non drawable) smallIcon in an Android notification?

I would like to use an icon via a url as opposed to an already included drawable. Is this possible? The only method signature for setSmallIcon accepts an int for a Drawable resource.
However, what can I do if I want to include a smallIcon in the push notification that I'm sending? (Let's say for instance another user's gravatar).
No, you cannot set a custom smallIcon for a notification, as per the documentation and training section. However, as CommonsWare commented, you can set a custom largeIcon. This type of icon is shown when the user expands the notification panel, or on the "heads-up" notifications in Android 5.0+ (when the priority is at least HIGH). This can be done by calling setLargeIcon(myBitmap) on your Notification.Builder object. myBitmap can be any Bitmap object, loaded from the internet or otherwise.
I believe the reasoning behind this is so that the user can always quickly identify which apps are trying to notify them. Otherwise, the user would have to try to figure out what each new icon meant when just quickly checking notifications.

Android Crouton library implementing Custom Views

Is it possible to completely change the Layout of a Crouton? I've seen a few of posts about changing the view which actually came down to just wanting to change the font but nothing about actually changing the layout.
I've already got croutons displaying nicely and been playing about with styles but couldn't quite find how to do what I want. Basically what I want is something like this, which dismisses the crouton when clicking the cross. So it's just a textview and a button!
I did see this within the Crouton Library but couldn't really see how to use it for my purpose.
public static Crouton make(Activity activity, View customView) {
return new Crouton(activity, customView);
}
Follow this link you may get answer
Another Link
His idea is to show in-app notifications (not to be confused with Android’s persistent notifications) at a fixed place of the Activity to which the notification is relevant. This way the context of the notification is always correct

How to show message count in notification

I am using Google's Push notification and I want to show the number of notification in the notification icon, instead of showing the multiple notifications. Something like this -
Is there a method or something in the Notification Class for android?
the Notification class should be used for displaying notifications on the top bar (like the Gmail notifications). From what I understood, you can just use a normal TextView applying some styles to make it look nice and place it inside your screen.
You can select the icon you will display when the notification is created.
With .setsmallIcon() I think.
I also encourage you to implement bigtextviews for JellyBean. NoficationCompat2 is a good library to manage this elegantly on different Android versions.

android: How can I implement first time tutorial like Go Launcher in my app?

Go Launcher have a nice first-time tutorial. it is very similar to Stock ICS first time run. I want to learn how to make the similar tutorial display at the first launch of my app. How can I implement this Transparent view (which interacts with screen objects) in my android app?
I was trying to do something similar using a transparent activity with a viewpager inside it. I wanted static 'tutorial' images that users could swipe through.
One of the answers to my question mentioned an interesting library (called ShowcaseView). It seems like it may be a good fit for your requirements as well.
https://github.com/Espiandev/ShowcaseView
You can either use a FrameLayout or RelativeLayout as root of your Activity/Fragment, and put your "first time" View upon content with a (almost) transparent background, or use another Activity/Fragment themed with a transluscent window. (like this)
I'd rather use an Activity/Fragment, but this is up to you!
I wrote little library That contains a simple component for making ​​a app tour. It`s very restricted to my case but maybe could be your case . Single LessonCardView Showed onstartactivity for the first time or on button click Any criticism ,help or advice will be appreciated. thanks https://github.com/dnocode/DnoLib
You can implement a first-time user guide with the Spotlight library by TakuSemba.
It is similar to the one shared above and it is still well-maintained (as of 2021).
https://github.com/TakuSemba/Spotlight

Is it possible to create a custom notification with controls such as buttons in Android? How?

According to the Android Developers' Guide, it is possible to create a custom notification view. However, is it possible to create one with controls such as buttons and text views? If yes, how?
Note that I think it has something to do with PendingIntent.
Create a RemoteViews object -- like you would for an app widget -- and put it in the contentView public data member of the Notification.

Categories

Resources