Loading res/drawable/fastscroll_preview.xml 0 → 100644 +22 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2015 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. --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="44dp"/> <solid android:color="@color/hot_pink" /> </shape> res/layout/cities_activity.xml +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ <ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/cities_list" android:theme="@style/CitiesListViewTheme" android:theme="@style/CitiesListViewThemeOverlay" android:layout_width="match_parent" android:layout_height="wrap_content" android:divider="@null" Loading res/values-v21/styles.xml +19 −0 Original line number Diff line number Diff line Loading @@ -54,4 +54,23 @@ <item name="android:fontFamily">sans-serif-medium</item> </style> <style name="CitiesTheme" parent="DeskClockParentTheme"> <item name="android:fastScrollThumbDrawable">@drawable/red_fastscroll_thumb</item> <item name="android:fastScrollStyle">@style/FastScrollStyle</item> <item name="actionBarStyle">@style/CitiesActionBarStyle</item> </style> <style name="FastScrollStyle" parent="android:Widget.Material.FastScroll"> <item name="android:minWidth">48dip</item> <item name="android:minHeight">48dip</item> <item name="android:padding">16dip</item> <item name="android:textColor">@color/white</item> <item name="android:textSize">32sp</item> </style> <!-- This is to control the FastScroll background color --> <style name="CitiesListViewThemeOverlay"> <item name="android:colorControlActivated">@color/hot_pink</item> </style> </resources> No newline at end of file res/values/styles.xml +3 −14 Original line number Diff line number Diff line Loading @@ -100,8 +100,10 @@ </style> <style name="CitiesTheme" parent="@style/DeskClockParentTheme"> <item name="android:fastScrollPreviewBackgroundLeft">@drawable/fastscroll_preview</item> <item name="android:fastScrollPreviewBackgroundRight">@drawable/fastscroll_preview</item> <item name="android:fastScrollTextColor">@color/white</item> <item name="android:fastScrollThumbDrawable">@drawable/red_fastscroll_thumb</item> <item name="android:fastScrollStyle">@style/FastScrollStyle</item> <item name="actionBarStyle">@style/CitiesActionBarStyle</item> </style> Loading @@ -111,22 +113,9 @@ <item name="displayOptions">homeAsUp</item> </style> <!-- This is to control the FastScroll background color --> <style name="CitiesListViewTheme" parent="@style/CitiesTheme"> <item name="android:colorControlActivated">@color/hot_pink</item> </style> <!-- variants: v21 --> <style name="FabStyle" /> <style name="FastScrollStyle" parent="@android:style/Widget.Material.FastScroll"> <item name="android:minWidth">48dip</item> <item name="android:minHeight">48dip</item> <item name="android:padding">16dip</item> <item name="android:textColor">@color/white</item> <item name="android:textSize">32sp</item> </style> <style name="AlarmAlertFullScreenTheme" parent="AppCompatTranslucentDecorTheme" /> <style name="TimerAlertFullScreenTheme" parent="AppCompatTranslucentDecorTheme"> Loading src/com/android/deskclock/Utils.java +12 −20 Original line number Diff line number Diff line Loading @@ -613,28 +613,20 @@ public class Utils { /** * Returns string denoting the timezone hour offset (e.g. GMT -8:00) * @param useShortForm Whether to return a short form of the header that rounds to the * nearest hour and excludes the "GMT" prefix */ public static String getGMTHourOffset(TimeZone timezone, boolean showMinutes) { StringBuilder sb = new StringBuilder(); sb.append("GMT "); int gmtOffset = timezone.getRawOffset(); if (gmtOffset < 0) { sb.append('-'); public static String getGMTHourOffset(TimeZone timezone, boolean useShortForm) { final int gmtOffset = timezone.getRawOffset(); final long hour = gmtOffset / DateUtils.HOUR_IN_MILLIS; final long min = (Math.abs(gmtOffset) % DateUtils.HOUR_IN_MILLIS) / DateUtils.MINUTE_IN_MILLIS; if (useShortForm) { return String.format("%+d", hour); } else { sb.append('+'); return String.format("GMT %+d:%02d", hour, min); } sb.append(Math.abs(gmtOffset) / DateUtils.HOUR_IN_MILLIS); // Hour if (showMinutes) { final int min = (Math.abs(gmtOffset) / (int) DateUtils.MINUTE_IN_MILLIS) % 60; sb.append(':'); if (min < 10) { sb.append('0'); } sb.append(min); } return sb.toString(); } public static String getCityName(CityObj city, CityObj dbCity) { Loading Loading
res/drawable/fastscroll_preview.xml 0 → 100644 +22 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2015 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. --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="44dp"/> <solid android:color="@color/hot_pink" /> </shape>
res/layout/cities_activity.xml +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ <ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/cities_list" android:theme="@style/CitiesListViewTheme" android:theme="@style/CitiesListViewThemeOverlay" android:layout_width="match_parent" android:layout_height="wrap_content" android:divider="@null" Loading
res/values-v21/styles.xml +19 −0 Original line number Diff line number Diff line Loading @@ -54,4 +54,23 @@ <item name="android:fontFamily">sans-serif-medium</item> </style> <style name="CitiesTheme" parent="DeskClockParentTheme"> <item name="android:fastScrollThumbDrawable">@drawable/red_fastscroll_thumb</item> <item name="android:fastScrollStyle">@style/FastScrollStyle</item> <item name="actionBarStyle">@style/CitiesActionBarStyle</item> </style> <style name="FastScrollStyle" parent="android:Widget.Material.FastScroll"> <item name="android:minWidth">48dip</item> <item name="android:minHeight">48dip</item> <item name="android:padding">16dip</item> <item name="android:textColor">@color/white</item> <item name="android:textSize">32sp</item> </style> <!-- This is to control the FastScroll background color --> <style name="CitiesListViewThemeOverlay"> <item name="android:colorControlActivated">@color/hot_pink</item> </style> </resources> No newline at end of file
res/values/styles.xml +3 −14 Original line number Diff line number Diff line Loading @@ -100,8 +100,10 @@ </style> <style name="CitiesTheme" parent="@style/DeskClockParentTheme"> <item name="android:fastScrollPreviewBackgroundLeft">@drawable/fastscroll_preview</item> <item name="android:fastScrollPreviewBackgroundRight">@drawable/fastscroll_preview</item> <item name="android:fastScrollTextColor">@color/white</item> <item name="android:fastScrollThumbDrawable">@drawable/red_fastscroll_thumb</item> <item name="android:fastScrollStyle">@style/FastScrollStyle</item> <item name="actionBarStyle">@style/CitiesActionBarStyle</item> </style> Loading @@ -111,22 +113,9 @@ <item name="displayOptions">homeAsUp</item> </style> <!-- This is to control the FastScroll background color --> <style name="CitiesListViewTheme" parent="@style/CitiesTheme"> <item name="android:colorControlActivated">@color/hot_pink</item> </style> <!-- variants: v21 --> <style name="FabStyle" /> <style name="FastScrollStyle" parent="@android:style/Widget.Material.FastScroll"> <item name="android:minWidth">48dip</item> <item name="android:minHeight">48dip</item> <item name="android:padding">16dip</item> <item name="android:textColor">@color/white</item> <item name="android:textSize">32sp</item> </style> <style name="AlarmAlertFullScreenTheme" parent="AppCompatTranslucentDecorTheme" /> <style name="TimerAlertFullScreenTheme" parent="AppCompatTranslucentDecorTheme"> Loading
src/com/android/deskclock/Utils.java +12 −20 Original line number Diff line number Diff line Loading @@ -613,28 +613,20 @@ public class Utils { /** * Returns string denoting the timezone hour offset (e.g. GMT -8:00) * @param useShortForm Whether to return a short form of the header that rounds to the * nearest hour and excludes the "GMT" prefix */ public static String getGMTHourOffset(TimeZone timezone, boolean showMinutes) { StringBuilder sb = new StringBuilder(); sb.append("GMT "); int gmtOffset = timezone.getRawOffset(); if (gmtOffset < 0) { sb.append('-'); public static String getGMTHourOffset(TimeZone timezone, boolean useShortForm) { final int gmtOffset = timezone.getRawOffset(); final long hour = gmtOffset / DateUtils.HOUR_IN_MILLIS; final long min = (Math.abs(gmtOffset) % DateUtils.HOUR_IN_MILLIS) / DateUtils.MINUTE_IN_MILLIS; if (useShortForm) { return String.format("%+d", hour); } else { sb.append('+'); return String.format("GMT %+d:%02d", hour, min); } sb.append(Math.abs(gmtOffset) / DateUtils.HOUR_IN_MILLIS); // Hour if (showMinutes) { final int min = (Math.abs(gmtOffset) / (int) DateUtils.MINUTE_IN_MILLIS) % 60; sb.append(':'); if (min < 10) { sb.append('0'); } sb.append(min); } return sb.toString(); } public static String getCityName(CityObj city, CityObj dbCity) { Loading