diff --git a/res/values/cherish_arrays.xml b/res/values/cherish_arrays.xml
index ac304a0..0aa22f1 100644
--- a/res/values/cherish_arrays.xml
+++ b/res/values/cherish_arrays.xml
@@ -772,4 +772,57 @@
- 52
- 53
+
+
+
+ - @string/qs_weather_hidden
+ - @string/qs_temperature_image_show_scale
+ - @string/qs_temperature_image_hide_scale
+ - @string/qs_temperature_show_scale_hide_image
+ - @string/qs_temperature_hide_scale_hide_image
+ - @string/qs_show_image
+ - @string/weather_show_all_condition
+
+
+
+ - 0
+ - 1
+ - 2
+ - 3
+ - 4
+ - 5
+ - 6
+
+
+
+
+ - @string/qs_weather_hidden
+ - @string/qs_temperature_image_show_scale
+ - @string/qs_temperature_image_hide_scale
+ - @string/qs_temperature_show_scale_hide_image
+ - @string/qs_temperature_hide_scale_hide_image
+ - @string/qs_show_image
+
+
+
+ - 0
+ - 1
+ - 2
+ - 3
+ - 4
+ - 5
+
+
+
+
+ - @string/qsweather_position_qqs
+ - @string/qsweather_position_qsb
+ - @string/qsweather_position_both
+
+
+
+ - 0
+ - 1
+ - 2
+
diff --git a/res/values/cherish_strings.xml b/res/values/cherish_strings.xml
index f86c6bf..dbd3a22 100644
--- a/res/values/cherish_strings.xml
+++ b/res/values/cherish_strings.xml
@@ -861,4 +861,37 @@
Custom lockscreen date font
Double-line Lockscreen clock format
Use double-line clock instead of single line style for lockscreen clock
+
+
+ QS System weather style
+ Configure system weather
+ QuickSettings weather location
+ Hide weather
+ Show temp with scale and image
+ Show temp with image without scale
+ Show temp with scale
+ Show temp without scale
+ Show image
+ Show temp with scale,image and weather condition
+ QuickSettings
+ QuickStatusbar
+ Both
+
+
+ Launcher System weather style
+
+
+ Lockscreen System weather style
+
+
+ Weather Settings
+ Setup icon pack and weather service
+ Weather Settings
+ Weather service
+ System service settings
+ Condition icon pack
+ Note\u003a you can install new icon packs from play store by searching for \"Chronus icons\"
+ Tips\u003a \n\n1. Users can install new icon packs from play store by searching for \"Chronus icons\".\n\n2. Condition icon pack is used for weather icons on quick settings and sushi launcher at a glance.\n\n3. Long press the QuickSettings weather view/logo/temperature to access weather settings with ease.
+ QuickSettings Weather
+ Setup quicksettings weather views
diff --git a/res/xml/cherish_settings_lockscreen.xml b/res/xml/cherish_settings_lockscreen.xml
index 4c21bc7..5b242e3 100644
--- a/res/xml/cherish_settings_lockscreen.xml
+++ b/res/xml/cherish_settings_lockscreen.xml
@@ -73,8 +73,6 @@
android:title="@string/lock_screen_custom_clock_face_title"
android:entries="@array/lock_screen_custom_clock_face_entries"
android:entryValues="@array/lock_screen_custom_clock_face_values" />
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/com/cherish/settings/fragments/OmniJawsSettings.java b/src/com/cherish/settings/fragments/OmniJawsSettings.java
new file mode 100644
index 0000000..37c9a35
--- /dev/null
+++ b/src/com/cherish/settings/fragments/OmniJawsSettings.java
@@ -0,0 +1,189 @@
+/*
+ * Copyright (C) 2017 The OmniROM Project
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+*/
+
+package com.cherish.settings.fragments;
+
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.database.Cursor;
+import android.net.Uri;
+import android.os.Bundle;
+import androidx.preference.ListPreference;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceCategory;
+import androidx.preference.PreferenceScreen;
+import android.provider.SearchIndexableResource;
+import android.provider.Settings;
+import android.util.Log;
+
+import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+
+import com.android.settings.R;
+import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.Utils;
+import com.android.settings.search.BaseSearchIndexProvider;
+import com.android.settingslib.search.Indexable;
+
+import java.util.List;
+import java.util.ArrayList;
+
+public class OmniJawsSettings extends SettingsPreferenceFragment implements
+ Preference.OnPreferenceChangeListener, Indexable {
+ private static final String TAG = "OmniJawsSettings";
+ private static final String CATEGORY_WEATHER = "weather_category";
+ private static final String WEATHER_ICON_PACK = "weather_icon_pack";
+ private static final String DEFAULT_WEATHER_ICON_PACKAGE = "org.omnirom.omnijaws";
+ private static final String DEFAULT_WEATHER_ICON_PREFIX = "outline";
+ private static final String WEATHER_SERVICE_PACKAGE = "org.omnirom.omnijaws";
+ private static final String CHRONUS_ICON_PACK_INTENT = "com.dvtonder.chronus.ICON_PACK";
+
+ private PreferenceCategory mWeatherCategory;
+ private ListPreference mWeatherIconPack;
+
+ @Override
+ public int getMetricsCategory() {
+ return MetricsEvent.CHERISH_SETTINGS;
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ addPreferencesFromResource(R.xml.omnijaws_settings);
+ final PreferenceScreen prefScreen = getPreferenceScreen();
+
+ mWeatherCategory = (PreferenceCategory) prefScreen.findPreference(CATEGORY_WEATHER);
+ if (mWeatherCategory != null) {
+ prefScreen.removePreference(mWeatherCategory);
+ } else {
+ String settingHeaderPackage = Settings.System.getString(getContentResolver(),
+ Settings.System.OMNIJAWS_WEATHER_ICON_PACK);
+ if (settingHeaderPackage == null) {
+ settingHeaderPackage = DEFAULT_WEATHER_ICON_PACKAGE + "." + DEFAULT_WEATHER_ICON_PREFIX;
+ }
+ mWeatherIconPack = (ListPreference) findPreference(WEATHER_ICON_PACK);
+
+ List entries = new ArrayList();
+ List values = new ArrayList();
+ getAvailableWeatherIconPacks(entries, values);
+ mWeatherIconPack.setEntries(entries.toArray(new String[entries.size()]));
+ mWeatherIconPack.setEntryValues(values.toArray(new String[values.size()]));
+
+ int valueIndex = mWeatherIconPack.findIndexOfValue(settingHeaderPackage);
+ if (valueIndex == -1) {
+ // no longer found
+ settingHeaderPackage = DEFAULT_WEATHER_ICON_PACKAGE + "." + DEFAULT_WEATHER_ICON_PREFIX;
+ Settings.System.putString(getContentResolver(),
+ Settings.System.OMNIJAWS_WEATHER_ICON_PACK, settingHeaderPackage);
+ valueIndex = mWeatherIconPack.findIndexOfValue(settingHeaderPackage);
+ }
+ mWeatherIconPack.setValueIndex(valueIndex >= 0 ? valueIndex : 0);
+ mWeatherIconPack.setSummary(mWeatherIconPack.getEntry());
+ mWeatherIconPack.setOnPreferenceChangeListener(this);
+ }
+ }
+
+ public boolean onPreferenceChange(Preference preference, Object objValue) {
+ if (preference == mWeatherIconPack) {
+ String value = (String) objValue;
+ Settings.System.putString(getContentResolver(),
+ Settings.System.OMNIJAWS_WEATHER_ICON_PACK, value);
+ int valueIndex = mWeatherIconPack.findIndexOfValue(value);
+ mWeatherIconPack.setSummary(mWeatherIconPack.getEntries()[valueIndex]);
+ }
+ return true;
+ }
+
+ private void getAvailableWeatherIconPacks(List entries, List values) {
+ Intent i = new Intent();
+ PackageManager packageManager = getPackageManager();
+ i.setAction("org.omnirom.WeatherIconPack");
+ for (ResolveInfo r : packageManager.queryIntentActivities(i, 0)) {
+ String packageName = r.activityInfo.packageName;
+ if (packageName.equals(DEFAULT_WEATHER_ICON_PACKAGE)) {
+ values.add(0, r.activityInfo.name);
+ } else {
+ values.add(r.activityInfo.name);
+ }
+ String label = r.activityInfo.loadLabel(getPackageManager()).toString();
+ if (label == null) {
+ label = r.activityInfo.packageName;
+ }
+ if (packageName.equals(DEFAULT_WEATHER_ICON_PACKAGE)) {
+ entries.add(0, label);
+ } else {
+ entries.add(label);
+ }
+ }
+ i = new Intent(Intent.ACTION_MAIN);
+ i.addCategory(CHRONUS_ICON_PACK_INTENT);
+ for (ResolveInfo r : packageManager.queryIntentActivities(i, 0)) {
+ String packageName = r.activityInfo.packageName;
+ values.add(packageName + ".weather");
+ String label = r.activityInfo.loadLabel(getPackageManager()).toString();
+ if (label == null) {
+ label = r.activityInfo.packageName;
+ }
+ entries.add(label);
+ }
+ }
+
+ private boolean isOmniJawsEnabled() {
+ final Uri SETTINGS_URI
+ = Uri.parse("content://org.omnirom.omnijaws.provider/settings");
+
+ final String[] SETTINGS_PROJECTION = new String[] {
+ "enabled"
+ };
+
+ final Cursor c = getContentResolver().query(SETTINGS_URI, SETTINGS_PROJECTION,
+ null, null, null);
+ if (c != null) {
+ int count = c.getCount();
+ if (count == 1) {
+ c.moveToPosition(0);
+ boolean enabled = c.getInt(0) == 1;
+ return enabled;
+ }
+ }
+ return true;
+ }
+
+ public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+ new BaseSearchIndexProvider() {
+ @Override
+ public List getXmlResourcesToIndex(Context context,
+ boolean enabled) {
+ ArrayList result =
+ new ArrayList();
+
+ SearchIndexableResource sir = new SearchIndexableResource(context);
+ sir.xmlResId = R.xml.omnijaws_settings;
+ result.add(sir);
+
+ return result;
+ }
+
+ @Override
+ public List getNonIndexableKeys(Context context) {
+ ArrayList result = new ArrayList();
+ return result;
+ }
+ };
+}
\ No newline at end of file