[3/3] OmniGears: Add ActiveDisplay settings to menu

Active display: Add options for date and am/pm [2/2]
Change-Id: I6af47b2fd47e77398eee98cc6e30b8fcf1a44d45

Active display: Add sunlight mode. [2/2]
Change-Id: I513c2ef1555ca48dfb553f80ca687d1ca9f27c55

Active display: allow hiding low priority notifications. [2/2]
Change-Id: I244743ed1a32f59065af3c4507f4132b7d3b0d72

Active display: Allow apps to be excluded from being displayed [2/2]
Change-Id: Ieb6368c050f5b46eec7398ab0162dc4fbf00a392

Active Display: Add always show pocket mode. [2/2]
Change-Id: I6f791c5727e98749780a5e9996e20d387ed98fa6

Base: https://gerrit.omnirom.org/#/c/2679/
Settings: https://gerrit.omnirom.org/#/c/2586/

Change-Id: Ibeb35ea4321cf8ee1bdfbb1c6c1f7ab841679932
diff --git a/res/layout/ad_excluded_app_item.xml b/res/layout/ad_excluded_app_item.xml
new file mode 100644
index 0000000..7c4364e
--- /dev/null
+++ b/res/layout/ad_excluded_app_item.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2008, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:minHeight="?android:attr/listPreferredItemHeight"
+    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
+    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+    android:paddingTop="8dip"
+    android:paddingBottom="8dip"
+    android:orientation="horizontal" >
+
+    <ImageView
+        android:id="@+id/app_icon"
+        android:layout_width="@android:dimen/app_icon_size"
+        android:layout_height="@android:dimen/app_icon_size"
+        android:layout_marginEnd="8dip"
+        android:layout_gravity="center_vertical"
+        android:scaleType="centerInside"
+        android:contentDescription="@null" />
+
+    <TextView
+        android:id="@+id/app_name"
+        android:layout_width="0dip"
+        android:layout_height="wrap_content"
+        android:layout_weight="1"
+        android:layout_gravity="center_vertical"
+        android:singleLine="true"
+        android:ellipsize="marquee"
+        android:textAppearance="?android:attr/textAppearanceMedium"
+        android:textAlignment="viewStart" />
+
+    <CheckBox android:id="@android:id/checkbox"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="8dip"
+        android:layout_gravity="center_vertical"
+        android:clickable="false"
+        android:focusable="false" />
+
+</LinearLayout>
diff --git a/res/layout/seek_bar_preference.xml b/res/layout/seek_bar_preference.xml
new file mode 100644
index 0000000..f7cf081
--- /dev/null
+++ b/res/layout/seek_bar_preference.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@android:id/widget_frame"
+    android:layout_width="fill_parent"
+    android:layout_height="wrap_content"
+    android:paddingLeft="8dp"
+    android:paddingTop="5dp"
+    android:paddingRight="10dp"
+    android:paddingBottom="5dp"
+    >
+
+    <TextView android:id="@android:id/title"
+            android:layout_alignParentLeft="true"
+            android:layout_alignParentTop="true"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:textAppearance="?android:attr/textAppearanceMedium" />
+
+    <TextView android:id="@android:id/summary"
+            android:layout_alignParentLeft="true"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:layout_below="@android:id/title"
+            android:textAppearance="?android:attr/textAppearanceSmall"
+            android:textColor="?android:attr/textColorSecondary" />
+
+    <TextView android:id="@+id/seekBarPrefUnitsRight"
+            android:layout_alignParentRight="true"
+            android:layout_below="@android:id/title"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textAppearance="?android:attr/textAppearanceSmall" />
+
+    <TextView android:id="@+id/seekBarPrefValue"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_toLeftOf="@id/seekBarPrefUnitsRight"
+            android:layout_below="@android:id/title"
+            android:gravity="right"
+            android:textAppearance="?android:attr/textAppearanceSmall" />
+
+    <TextView android:id="@+id/seekBarPrefUnitsLeft"
+            android:layout_below="@android:id/title"
+            android:layout_toLeftOf="@id/seekBarPrefValue"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textAppearance="?android:attr/textAppearanceSmall" />
+
+    <LinearLayout android:id="@+id/seekBarPrefBarContainer"
+            android:layout_alignParentLeft="true"
+            android:layout_alignParentBottom="true"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:layout_below="@android:id/summary">
+    </LinearLayout>
+
+</RelativeLayout>
diff --git a/res/values/custom_arrays.xml b/res/values/custom_arrays.xml
index 1cafba7..af57919 100644
--- a/res/values/custom_arrays.xml
+++ b/res/values/custom_arrays.xml
@@ -123,6 +123,41 @@
         <item>9</item>
     </string-array>
 
