Cherish:Status network traffic [2/2]

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
ezio84
2022-08-26 22:41:53 +07:00
committed by Hưng Phan
parent 0e741b0832
commit afdba0599c
4 changed files with 150 additions and 0 deletions

View File

@@ -189,5 +189,13 @@
<!-- Launch music player when headset is connected -->
<string name="headset_connect_player_title">Launch music app on headset connection</string>
<string name="headset_connect_player_summary">Launch the default music app when headset is connected</string>
<!-- Network traffic -->
<string name="network_traffic_title">Network traffic indicator</string>
<string name="network_traffic_summary">Enable or disable network speed indicator in status bar</string>
<string name="network_traffic_master_switch_title">Use Network Traffic Indicator</string>
<string name="network_options_title">Options</string>
<string name="network_traffic_autohide_title">Hide network traffic indicator if inactive</string>
<string name="network_traffic_autohide_summary">Hide when network traffic indicator is below 1 KB/s</string>
</resources>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2019-2022 The CherishOS
SPDX-License-Identifier: Apache-2.0
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:title="@string/network_traffic_title">
<com.cherish.settings.preferences.SystemSettingMainSwitchPreference
android:key="network_traffic_state"
android:title="@string/network_traffic_master_switch_title"
android:defaultValue="false" />
<PreferenceCategory
android:title="@string/network_options_title">
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="network_traffic_autohide_threshold"
android:title="@string/network_traffic_autohide_title"
android:summary="@string/network_traffic_autohide_summary"
android:dependency="network_traffic_state"
android:defaultValue="false" />
</PreferenceCategory>
</PreferenceScreen>

View File

@@ -14,5 +14,11 @@
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="network_traffic_settings"
android:title="@string/network_traffic_title"
android:summary="@string/network_traffic_summary"
android:fragment="com.cherish.settings.fragments.NetworkTrafficSettings" />
</PreferenceScreen>