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

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

Change-Id: Ia7b29f85d7a1286bd15dc4427727a683e133ab3f
Signed-off-by: SagarMakhar <sagarmakhar@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
beanstown106
2019-11-23 18:54:59 +05:30
committed by Hưng Phan
parent a421966684
commit df39ae045c
5 changed files with 177 additions and 0 deletions

View File

@@ -251,4 +251,18 @@
<item>2</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

@@ -429,4 +429,16 @@
<string name="notification_guts_kill_app_button_title">Kill app button</string>
<string name="notification_guts_kill_app_button_summary">Show a kill app button in the notification\'s longpress menu</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>

34
res/xml/carrier_label.xml Normal file
View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2020 The CherishOS 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"
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" />
<Preference
android:key="custom_carrier_label"
android:title="@string/custom_carrier_label_title" />
</PreferenceScreen>

View File

@@ -30,6 +30,11 @@
android:key="statusbar_icons"
android:title="@string/sb_icons">
<Preference
android:key="carrier_label"
android:fragment="com.cherish.settings.fragments.CarrierLabel"
android:title="@string/carrier_label_settings_title" />
<Preference
android:key="status_bar_clock"
android:fragment="com.cherish.settings.fragments.ClockDateSettings"