+    <!-- ActiveDisplay Notifications -->
+    <string-array name="ad_redisplay_entries" translatable="false">
+        <item>@string/ad_redisplay_never</item>
+        <item>@string/ad_redisplay_1m</item>
+        <item>@string/ad_redisplay_5m</item>
+        <item>@string/ad_redisplay_15m</item>
+        <item>@string/ad_redisplay_30m</item>
+        <item>@string/ad_redisplay_1h</item>
+        <item>@string/ad_redisplay_2h</item>
+        <item>@string/ad_redisplay_5h</item>
+    </string-array>
+
+    <string-array name="ad_redisplay_values" translatable="false">
+        <item>0</item>
+        <item>60000</item>
+        <item>300000</item>
+        <item>900000</item>
+        <item>1800000</item>
+        <item>3600000</item>
+        <item>7200000</item>
+        <item>18000000</item>
+    </string-array>
+
+    <string-array name="ad_pocket_mode_entries" translatable="false">
+        <item>@string/ad_pocket_mode_off</item>
+        <item>@string/ad_pocket_mode_notifications</item>
+        <item>@string/ad_pocket_mode_always</item>
+    </string-array>
+
+    <string-array name="ad_pocket_mode_values" translatable="false">
+        <item>0</item>
+        <item>1</item>
+        <item>2</item>
+    </string-array>
+
     <string-array name="recent_clear_all_button_location_entries" translatable="false">
         <item>@string/recent_clear_all_button_location_top_left</item>
         <item>@string/recent_clear_all_button_location_top_right</item>
diff --git a/res/values/custom_attrs.xml b/res/values/custom_attrs.xml
new file mode 100644
index 0000000..b856986
--- /dev/null
+++ b/res/values/custom_attrs.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2013, The ChameleonOS Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+    <declare-styleable name="SeekBarPreference">
+        <attr name="min" format="integer" />
+        <attr name="unitsLeft" format="string" />
+        <attr name="unitsRight" format="string" />
+    </declare-styleable>
+
+</resources>
\ No newline at end of file
diff --git a/res/values/custom_strings.xml b/res/values/custom_strings.xml
index c9ee678..ce949ee 100644
--- a/res/values/custom_strings.xml
+++ b/res/values/custom_strings.xml
@@ -22,6 +22,7 @@
     <string name="reset">Reset</string>
 
     <string name="bars_and_menus_settings">Bars and menus</string>
+    <string name="active_display_settings">ActiveDisplay</string>
     <string name="bars_and_menus_category_status_bar_title">Status bar</string>
     <string name="status_bar_battery_title">Battery style</string>
     <string name="status_bar_toggle_brightness">Brightness control</string>
@@ -198,6 +199,44 @@
     <string name="dialog_no_home_key_title">No home action</string>
     <string name="no_home_key">You have no button assigned to the \"Home\" action! This can make your device unusable!</string>
 
+    <!-- Active Display Notifications -->
+    <string name="ad_settings_title">Active display</string>
+    <string name="ad_settings_summary">Change active display settings</string>
+    <string name="ad_enable_title">Enable</string>
+    <string name="ad_enable_summary_on">Active display enabled</string>
+    <string name="ad_enable_summary_off">Active display disabled</string>
+    <string name="ad_text_title">Notification text</string>
+    <string name="ad_text_summary">Show the notification text around the ring.</string>
+    <string name="ad_all_notifications_title">All notifications</string>
+    <string name="ad_all_notifications_summary">Show all notifications including ongoing, non-clearable notifications.</string>
+    <string name="ad_hide_low_priority_title">Hide low priority</string>
+    <string name="ad_hide_low_priority_title">Hide low priority</string>
+    <string name="ad_hide_low_priority_summary">Hide low priority notifications such as those from Google Now.</string>
+    <string name="ad_pocket_mode_title">Pocket mode</string>
+    <string name="ad_pocket_mode_summary">Show active display notifications when you take the device out of your pocket.</string>
+    <string name="ad_redisplay_title">Redisplay notifications</string>
+    <string name="ad_brightness_title">Notification brightness</string>
+    <string name="ad_customizations_title">Customizations</string>
+    <string name="ad_excluded_apps_title">Excluded applications</string>
+    <string name="ad_excluded_apps_summary">Excluded applications will not show up in active display.</string>
+    <string name="ad_show_date_title">Show date</string>
+    <string name="ad_show_ampm_title">Show AM/PM</string>
+    <string name="ad_sunlight_mode_title">Sunlight mode</string>
+    <string name="ad_brightness_summary">Brightness level for displaying notifications when automatic brightness is not enabled.</string>
+    <string name="ad_show_date_summary">Show the date above the clock</string>
+    <string name="ad_show_ampm_summary">Show AM/PM indicator next to time when using 12hour format</string>
+    <string name="ad_sunlight_mode_summary">Invert the colors when in areas with bright light such as direct sunlight.</string>
+    <string name="ad_redisplay_never">Never</string>
+    <string name="ad_redisplay_1m">1 minute</string>
+    <string name="ad_redisplay_5m">5 minutes</string>
+    <string name="ad_redisplay_15m">15 minutes</string>
+    <string name="ad_redisplay_30m">30 minutes</string>
+    <string name="ad_redisplay_1h">1 hour</string>
+    <string name="ad_redisplay_2h">2 hours</string>
+    <string name="ad_redisplay_5h">5 hours</string>
+    <string name="ad_pocket_mode_off">Off</string>
+    <string name="ad_pocket_mode_notifications">Notifications only</string>
+    <string name="ad_pocket_mode_always">Always</string>
     <string name="bars_and_menus_category_recent_panel_title" >Recents menu</string>
 
     <!--  Recents clear all -->
