Cherish: Custom Carrier Label & Carrier Label Placement [2/2]

Credit/Thanks to @Altaf-Mahdi @beanstown106 and @martincz

Change-Id: Ia7b29f85d7a1286bd15dc4427727a683e133ab3f
This commit is contained in:
beanstown106
2019-11-23 18:54:59 +05:30
committed by Hưng Phan
parent 8fe30d8344
commit fcfa74859b
5 changed files with 173 additions and 0 deletions

View File

@@ -303,4 +303,18 @@
<item>300000</item>
<item>600000</item>
</string-array>
<!-- Carrier Label -->
<string-array name="carrier_label_entries" translatable="false">
<item>@string/show_carrier_disabled</item>
<item>@string/show_carrier_keyguard</item>
<item>@string/show_carrier_statusbar</item>
<item>@string/show_carrier_enabled</item>
</string-array>
<string-array name="carrier_label_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
</resources>

View File

@@ -305,5 +305,17 @@
<string name="adaptive_playback_timeout_2_min">2 minutes</string>
<string name="adaptive_playback_timeout_5_min">5 minutes</string>
<string name="adaptive_playback_timeout_10_min">10 minutes</string>
<!-- Custom carrier label and position -->
<string name="carrier_label_settings_title">Carrier label</string>
<string name="carrier_label_settings_summary">Customize the carrier label</string>
<string name="custom_carrier_label_title">Custom carrier label</string>
<string name="custom_carrier_label_explain">Enter a custom label. Leave blank to use your network name</string>
<string name="custom_carrier_label_notset">Custom label currently not set</string>
<string name="show_carrier_title">Carrier label location</string>
<string name="show_carrier_disabled">Disabled</string>
<string name="show_carrier_keyguard">Lockscreen</string>
<string name="show_carrier_statusbar">Statusbar</string>
<string name="show_carrier_enabled">Both</string>
</resources>

View File

@@ -14,6 +14,12 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/statusbar_title"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<Preference
android:key="carrier_label"
android:title="@string/carrier_label_settings_title"
android:summary="@string/carrier_label_settings_summary"
android:fragment="com.cherish.settings.fragments.CustomCarrierLabel" />
<PreferenceCategory
android:key="status_bar_icons"

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2020 CherishOS
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"
android:title="@string/carrier_label_settings_title"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<com.cherish.settings.preferences.SystemSettingListPreference
android:key="status_bar_show_carrier"
android:title="@string/show_carrier_title"
android:entries="@array/carrier_label_entries"
android:entryValues="@array/carrier_label_values"
android:summary="%s"
android:defaultValue="1" />
<PreferenceScreen
android:key="custom_carrier_label"
android:title="@string/custom_carrier_label_title" />
</PreferenceScreen>