Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 215d4402 authored by Luis Vidal's avatar Luis Vidal
Browse files

Add option to select temperature unit

Added a menu in the weather settings to select the
temperature unit. This setting will be visible only
if the user has at least one weather service provider
installed.

The weather settings layout was refactored to make room
for this new preference

Change-Id: I5e9f206573e0ff95fcee31a010b52530a907acc6
TICKET: CYNGNOS-2605
parent 23b30aae
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -32,16 +32,22 @@
                android:layout_marginBottom="12dip"
                android:src="@drawable/ic_settings_weather"
                android:tint="@color/weather_settings_icon_tint"
                android:contentDescription="@null">
        </ImageView>

                android:contentDescription="@null" />
        <TextView
                android:id="@+id/message"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textSize="18dp"
                android:textColor="?android:attr/textColorSecondary">
        </TextView>
                android:textColor="?android:attr/textColorSecondary" />

        <Button android:id="@+id/add_weather_provider"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:gravity="center"
                style="?android:attr/buttonBarButtonStyle"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:text="@string/weather_settings_add_weather_provider"
                android:textAllCaps="true" />
    </LinearLayout>
</FrameLayout>
+1 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2016 The CyanogenMod Project

+11 −0
Original line number Diff line number Diff line
@@ -592,4 +592,15 @@
        <item>No access</item>
    </string-array>

    <!-- Weather temperature -->
    <string-array name="weather_temp_unit_entries" translatable="false">
        <item>@string/weather_settings_temp_celsius</item>
        <item>@string/weather_settings_temp_fahrenheit</item>
    </string-array>

    <string-array name="weather_temp_unit_values" translatable="false">
        <item>1</item>
        <item>2</item>
    </string-array>

</resources>
+9 −0
Original line number Diff line number Diff line
@@ -1167,6 +1167,15 @@
    <string name="weather_settings_no_services_prompt">No weather provider services installed</string>
    <string name="weather_settings_button">Provider settings</string>
    <string name="weather_settings_activity_not_found">Unable to launch the settings menu of this provider</string>
    <string name="weather_settings_add_weather_provider">Add weather provider</string>
    <string name="weather_settings_play_store_market_url" translatable="false">market://search?q=cyanogenmodweatherprovider&amp;c=apps</string>
    <string name="weather_settings_play_store_http_url" translatable="false">http://play.google.com/store/search?q=cyanogenmodweatherprovider&amp;c=apps</string>
    <string name="weather_settings_general_settings_title">General</string>
    <string name="weather_settings_providers_title">Providers</string>
    <string name="weather_settings_temp_units_title">Temperature unit</string>
    <string name="weather_settings_temp_celsius">Celsius</string>
    <string name="weather_settings_temp_fahrenheit">Fahrenheit</string>
    <string name="weather_settings_keyword">weather</string>

    <string name="background_data_access">Background data access</string>
    <string name="allow_background_both">Over cellular data &amp; Wi\u2011Fi</string>
+40 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2016 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
                  xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
                  android:title="@string/weather_settings_general_settings_title"
                  settings:keywords="@string/weather_settings_keyword">
    <PreferenceCategory
            android:key="weather_general_settings"
            android:title="@string/weather_settings_general_settings_title"
            android:order="0">
        <ListPreference
                android:key="weather_temperature_unit"
                android:entries="@array/weather_temp_unit_entries"
                android:entryValues="@array/weather_temp_unit_values"
                android:title="@string/weather_settings_temp_units_title"
                android:summary="%s"
                android:persistent="false" />
    </PreferenceCategory>

    <PreferenceCategory
        android:key="weather_service_providers"
        android:title="@string/weather_settings_providers_title"
        android:order="1">

    </PreferenceCategory>
</PreferenceScreen>
Loading