forked from daproy/android_packages_apps_Settings
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Settings: Notification light(LED) settings
This commit adds the ability to configure the Notification light color and pulse rate both for the default and a custom applications list. This work was done in collaboration with Marko Mihovilić (m1h4) who wrote the initial implementation as a stand-alone application and helped with the fixes below. NOTE: Google Talk notifications originate from the "Google Services Framework" so in order to override their settings you need to add this package instead of the Google Talk package. Patch set 2 - fixes the color returned from picker (remove alpha) Patch set 3 - whitespace, formatting and minor code cleanup Patch set 4 - fix derp in Notification light checkbox default Patch set 5 - part 1 of the changes based on Danny's feedback Patch set 6 - part 2 of the changes based on Danny's feedback Patch set 7 - final tweaks to the layout, smaller icons etc. Patch set 8 - adds the ability to test LED (thanks Marko) - Use long click to get the test option - most of Danny's suggested fixes Patch set 9 - moves the test button to colorpicker - fixes the app picker dialog to load smoothly - minor string fixes to match google writing guidelines Patch set 11 - switched to using a hashmap for string manipulation - minor string and whitespace cleanup Patch set 12 - Use textUtil.join (thanks Danesh) - remove some orphaned code - don't refresh whole list on preference change Patch set 13 - Fix preference not updating when testing before saving - Automatically dismiss test dialog after test - remove some dead code - some cleanup - remove ^M from files Patch set 14 - Fix preference update after test, take daproy#2 Patch set 15 - Fix NPE on empty settings - Sort application list by name Patch set 16 - German translation Patch set 17 - German translation update Change-Id: I6837210367123bc02ea27a9b7b6b3cf80c738bf1
- Loading branch information
Showing
18 changed files
with
2,763 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright (C) 2010 Daniel Nilsson | ||
Copyright (C) 2012 THe CyanogenMod 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. --> | ||
|
||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" > | ||
|
||
<com.android.settings.notificationlight.ColorPickerView | ||
android:id="@+id/color_picker_view" | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_centerHorizontal="true" | ||
android:layout_marginLeft="10dp" | ||
android:layout_marginRight="10dp" /> | ||
|
||
<LinearLayout | ||
android:id="@+id/color_panel_view" | ||
android:layout_width="fill_parent" | ||
android:layout_height="40dp" | ||
android:layout_alignLeft="@id/color_picker_view" | ||
android:layout_alignRight="@id/color_picker_view" | ||
android:layout_below="@id/color_picker_view" | ||
android:layout_marginBottom="4dp" | ||
android:layout_marginTop="4dp" | ||
android:orientation="horizontal" > | ||
|
||
<com.android.settings.notificationlight.ColorPanelView | ||
android:id="@+id/old_color_panel" | ||
android:layout_width="0px" | ||
android:layout_height="fill_parent" | ||
android:layout_weight="0.5" /> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="fill_parent" | ||
android:layout_marginLeft="10dp" | ||
android:layout_marginRight="10dp" | ||
android:gravity="center" | ||
android:text="@string/picker_arrow" | ||
android:textColor="#ffffff" | ||
android:textSize="20sp" /> | ||
|
||
<com.android.settings.notificationlight.ColorPanelView | ||
android:id="@+id/new_color_panel" | ||
android:layout_width="0px" | ||
android:layout_height="fill_parent" | ||
android:layout_weight="0.5" /> | ||
</LinearLayout> | ||
|
||
<LinearLayout | ||
android:id="@+id/speed_title_view" | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_below="@id/color_panel_view" | ||
android:layout_marginLeft="10dp" | ||
android:layout_marginRight="10dp" | ||
android:layout_marginTop="4dp" | ||
android:orientation="vertical" > | ||
|
||
<View | ||
android:layout_width="match_parent" | ||
android:layout_height="2dp" | ||
android:background="@android:drawable/divider_horizontal_dark" /> | ||
|
||
<TextView | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="4dp" | ||
android:text="@string/pulse_speed_title" | ||
android:textAppearance="?android:attr/textAppearanceSmall" /> | ||
|
||
<LinearLayout | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="horizontal" | ||
android:paddingBottom="4dip" > | ||
|
||
<Spinner | ||
android:id="@+id/on_spinner" | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="1" /> | ||
|
||
<View | ||
android:layout_width="8dip" | ||
android:layout_height="fill_parent" /> | ||
|
||
<Spinner | ||
android:id="@+id/off_spinner" | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="1" /> | ||
</LinearLayout> | ||
</LinearLayout> | ||
|
||
</RelativeLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:id="@+id/app_light_pref" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:clickable="true" | ||
android:focusable="true" | ||
android:minHeight="?android:attr/listPreferredItemHeight" | ||
android:gravity="center_vertical" | ||
android:background="?android:attr/selectableItemBackground" > | ||
|
||
<ImageView | ||
android:id="@+android:id/icon" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="4dip" | ||
android:maxWidth="36dip" | ||
android:maxHeight="36dip" | ||
android:adjustViewBounds="true" | ||
android:layout_gravity="center" /> | ||
|
||
<RelativeLayout | ||
android:layout_width="0dip" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="4dip" | ||
android:layout_weight="1"> | ||
|
||
<TextView android:id="@+android:id/title" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:singleLine="true" | ||
android:textAppearance="?android:attr/textAppearanceMedium" | ||
android:ellipsize="marquee" | ||
android:fadingEdge="horizontal" /> | ||
|
||
<TextView android:id="@+android:id/summary" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_below="@android:id/title" | ||
android:layout_alignLeft="@android:id/title" | ||
android:textAppearance="?android:attr/textAppearanceSmall" | ||
android:textColor="?android:attr/textColorSecondary" | ||
android:maxLines="1" /> | ||
</RelativeLayout> | ||
|
||
<LinearLayout | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" > | ||
|
||
<TextView | ||
android:id="@+id/textViewTimeOnValue" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="right" | ||
android:textAppearance="?android:attr/textAppearanceSmall" /> | ||
|
||
<TextView | ||
android:id="@+id/textViewTimeOffValue" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="right" | ||
android:textAppearance="?android:attr/textAppearanceSmall" /> | ||
</LinearLayout> | ||
|
||
<ImageView | ||
android:id="@+id/light_color" | ||
android:layout_width="32dip" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" /> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,4 +59,4 @@ | |
|
||
</RelativeLayout> | ||
|
||
</LinearLayout> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<TextView xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:id="@+id/textViewName" | ||
android:paddingLeft="4dp" | ||
android:paddingRight="4dp" | ||
android:paddingTop="8dp" | ||
android:paddingBottom="8dp" | ||
android:textAppearance="?android:attr/textAppearanceMedium" > | ||
|
||
</TextView> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.