Frameworks: fix the random fc on pinch

Well logic error from me which can lead in an recycle bitmap fc due of a race
condition. Reason is simple it the animation needs for whatever reason longer then
the removing the tasks the view is probably still visible and recycle of the bitmap
results in a fc.

To fix it just remove the tasks after the animation is done and we definitly know
that no items are visble which are recycled.

Change-Id: I7878e02e6fb1887f8d11304550e083d107095a4a
Frameworks: go kitkat + style tweaks and follow googles color sheme

Googles color sheme on cards is

card: ffffff
aditional content: f5f5f5
background: e5e5e5

first two we did...background not. Follow the color sheme due it has a better contrast.

As well remove the non google rounded edges.

Allow drawing behin status and navigation bar if the bars are translucent

PS:
- due it is now a system window ensure that all other system windows are closed when opening recents.
PS
- minor tweaks
PS
- remove one unused flag
PS
- respect app system ui visibility status and reflect it for smoother experience
PS
- bring back TYPE_RECENT_OVERLAY window layouparams back to live. It was never documented
nor depreciated. Was used in the past for GB recents and is even updated till today although
nothing in the system is using it.

Make it fully functionall (it is basically just an extended TYPE_SYSTEM_DIALOG) and allow
this window type to extend its content behind navigation bar.

PS
- minor fix...init the systemUI flags for the view allready on preload to prevent positioning
of the listview.
PS
- draw always behind navigation bar as long it is not immersive mode or hide navigation bar mode
- add more margin to the delete icon for kill all

Change-Id: If38036dded961fcf0a6d8c2e7d2ba44a8e1dd08a
Frameworks: derp

well it does not effect us due that we proper preload etc. But if it is not
a cancel repload event should reset the mIsPreloaded flag

sorry

Change-Id: Icc531dcd6bae187473f65ec7da267c72f9edbcf6
Frameworks: SlimRecents make it RTL/LTR aware + scaling + lefty mode (1/3)

This commit adds several features:

- Make it fully RTL/LTR aware. Means it shows up on the oposite side if an RTL
  language was choosen. As well icon, textposition, menu etc follows RTL direction.
  So like AOSP guidelines suggest it is fully compatible now for all locals

- Add scaling mode....user can scale the overall size down (especially for the
  user with stock dpi requested)

- Add lefty mode. Recent panel shows up on the left edge instead of the right edge

As well this commit unlinks the construct of the card with the update of the content. This
reduces one update call on construct and gives a tight faster loading.

Change-Id: I4c5105f86644a08da81861851da7e0e347c26244

Conflicts:
	packages/SystemUI/res/values/cm_dimens.xml
	packages/SystemUI/res/values/cm_strings.xml
	packages/SystemUI/res/values/styles.xml
Frameworks: add favorite mode

Allow user to set favorite apps in recent task list. User can set them with
longpress on the app icon. This apps are always shown in the task list above
the first default one (on phone the first 2 which always show the last 2 active
tasks). Favorites are shown in order of last time they were called. Favorites
settings are saved permanently till the user removed it from favorites.

As well this commit fixes the wrong icon if an package has more then one
activity to call (eg Google+ and Google Photo).

Using for all now a unique identifier.

Change-Id: I3cd7dd6600389c73e678f382377b441612902833
Frameworks: notify arrayadapter early that data has changed on clear all

Recent clear all. Current behaviour is that we do not update the array adapter at all
due that it gets rebuild on next reload. But in very rare cases it happens that getView
want to update shortly after all is cleared althought the view is not visible anymore.

Whatever just call notifyDataSetChanged after List is cleared to work against it.

Change-Id: I61ca25358ebe164336ba349565459537861c5495
Frameworks: do not kill favorite recent apps

Due of a lot user requests and I basically like the idea (not a fan of clear all apps at all
due that it does not make sense android wise) we ehance the favorite recent apps feature.

This commit basically does not remove the apps from the task list which were marked from the user
as favorite.

3 possibilities:

- No favorites are in the task list - clear all behaves like it was before - all tasks cleared and panel closes

- favorites and non favorites are in the task list - clear all removes all non favorite tasks and favorite tasks stay.
  Yes without fancy animations....we want to be fast ;) - panel stays open

- only favorites are in the list - pinch to zoom out is blocked due that nothing is there to clear all.

single clear of a task with swipe behaves in all cases normal like it was before this change

Change-Id: Ia05562e0f59dfb023aa65ec3a40dd951594dc88e
SlimRecents: Adress the 50ms touch unsresponsive issue

User reported that if the screen is fully animated in that the touch
detection is not working for about the first 50ms. For user who are working
fast this is indeed an issue. Especially due that the recent screen speeds
up the workflow much already.

Problem is our third loading stage due that after the recent screen animates in
it calls getView on all elements which rebuilds the touch listeners and cause to
the slight timeframe where it is unresponsive.

Well the third loading stage was a left over from the first optimizations when
we started to develop this feature. Other optimizations are into place now so we
do not really need the third loading stage at all. So instead of handling now
the fix in the getView implementation of the arrayadapter we simply just remove the
third loading stage completely.

PS:
- small other optimization

Change-Id: Ibf46fbe393de4f9d6b867e6bdb9c331dff1dd38e
Fix pie control + slim recents issue

Fix slim recents showing without last task (or even empty)

as we can't set double tap or long press action for navbar and pie,
there are no need to (cancel) preload recent apps when pressing home via navbar or pie.

Change-Id: Ife7c9698ada4bf7d069bd32215f415a235cb6a2b
Frameworks: SlimRecents: Make expanded layout pretty

Instead of adding an extra box below the header expand it in the inner layout
so it is visual one card. Looks nicer, conform with google style and saves
a bit space

Change-Id: I6b406c622ac557a1ce6b81bfa86b4c96b492eceb
Frameworks: add 1dp more bottom padding

Change-Id: I8374994a67aadc7ea9b84cd22273c29b8b9ca88a
Frameworks: SlimRecents: user configurable default expanded mode (1/2)

A lot requests to customize the default behaviour

auto = like it is now....dependend on the overlay the first tasks are expanded other collapsed
always = always all expanded
never = always all collapsed

Of course still user changes directly in the recent panel counts more then the default settings
behaviour

PS
- correct code comment to new behaviour
PS
- fix typo

rebase

Change-Id: I468be296de3c50d0036d2805c0d0cb8e54248e57

Conflicts:
	core/java/android/provider/Settings.java
SlimRecents: fix sometimes missing first task

apply the fix for aosp recents

https://github.com/SlimRoms/frameworks_base/commit/760413134a5efe60c1d4473322e467152d71c80b

as well to slimrecents

Change-Id: Ibce0707cf516034675451d0440608bafe097c92d