summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2013-03-02 00:59:44 +0100
committerLinux Build Service Account <lnxbuild@localhost>2016-08-24 08:06:58 -0600
commita9879bf10566963bbdc6cb42a79356ad39b9fbd5 (patch)
treed8fa68764432ae182fc9bdc82156eed49d8851d0 /res
parent59d1062e8cd7ef514feffb3925f82b29c5101f6b (diff)
downloadandroid_packages_apps_DeskClock-a9879bf10566963bbdc6cb42a79356ad39b9fbd5.tar.gz
android_packages_apps_DeskClock-a9879bf10566963bbdc6cb42a79356ad39b9fbd5.tar.bz2
android_packages_apps_DeskClock-a9879bf10566963bbdc6cb42a79356ad39b9fbd5.zip
DeskClock: User-defined world cities
Support for add user-defined cities to the world clock Patchset 2: Added GPS query Patchset 3: Added GPS drawables Call requestGpsLocation in background Patchset 4: Added timezone resolution through Google Api Added Marco suggestions Rebased Patchset 5: Remove trailing whitespaces Patchset 6: Moved cm strings to the end of the file Rebased Patchset 7: Export DbCityProvider. Enforce write permission to DeskClock only Patchset 8: Fix FC when there is no default timezone Add content description to GPS button Don't create a new city record of city name + city tz already exists Patchset 9: Rebased Patchset 10: Rebased (Moved string to cm_string) Patchset 11: Cleanup Patchset 12: Use localized time zone names Patchset 13: Fix online timezone lookup Patchset 14: CleanUp. Save dialog state Patchset 15: Kill of async tasks when closing dialog Signed-off-by: Jorge Ruesga <jorge@ruesga.com> Conflicts: AndroidManifest.xml res/menu/cities_menu.xml res/values/cm_strings.xml src/com/android/deskclock/Utils.java src/com/android/deskclock/worldclock/CitiesActivity.java src/com/android/deskclock/worldclock/CityObj.java CRs-Fixed: 1014635 Change-Id: I99de103ce18dd009846689f5f2018072fd0e91bb
Diffstat (limited to 'res')
-rw-r--r--res/drawable-hdpi/ic_gps_disabled.pngbin0 -> 1564 bytes
-rw-r--r--res/drawable-hdpi/ic_gps_off.pngbin0 -> 1567 bytes
-rw-r--r--res/drawable-hdpi/ic_gps_on.pngbin0 -> 1974 bytes
-rw-r--r--res/drawable-mdpi/ic_gps_disabled.pngbin0 -> 985 bytes
-rw-r--r--res/drawable-mdpi/ic_gps_off.pngbin0 -> 926 bytes
-rw-r--r--res/drawable-mdpi/ic_gps_on.pngbin0 -> 1268 bytes
-rw-r--r--res/drawable-xhdpi/ic_gps_disabled.pngbin0 -> 2253 bytes
-rw-r--r--res/drawable-xhdpi/ic_gps_off.pngbin0 -> 2324 bytes
-rw-r--r--res/drawable-xhdpi/ic_gps_on.pngbin0 -> 2878 bytes
-rw-r--r--res/drawable/holo_selector_nonfocusable.xml27
-rw-r--r--res/drawable/ic_gps.xml20
-rw-r--r--res/drawable/ic_gps_anim.xml20
-rw-r--r--res/layout/city_add.xml76
-rw-r--r--res/menu/desk_clock_menu.xml4
-rw-r--r--res/values/strings.xml16
15 files changed, 163 insertions, 0 deletions
diff --git a/res/drawable-hdpi/ic_gps_disabled.png b/res/drawable-hdpi/ic_gps_disabled.png
new file mode 100644
index 000000000..fa0ab79d1
--- /dev/null
+++ b/res/drawable-hdpi/ic_gps_disabled.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_gps_off.png b/res/drawable-hdpi/ic_gps_off.png
new file mode 100644
index 000000000..1d123c481
--- /dev/null
+++ b/res/drawable-hdpi/ic_gps_off.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_gps_on.png b/res/drawable-hdpi/ic_gps_on.png
new file mode 100644
index 000000000..5138b70a1
--- /dev/null
+++ b/res/drawable-hdpi/ic_gps_on.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_gps_disabled.png b/res/drawable-mdpi/ic_gps_disabled.png
new file mode 100644
index 000000000..df16865c9
--- /dev/null
+++ b/res/drawable-mdpi/ic_gps_disabled.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_gps_off.png b/res/drawable-mdpi/ic_gps_off.png
new file mode 100644
index 000000000..beb87734d
--- /dev/null
+++ b/res/drawable-mdpi/ic_gps_off.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_gps_on.png b/res/drawable-mdpi/ic_gps_on.png
new file mode 100644
index 000000000..9e98ad9ed
--- /dev/null
+++ b/res/drawable-mdpi/ic_gps_on.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_gps_disabled.png b/res/drawable-xhdpi/ic_gps_disabled.png
new file mode 100644
index 000000000..fe612c4fd
--- /dev/null
+++ b/res/drawable-xhdpi/ic_gps_disabled.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_gps_off.png b/res/drawable-xhdpi/ic_gps_off.png
new file mode 100644
index 000000000..e34aecdbd
--- /dev/null
+++ b/res/drawable-xhdpi/ic_gps_off.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_gps_on.png b/res/drawable-xhdpi/ic_gps_on.png
new file mode 100644
index 000000000..d1d97685d
--- /dev/null
+++ b/res/drawable-xhdpi/ic_gps_on.png
Binary files differ
diff --git a/res/drawable/holo_selector_nonfocusable.xml b/res/drawable/holo_selector_nonfocusable.xml
new file mode 100644
index 000000000..c0ec9d5da
--- /dev/null
+++ b/res/drawable/holo_selector_nonfocusable.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ** 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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:exitFadeDuration="@android:integer/config_shortAnimTime">
+
+ <item
+ android:drawable="@android:color/holo_blue_dark"
+ android:state_pressed="true"/>
+ <item
+ android:drawable="@android:color/transparent"/>
+
+</selector> \ No newline at end of file
diff --git a/res/drawable/ic_gps.xml b/res/drawable/ic_gps.xml
new file mode 100644
index 000000000..9f6ead003
--- /dev/null
+++ b/res/drawable/ic_gps.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/ic_gps_disabled" android:state_enabled="false"/>
+ <item android:drawable="@drawable/ic_gps_on"/>
+</selector> \ No newline at end of file
diff --git a/res/drawable/ic_gps_anim.xml b/res/drawable/ic_gps_anim.xml
new file mode 100644
index 000000000..d85d3559e
--- /dev/null
+++ b/res/drawable/ic_gps_anim.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 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.
+-->
+
+<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false">
+ <item android:drawable="@drawable/ic_gps_off" android:duration="500" />
+ <item android:drawable="@drawable/ic_gps_on" android:duration="500" />
+</animation-list> \ No newline at end of file
diff --git a/res/layout/city_add.xml b/res/layout/city_add.xml
new file mode 100644
index 000000000..9521fcb81
--- /dev/null
+++ b/res/layout/city_add.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 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.
+-->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingLeft="8dip"
+ android:paddingRight="8dip"
+ android:orientation="vertical">
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/cities_add_city_city"
+ android:layout_marginTop="16dp"/>
+
+ <RelativeLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
+
+ <EditText
+ android:id="@+id/add_city_name"
+ android:layout_width="match_parent"
+ android:layout_height="48dp"
+ android:imeOptions="actionDone|flagNoFullscreen"
+ android:scrollHorizontally="true"
+ android:selectAllOnFocus="true"
+ android:paddingLeft="48dp"
+ android:inputType="textNoSuggestions">
+ <requestFocus />
+ </EditText>
+
+ <ImageButton
+ android:id="@+id/add_city_gps"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:contentDescription="@string/cities_add_city_gps_cd"
+ android:src="@drawable/ic_gps"
+ android:background="@drawable/holo_selector_nonfocusable"
+ android:scaleType="fitCenter"
+ android:layout_margin="5dp"
+ android:layout_alignLeft="@id/add_city_name"
+ android:layout_alignTop="@id/add_city_name"
+ android:layout_alignBottom="@id/add_city_name" />
+
+ </RelativeLayout>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/cities_add_city_timezone"
+ android:layout_marginTop="16dp"/>
+
+ <Spinner
+ android:id="@+id/add_city_tz"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="left|center_vertical"
+ android:spinnerMode="dropdown"
+ android:layout_marginBottom="16dp" />
+
+</LinearLayout> \ No newline at end of file
diff --git a/res/menu/desk_clock_menu.xml b/res/menu/desk_clock_menu.xml
index 485871449..1e54ed4b9 100644
--- a/res/menu/desk_clock_menu.xml
+++ b/res/menu/desk_clock_menu.xml
@@ -26,6 +26,10 @@
android:visible="false"
app:actionViewClass="android.support.v7.widget.SearchView"
app:showAsAction="ifRoom"/>
+ <item android:id="@+id/menu_item_add"
+ android:title="@string/menu_item_add"
+ android:icon="@drawable/ic_menu_add"
+ android:showAsAction="ifRoom|withText"/>
<item
android:id="@+id/menu_item_sort"
android:title="@string/menu_item_sort_by_gmt_offset"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 24264ee7d..ad7c46930 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -445,6 +445,22 @@
<!-- Menu item on Cities screen to sort by alphabetical order -->
<string name="menu_item_sort_by_name">Sort by name</string>
+ <!-- User-defined cities -->
+ <string name="menu_item_add">Add</string>
+ <string name="cities_add_city_title">Add city</string>
+ <string name="cities_add_city_city">City:</string>
+ <string name="cities_add_city_timezone">Timezone:</string>
+ <string name="cities_add_city_gps_cd">Tap to localize your current city</string>
+ <string name="cities_add_loading">Loading\u2026</string>
+ <string name="cities_add_searching">Searching\u2026</string>
+ <string name="cities_add_gps_no_results">GPS query returns no location results</string>
+ <string name="cities_add_gps_not_available">GPS not available</string>
+ <string name="cities_add_already_exists">The city already exists in the database</string>
+ <string name="cities_add_city_failed">Can\'t create the city</string>
+ <string name="cities_delete_city_title">Delete city</string>
+ <string name="cities_delete_city_msg">Do you want to delete <xliff:g id="city">%s</xliff:g>?</string>
+ <string name="cities_delete_city_failed">Can\'t delete the city</string>
+
<!-- Label for selected cities in Cities list view -->
<string name="selected_cities_label">Selected Cities</string>