[2/2] OmniGears: custom button light

Change-Id: Ie296d6dbce34e73c6de5a806b297f46bed42285d
diff --git a/res/xml/button_brightness_settings.xml b/res/xml/button_brightness_settings.xml
new file mode 100644
index 0000000..27f7ae2
--- /dev/null
+++ b/res/xml/button_brightness_settings.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--  Copyright (C) 2014 The OmniROM Project
+
+  This program is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-->
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+        xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
+
+    <org.omnirom.omnigears.preference.SystemSettingSwitchPreference
+        android:key="button_backlight_enable"
+        android:title="@string/button_backlight_enable_title"
+        android:defaultValue="true"/>
+    <org.omnirom.omnigears.preference.SystemSettingSwitchPreference
+        android:key="custom_button_use_screen_brightness"
+        android:title="@string/button_link_brightness"
+        android:summary="@string/button_link_brightness_summary"
+        android:defaultValue="false"
+        android:dependency="button_backlight_enable"
+        android:disableDependentsState="true" />
+    <org.omnirom.omnigears.preference.SeekBarPreference
+        android:key="button_manual_brightness_new"
+        android:title="@string/button_manual_brightness"
+        android:max="255"
+        settings:min="1"
+        android:persistent="false"
+        android:dependency="custom_button_use_screen_brightness" />
+    <org.omnirom.omnigears.preference.SeekBarPreference
+        android:key="button_timeout"
+        android:title="@string/button_timeout_title"
+        android:summary="@string/button_timeout_summary"
+        android:max="30"
+        settings:min="0"
+        settings:unitsLeft=""
+        settings:unitsRight="@string/unit_sec"
+        android:persistent="false"
+        android:dependency="button_backlight_enable" />
+    <org.omnirom.omnigears.preference.SystemSettingSwitchPreference
+        android:key="button_backlight_on_touch_only"
+        android:title="@string/button_backlight_on_touch_only_title"
+        android:summary="@string/button_backlight_on_touch_only_summary"
+        android:defaultValue="false"
+        android:dependency="button_backlight_enable" />
+</PreferenceScreen>
diff --git a/res/xml/button_settings.xml b/res/xml/button_settings.xml
index 3944d82..10c0b58 100644
--- a/res/xml/button_settings.xml
+++ b/res/xml/button_settings.xml
@@ -50,6 +50,13 @@
             android:summary="@string/hardware_keys_disable_summary"
             android:persistent="false"
             android:dependency="navigation_bar_show"/>
+        <Preference
+            android:key="button_brightness"
+            android:title="@string/button_backlight_title"
+            android:summary="@string/button_backlight_summary"
+            android:persistent="false"
+            android:fragment="org.omnirom.omnigears.ButtonBrightnessSettings" />
+
     </PreferenceCategory>
 
     <PreferenceCategory