diff --git a/app/src/main/java/com/sevtinge/cemiuiler/module/systemui/statusbar/network/NetworkSpeed.kt b/app/src/main/java/com/sevtinge/cemiuiler/module/systemui/statusbar/network/NetworkSpeed.kt index 80f82bc645..cf1c948082 100644 --- a/app/src/main/java/com/sevtinge/cemiuiler/module/systemui/statusbar/network/NetworkSpeed.kt +++ b/app/src/main/java/com/sevtinge/cemiuiler/module/systemui/statusbar/network/NetworkSpeed.kt @@ -158,7 +158,10 @@ object NetworkSpeed : BaseHook() { // 上下行网速双排显示 val doubleUpDown = mPrefsMap.getBoolean("system_ui_statusbar_network_speed_show_up_down") - // 网速图标 + // 交换图标与网速位置 + val swapPlaces = + mPrefsMap.getBoolean("system_ui_statusbar_network_speed_swap_places") + // 网速图标 val icons = mPrefsMap.getString("system_ui_statusbar_network_speed_icon", "2").toInt() var txArrow = "" @@ -193,10 +196,24 @@ object NetworkSpeed : BaseHook() { // 计算上行网速 val tx = - if (hideLow && !allHideLow && txSpeed < lowLevel) "" else "${humanReadableByteCount(it.args[0] as Context, txSpeed)}$txArrow" + if (hideLow && !allHideLow && txSpeed < lowLevel) + "" + else { + if (swapPlaces) + "$txArrow${humanReadableByteCount(it.args[0] as Context, txSpeed)}" + else + "${humanReadableByteCount(it.args[0] as Context, txSpeed)}$txArrow" + } // 计算下行网速 val rx = - if (hideLow && !allHideLow && rxSpeed < lowLevel) "" else "${humanReadableByteCount(it.args[0] as Context, rxSpeed)}$rxArrow" + if (hideLow && !allHideLow && rxSpeed < lowLevel) + "" + else { + if (swapPlaces) + "$rxArrow${humanReadableByteCount(it.args[0] as Context, rxSpeed)}" + else + "${humanReadableByteCount(it.args[0] as Context, rxSpeed)}$rxArrow" + } // 计算总网速 val ax = humanReadableByteCount(it.args[0] as Context, newTxBytesFixed + newRxBytesFixed) diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index c766f9d8a1..8842464f33 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -882,6 +882,7 @@ 值和单位双排显示 显示上下行网速 双排显示上下行网速 + 交换上下行网速与图标位置 分别显示传入和传出的网络速度 隐藏慢速 当上下行均为慢速时隐藏 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b2ef89acc2..92ee11cfc4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1169,4 +1169,5 @@ When it is turned on, a tile will be created. You can manage the Google service switch with one click in the Taskbar Close the Dolby pop-up window Hide Navigation Bar + Swap uplink and downlink speeds and icon positions \ No newline at end of file diff --git a/app/src/main/res/xml/system_ui_status_bar_network_speed_indicator.xml b/app/src/main/res/xml/system_ui_status_bar_network_speed_indicator.xml index bb40ea7540..c00f9c8c26 100644 --- a/app/src/main/res/xml/system_ui_status_bar_network_speed_indicator.xml +++ b/app/src/main/res/xml/system_ui_status_bar_network_speed_indicator.xml @@ -12,17 +12,17 @@ android:key="prefs_key_system_ui_statusbar_network_speed_font_size_enable" android:title="@string/system_ui_statusbar_network_speed_font_size" /> - - - @@ -68,12 +68,12 @@ android:key="prefs_key_system_ui_statusbar_network_speed_hide_all" android:title="@string/system_ui_statusbar_network_speed_hide_all" /> - + + - - - -