Settings: complete overhaul/optimizing + drag drop sort + easy dev life

This patch introduces a tons off changes. Let me first describe the easy ones

- resorting and reordering of our settings to do not have redundant entries like we had
- centralize and remove duplicate code
- complete UI overhaul

and now the main point. A wish for every dev is as easy as possible to get an UI interface
for a new feature without coding much. So I introduce now a central drag drop and swipe list
class and fragment to get this (THANK A BUNCH TO CARL BAUER FOR THE drag sort and swipe classes
which are modified the base of this)

Doing bunch off code in frameworks and settings to handle the new feature you do not need anymore.

So how does it work......as usual the dev is doing the frameworks part stuff....doing this
the dev need to add in the central frameworks ButtonsHelper class (or can be as well a new one)
2 methods to get and put the settings value for this patch (check ButtonsHelper.java in frameworks
how this works...only some lines off code).
So now the dev needs to represent this in settings with a list for the user to handle it. This
can be done with less then 20 line code changes. Just call the fragment eg like this:

            <PreferenceScreen
                    android:key="navbar_targets_settings"
                    android:fragment="com.android.settings.slim.dslv.ButtonsListViewSettings"
                    android:title="@string/navbar_targets_title">
                <extra android:name="buttonMode" android:value="3" />
                <extra android:name="maxAllowedButtons" android:value="5" />
                <extra android:name="actionValues" android:value="shortcut_action_navring_values" />
                <extra android:name="actionEntries" android:value="shortcut_action_navring_entries" />
                <extra android:name="fragment" android:value="com.android.settings.slim.fragments.NavbarButtonFragment" />
            </PreferenceScreen>

so what do the extra values mean....you can set following available value (if not set default is used)

<extra android:name="maxAllowedButtons" android:value="5" />
-  how much entries are max allowed to add till the user get a warning (default is 5)

<extra android:name="actionValues" android:value="shortcut_action_navring_values" />
- which array values should be used for this feature from array.xml (default is shortcut_action_values)

<extra android:name="actionEntries" android:value="shortcut_action_navring_entries" />
- which array entries should be used for this feature from array.xml (default is shortcut_action_entries)

<extra android:name="fragment" android:value="com.android.settings.slim.fragments.NavbarButtonFragment" />
- you want a fragment showed on top of the list (like color settings or whatever just specify the fragment you want to have
  default is none

<extra android:name="disableLongpress" android:value="true" />
- your feature does not support longpress...turn it off so that the user cannot choose an longpress option (default is true)

<extra android:name="useAppPickerOnly" android:value="true" />
- you do not want to use an action array list like above and only an app picker.....turn it on (default is false)

<extra android:name="disableIconPicker" android:value="true" />
- you do not want that the user can change the icon of your feature (can choose between system icon/gallery icon/default).....turn it on (default is false)

<extra android:name="disableDeleteLastEntry" android:value="true" />
- you do not want that the user can delete the last entry (eg for navbar or pie usefull).....turn it on (default is false)

and last one which is the only value which need to be specified!!!!!!!
<extra android:name="buttonMode" android:value="3" />
- this says the ButtonListView fragment which method it should use in frameworks to get the provider values and this is the only java change you need
to do in settings. just to add 3 lines off code into ButtonsListView.java (check getConfig and setConfig Method....very easy)

So......what to do.....add the xml entry with the options you want to have.....add 3 lines off java code....and do not care...all other is
working automatically. As well in frameworks you have methods in ButtonsJavaHelper.java which gives you all that information back without
taking care of formating handling or whatever usually needs to be done. Easy example....you need the drawable for this action or app or whatever
was saved (maybe gallery maybe system icon or default icon) just call the ButtonsHelper.getButtonIconImage method and you get the drawable the user
want. You do not need to take care at all about it. You need the action or the description the user saved? no problem just call the get method
in ButtonsHelper class and you get a arraylist off buttonconfig object with all information you need (the handle off formating and convert
the objects into just one provider settings value happens all in background automatically). As well (for descripton) already well
formated....etc etc. So at least you do not have to take care on the settings....you do not have to take care of how I save best my values
in provider....just do your feature and get the information you want from central classes and methods which helps you which gives you a ButtonsConfig arraylist
back which contains all information you need.

More to see on frameworks com/android/internal/util/slim

ButtonsHelper
ButtonsConstants
ButtonsConfig

You want a demonstration....tooo lazy to do a video....just download or compile slim and try it out...drag drop sort...swipe away like
gmail.....all is possible. :p

you can see currently this feature
on Navbar buttons, Pie buttons (normal and second layer), Navring, lockscreen shorcuts, notification shortcuts

have fun and cheers

SlimRoms

Change-Id: Iaa6b09f0b6ac7167d2c5b7f291f4379d90e6c598

Conflicts:
	res/drawable-hdpi/ic_settings_quiet_hours.png
	res/drawable-mdpi/ic_settings_quiet_hours.png
	res/drawable-xhdpi/ic_settings_quiet_hours.png
	res/values/strings.xml
	res/xml/display_settings.xml
	res/xml/display_settings_rom.xml
	res/xml/interface_settings.xml
	res/xml/wifi_advanced_settings.xml
	src/com/android/settings/SecuritySettings.java
	src/com/android/settings/slim/DisplaySettings.java
	src/com/android/settings/slim/NavBarStyle.java
	src/com/android/settings/slim/NavbarSettings.java
	src/com/android/settings/slim/NavbarStyleDimenSettings.java
	src/com/android/settings/slim/StatusBar.java
	src/com/android/settings/slim/StatusBarClockStyle.java
	src/com/android/settings/slim/UserInterface.java

Conflicts:

	res/values/strings.xml
	res/xml/display_settings.xml
	res/xml/interface_settings.xml
	res/xml/settings_headers.xml
	res/xml/wifi_advanced_settings.xml
	src/com/android/settings/SecuritySettings.java
Squash Slim commits