Cherish:Add keyguard weather style (2/2)

DennySPb: use listpreference

Change-Id: I10c965a4a50d5c59f27c5019c3e0f1081734bf52
Signed-off-by: DennySPb <dennyspb@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
Ali B
2019-06-04 13:54:38 +03:00
committed by Hưng Phan
parent 7287e081fc
commit fd8b4b59fa
4 changed files with 34 additions and 12 deletions

View File

@@ -439,4 +439,13 @@
<item>1</item>
<item>2</item>
</string-array>
<string-array name="lockscreen_weather_style_entries">
<item>@string/lockscreen_weather_omni_style_title</item>
<item>@string/lockscreen_weather_pixel_style_title</item>
</string-array>
<string-array name="lockscreen_weather_style_values" translatable="false">
<item>0</item>
<item>1</item>
</string-array>
</resources>

View File

@@ -537,4 +537,9 @@
<string name="weather_icon_pack_title">Condition icon pack</string>
<string name="weather_icon_pack_note">Note\u003a you can install new icon packs from play store by searching for \"Chronus icons\"</string>
<string name="weather_icon_pack_info_title">Condition icon pack is used in quick settings and lock screen</string>
<!-- Lockscreen weather style -->
<string name="lockscreen_weather_style_title">Weather style</string>
<string name="lockscreen_weather_omni_style_title">Omni style</string>
<string name="lockscreen_weather_pixel_style_title">Pixel style</string>
</resources>

View File

@@ -207,6 +207,16 @@
android:summary="@string/lockscreen_weather_enabled_summary"
android:defaultValue="false" />
<com.cherish.settings.preferences.SystemSettingListPreference
android:key="lockscreen_weather_style"
android:title="@string/lockscreen_weather_style_title"
android:dialogTitle="@string/lockscreen_weather_style_title"
android:entries="@array/lockscreen_weather_style_entries"
android:entryValues="@array/lockscreen_weather_style_values"
android:defaultValue="0"
android:dependency="lockscreen_weather_enabled"
android:summary="%s" />
<Preference
android:key="omnijaws_settings"
android:icon="@drawable/ic_weather"

View File

@@ -39,13 +39,15 @@ import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.Utils;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
import com.android.settingslib.search.SearchIndexable;
import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;
@SearchIndexable
public class OmniJawsSettings extends SettingsPreferenceFragment implements
Preference.OnPreferenceChangeListener, Indexable {
Preference.OnPreferenceChangeListener {
private static final String TAG = "OmniJawsSettings";
private static final String CATEGORY_WEATHER = "weather_category";
private static final String WEATHER_ICON_PACK = "weather_icon_pack";
@@ -165,19 +167,15 @@ public class OmniJawsSettings extends SettingsPreferenceFragment implements
return true;
}
public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider() {
@Override
public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
boolean enabled) {
ArrayList<SearchIndexableResource> result =
new ArrayList<SearchIndexableResource>();
SearchIndexableResource sir = new SearchIndexableResource(context);
public List<SearchIndexableResource> getXmlResourcesToIndex(
Context context, boolean enabled) {
final SearchIndexableResource sir = new SearchIndexableResource(context);
sir.xmlResId = R.xml.omnijaws_settings;
result.add(sir);
return result;
return Arrays.asList(sir);
}
@Override