Frameworks: SlimPIE extended (1/2)

This commit introduces SlimPIE. A very popular feature which
was till now for us no point to integrate it because it did
not fit our concept. Now I found a bit time to program a PIE
which is much more extended then the usual kanged PIE on
most roms but still resource friendly. At this point
many thanks for the great basic idea to PA and the work
from Jens Doll from CM. Based on this ideas SlimPIE goes
it's way now.

@kangers....we would like to see if you can wait till we
released this feature this week.  Thanks a lot.

Features of SlimPIE

- custom Buttons (user can choose between 11 different default actions (like navbar/hardware key bind)
  + custom app/shortcut for every button
- custom longpress action for every button (user has  same possibility like the normal custom Button)
- button quantitiy up to 5 buttons (so 5 + 5 longpress actions are possible)
- selectable trigger positions + trigger width (with optical help to set up)
- turn off text and status information + abillity to hide statusbar information which are redundant
- turn off snap points
- turn off background
- ability to use SlimPIE only on expanded desktop as well as using it always
- integrated logic disable triggers which can conflict with system actions
  (like statusbar or navbar.....SlimPIE detects if one is present and turns this edge off
  temporaly)
- same for snap points
- option to disable bottom trigger and reduce left and right trigger when
  IME keyboard is active

Style feature:

- button color + transparency
- button pressed and button longpress color + transparency
- button outline color
- snap point color
- text color
- background color + transparency
- for every shortcut user can choose a  custom icon from gallery
- custom icon color
- custom icon  color mode (only system icons eg or gallery icons + system icons or all icons)
- Pie size

Also it is possible via overlay to set a minimum, default and max trigger height
due that some phones need a bit adjustment on that (this setting reflects on
the trigger seekbar in settings user can adjust)

Screenshots:

https://dl.dropboxusercontent.com/u/106208842/use_it_for_app_shortcuts.png
https://dl.dropboxusercontent.com/u/106208842/other_colors_or_icons_no_problem.png

Last PatchSet:
- reduce trigger sizes and disable bottom trigger if IME shows up
  optional in trigger settings, default value is on
- DEBUG mod fixes
- autoHide feature worked in
- string corrections
- some minor fixes

Change-Id: I9bcc88375bbd770b0f5bd24fc84aaf7cdbf17238

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/res/values/colors.xml
	packages/SystemUI/res/values/dimens.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java
	packages/SystemUI/src/com/android/systemui/statusbar/policy/CircleBattery.java
	packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java

Conflicts:
	packages/SystemUI/res/values/colors.xml
	packages/SystemUI/res/values/dimens.xml
	packages/SystemUI/res/values/strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java

Conflicts:
	packages/SystemUI/res/values/colors.xml
	packages/SystemUI/res/values/dimens.xml
	packages/SystemUI/res/values/strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
	packages/SystemUI/src/com/android/systemui/statusbar/policy/CircleBattery.java
Remove Widget View button for now

Change-Id: Ia46028c7090b11b2d9a7f758ddeb86173068db3c
Frameworks: fix possible NPE

due a race condition this can happen....prevend it

cheers

Change-Id: I65222389c6b0beecaebed915644ab5e800c5f119
Frameworks: Race conditions can be funny

especially on slower phones. Whatever this commit
changes the disable logic for PIE on lockscreen.
With this correction SlimPIE is now unbreakable
lmao

cheers

Change-Id: I442f771b57f1cbeb661418dea17ca0f4362428c5

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
Frameworks: kufikugel should not work with headaches

small correction....now all triggers are disabled on
Lockscreen like it should

cheers

Change-Id: I33b23e082135662635eb304726ae075ad26a1f41

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
Frameworks: Fix SlimPIE mirror

as reported on the right edge the buttons are in wrong order. This
commit fixes this.

Change-Id: I365cbc857fd3492632bfe4b5b34abe2321b4006b
Frameworks: SlimPIE the second (1/2)

This commit changes the following:
- add possibility to set trigger height on the left and right trigger
- add possibility to set gravity on the lef and right trigger
- change touch detection logic and calculation (it shows now up immediately...super fast :p)
- reduces values in dimens.xml because of the new touch detection much lesser are needed
- remove on settings the shown values on the left @seekbar on entries where it does not make sense
- reset option for trigger dimensions
- minor string changes
- cleanup
- minor bugfixes

for me it is now like a PIE should be lol

IMPORTANT FOR ALL DM'S:
I reduced the dimens.xml to values which are for most of our phones good
to go as default value (tuna, crespo, nozomi, grouper can handle even lower
values (3dp) which the user can set of course). d2 and other should be fine as well
with the default value. sgs I series I think need an overlay to push them
a bit up. Please test and submit your overlays to our gerrit.

cheers

Change-Id: I4434f54c0ef858b239c112e8071b677d3bb519d8

Conflicts:
	core/java/android/provider/Settings.java
Frameworks: SlimPIE second layer (1/2)

I promissed yesterday to stop working on SlimPIE....but due
team and user whishes I decided to do a last tweak so that
all are happy.

This commit introduces the following:
- enable second buttons row
- up to 7 buttons + 7 longpress buttons
- usual customizations on that buttons
- means it is possible to add 5 + 5 on first row and 7 + 7 on second row
- resource friendly...reusing most of present code
- new introduced observer for second row is just
  observing when second row is really enabled
- due optimizations we can hold the speed and responsive we
  introduced yesterday on same level
- reduce default size back to 1
- some minor changes

Now SlimPIE is finished

Screenshots (first shows default values for first and second row):
https://dl.dropboxusercontent.com/u/106208842/Screenshot_2013-05-01-02-30-47.png
https://dl.dropboxusercontent.com/u/106208842/Screenshot_2013-05-01-02-36-25.png

cheers

Change-Id: I0362649d4b275cef4ce0823e6bdf965abcc59601

Conflicts:
	core/java/android/provider/Settings.java

Conflicts:
	core/java/android/provider/Settings.java

Conflicts:
	core/java/android/provider/Settings.java
Update Pie Color

Change-Id: I33fdfaada1e2e6a7d02c132a69d4e2a919bbd76f
Reduced padding on pie to screen edges

Change-Id: I179e1dd1a5020c02fa489539c841f603519b42bf
Frameworks: make right pie mirror optional (1/2)

due 70% user feedback the wanted to have the right pie
mirrored on the horizontal axis  because of usability...the other 30% want a visual
logic....so a point to make it optional

default value is mirrored

cheers

Change-Id: I2ecec3c7570abb8d92d0bf3bc788b00035577656

Conflicts:
	core/java/android/provider/Settings.java

Conflicts:
	core/java/android/provider/Settings.java
Fix: reported disable redundant statusbar information

Current state we introduced with first SlimPIE patch is that
if the user disable statusbar information (clock/date/airplanemodeicon)
that it is always hidden...even if the user set SlimPIE to only on
expanded desktop mode. That is not consistent and some user
wonder why the do not have this information any more in normal mode.

This commit fixes this.....respects also the expanded mode hide
only navbar.....as well a small cleanup from old battery code.
Airplanemodeicon hide I removed from redundant hide information now....
to change that on the fly would need an observer and a bit code rearrange
which does not fit the use compared to the resources we would use then.
Beside that all other icons are as well shown because our PIE does not
show signal strength etc.

Cheers

Change-Id: I53f1fed10a13551e7642e5b00c1d3b88a9622ab0

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java
	packages/SystemUI/src/com/android/systemui/statusbar/policy/CircleBattery.java

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/policy/SbBatteryController.java
Frameworks: longpress button PIE color does not change on the fly

forgot to observe this one option

cheers

Change-Id: I80e9896cc298f98f189ae6f96e6710c9a35a718e
Frameworks: SlimPIE trigger corrections

Sometimes it is good to release stuff and let the ppl test...so some
smaller issues on the automatic trigger detection for navbar and statusbar
came up and we can resolve the last one. This commit addresses following
reported issues:

- Fix bottom trigger show up on landscape when navbar is at the right side
- Fix if expanded desktop mode is "hide only navbar"...statusbar trigger was on
- Fix respect navbar 0dp values you can set for navbar
- a bit comments in the code :p

For the guys who want to see how the triggers are reacting...turn in
Basestatusbar debug value on....and you can permanently see what
the triggers are doing. Tried now all conditions which are possible
as well on tablet....cannot find any issue now.

cheers

Change-Id: I77698c55af2db5d35a2385761b67cb000a8a5b55

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
Fix: external storage problem PIE applications + last optimize

If the user binds an app which is located on the
external sdcard and is rebooting the button icon
will be left blank because the PIE is already
constructed before the sdcard is mounted. To avoid
this we listen to the app available intents.
If it is not available it shows the
none graphics. When available it shows the
correct app icon. So that the user can clearly see
this app is accessable or not. As well when the
user goes into mass storage mode or does
unmount the sdcard or whatever case could
happen that the application is not there.

This commit optimize as well the last open things.
BroadcastReceiver as well settingsobserver
are completly turned of when PIE is not in use
as well we destroy the object. I am a friend of
optimizing....think more is not possible and can
be for sure now called to be the resource less
using PIE around.

With this commit I will finally close now project
SlimPIE....all reported issues are done and I want
to begin a new project :p

The application storage problem should be also done
for navbar and navring
which will follow in a sepperat commit

cheers

Change-Id: I814860b9bc843e824e7e36bb521c402b86d24989
Fix: reported back button custom Icon issue

recents custom icon replaced the back button custom icon

Change-Id: Ib8c3008b6cec6f6d18bafd710e790d0e329c7a23
Frameworks: Allow smaller SlimPIE sizes + multiDpi fixes (1/2)

Due team, user and kanger wishes I needed to do again something :p
Hopefully now really the last thing :D Is now in full range as well usable
for higher dpi then our stock dpi

This commit does:
- allow bigger size range for SlimPIE layout
- icon are now resized on smaller sizes (only then) then default size
  which allows much smaller overall size
- slight better positiong of the icons in the button item
- Fix: reported issues custom Icons are sometimes to small
- Fix: reported issue that estimated container size took not PIE_SIZE
  into account (follows now on every dpi and size the activation point)
- Fix: Settings style seekbar resets sometimes to last setted value
- Settings: a bit code rearrangement (not needed but I was bored lol)

And now really finished :p

cheers

Change-Id: Ic3e69be4de0b0be8758d9d56ced6a65f104693c4
Frameworks: revert to our old default size (1/2)

played so much with the stock dpi values to optimize that
I set the default value for our slim dpi a bit to low :p

Roms which use stock phon dpi can leaver it like it is

But should kang the correspondent frameworks patch which
allows more flexible size changes

NOTE: check that the default size value is same like settings

cheers

Change-Id: I8e0c44185e8789cf8599868e791456e6856f08bb
Frameworks: Remove observer

thanks to Jens....remove PieLayout observer
completly

cheers

Change-Id: Icb722495b2d14c91b630f638f790dbcb14bbcef9
Frameworks: SlimPIE optimize optimize optimize

- stop listening on TelephonyManager if pie is disabled
- reuse already constructed SnapPoints
- pass trough mPieTriggerMask and mPieTriggerSlots
- a bit code cleanup

cheers

Change-Id: Ieef66e8cd7abe89cd419f2f368ef06f09d4e40b4

Conflicts:
	core/java/android/provider/Settings.java

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java