[Nexus 5 Original Android Development] kufikugel:
well slim integration usually means it is not working strictly same as on other ROMs (like pa or cm). we thought about it deeper and asked us when does a user really want to be disturbed by a heads up....right on important notifications on only some apps...eg chat social network or email. aside that that a user need first to blacklist half of the apps and system apps...then again blacklist due that the user forgot some.... an absolutely no go from UX view. blacklists you will only see on slim if there is no other way lol.

basically we strictly follow googles idea behind. show it for important notifications.

well all is done from my side. only need to add on email app native support per account.....will do this evening.

just did the commit message.....will copy paste it here....pretty much explains how it works:

Frameworks: Heads up meets SlimKat....SlimKat meets Google IO [1/4]

First introduced from apple, showed as android version on PA as hover and now found

in android code as native implementation we want to do our interpretation of this feature.

Especially thanks PA and CM for some of the UX ideas.

We have basically split this feature in two parts.

1. Googles native integration. We keep it as is and use the native flags for it. Apps

(in our case Dialer, Mms, Email per account) can force show a heads up notification

if the notification is important. So basically same what was shown on Google IO the first

time to the public. Eg the dialer on SlimKat is doing exactly the same now like google want it.

Due that we use same flags like google every future app with heads up support will automatically

show as heads up.

2. Give the user an ability to enable heads up mode for third party apps which do not have a native

integration. Well first thought was on which apps a user would usally use it (keeping in minde the idea from google....heads up

is for important notifications and for nothing more)? Right on chat, email

or social apps. On all other apps it simply does not make sense at all. Which leads into the question why the

current integrations are handling blacklists or whitelists and enable it per default for all apps. This

is from UX point of view an absolutely no go (just imagine the user blacklists half of the 200 apps installed lol).

Aside that parsing long lists is a peformance problem.

So our attempt goes into another direction. Headsup for (native integration is another story) apps is disabled

by default. We bind the information directly to the application package. So each app carries the information itself.

The user can either enable it with a longlick in the notification drawer on the notification or in Settings->app->App info

as well via a check box. As soon it is enabled for this app every notification from this app will show as heads up as long

it is not an ongoing notification.

In general on system signed apps the user is not allowed to change the heads up state. Thats nothing the user should

decide....the system should do. Aside that it prevends user to enable heads up for eg IME selector etc etc.

Thats the basic concept behind. In addition to this concept following things were done.

- Introduce a new expanded notification flag. Apps can send it via extra metadata to force

a expanded heads up notification is it is needed (eg dialer).

- Add a user option to enable always expanded on heads up notification

- Introduce a snooze button. Every heads up notification has a snooze button on the top right. If the user press it

heads up is disabled for a certain time (like a do not disturb mode). The time length is user configurable in settings.

- Detect direction of the swipe. Left swipe will dismiss the notification (if it is not a non clearable). Right swipe will just

hide the heads up and the notification is still in background accessable in the notification drawer.

Other then that some fixes were done as well (eg utilize the back button, correctly handle the hiding of the heads up and some

other)

To summarize...heads up this way is very non intrusive and especially we do not need a bunch of settings or blacklists.

So it is pretty straight forward, fast, clean and user friendly.

Change-Id: I81a7473ca48eb5fd91263ec63c82957d8b3ad17b