diff --git a/res/xml/active_display_settings.xml b/res/xml/active_display_settings.xml
new file mode 100644
index 0000000..2f55c2f
--- /dev/null
+++ b/res/xml/active_display_settings.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The ChameleonOS Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
+    android:title="@string/ad_settings_title" >
+
+    <SwitchPreference
+        android:key="ad_enable"
+        android:persistent="false"
+        android:title="@string/ad_enable_title"
+        android:summaryOff="@string/ad_enable_summary_off"
+        android:summaryOn="@string/ad_enable_summary_on" />
+
+    <CheckBoxPreference
+        android:key="ad_text"
+        android:persistent="false"
+        android:title="@string/ad_text_title"
+        android:summary="@string/ad_text_summary"
+        android:dependency="ad_enable"/>
+
+    <CheckBoxPreference
+        android:key="ad_all_notifications"
+        android:persistent="false"
+        android:title="@string/ad_all_notifications_title"
+        android:summary="@string/ad_all_notifications_summary"
+        android:dependency="ad_enable"/>
+
+    <CheckBoxPreference
+        android:key="ad_hide_low_priority"
+        android:persistent="false"
+        android:title="@string/ad_hide_low_priority_title"
+        android:summary="@string/ad_hide_low_priority_summary"
+        android:dependency="ad_enable"/>
+
+    <ListPreference
+        android:key="ad_pocket_mode"
+        android:persistent="false"
+        android:title="@string/ad_pocket_mode_title"
+        android:summary="@string/ad_pocket_mode_summary"
+        android:entries="@array/ad_pocket_mode_entries"
+        android:entryValues="@array/ad_pocket_mode_values"
+        android:dependency="ad_enable"/>
+
+    <CheckBoxPreference
+        android:key="ad_sunlight_mode"
+        android:persistent="false"
+        android:title="@string/ad_sunlight_mode_title"
+        android:summary="@string/ad_sunlight_mode_summary"
+        android:dependency="ad_enable"/>
+
+    <ListPreference
+        android:key="ad_redisplay"
+        android:persistent="false"
+        android:dialogTitle="@string/ad_redisplay_title"
+        android:title="@string/ad_redisplay_title"
+        android:entries="@array/ad_redisplay_entries"
+        android:entryValues="@array/ad_redisplay_values"
+        android:dependency="ad_enable"/>
+
+    <PreferenceCategory
+        android:key="ad_customizations"
+        android:title="@string/ad_customizations_title" />
+
+        <org.omnirom.omnigears.chameleonos.AppMultiSelectListPreference
+            android:key="ad_excluded_apps"
+            android:persistent="false"
+            android:title="@string/ad_excluded_apps_title"
+            android:summary="@string/ad_excluded_apps_summary"
+            android:dependency="ad_enable" />
+
+        <CheckBoxPreference
+            android:key="ad_show_date"
+            android:persistent="false"
+            android:title="@string/ad_show_date_title"
+            android:summary="@string/ad_show_date_summary"
+            android:dependency="ad_enable"/>
+
+        <CheckBoxPreference
+            android:key="ad_show_ampm"
+            android:persistent="false"
+            android:title="@string/ad_show_ampm_title"
+            android:summary="@string/ad_show_ampm_summary"
+            android:dependency="ad_enable"/>
+
+        <org.omnirom.omnigears.chameleonos.SeekBarPreference
+            android:key="ad_brightness"
+            android:persistent="false"
+            android:title="@string/ad_brightness_title"
+            android:summary="@string/ad_brightness_summary"
+            android:max="100"
+            settings:min="0"
+            settings:unitsLeft=""
+            settings:unitsRight="%"
+            android:defaultValue="100"
+            android:dependency="ad_enable" />
+
+</PreferenceScreen>
\ No newline at end of file