diff --git a/app/src/main/java/eu/faircode/netguard/SinkholeService.java b/app/src/main/java/eu/faircode/netguard/SinkholeService.java index eeef6c41..b98c33f7 100644 --- a/app/src/main/java/eu/faircode/netguard/SinkholeService.java +++ b/app/src/main/java/eu/faircode/netguard/SinkholeService.java @@ -281,9 +281,7 @@ public class SinkholeService extends VpnService { return; // Schedule next update - Message msg = new Message(); - msg.what = MSG_STATS_UPDATE; - mServiceHandler.sendMessageDelayed(msg, 1000); + mServiceHandler.sendEmptyMessageDelayed(MSG_STATS_UPDATE, 1000); // Cleanup while (gt.size() >= 100) { @@ -314,7 +312,6 @@ public class SinkholeService extends VpnService { // Create bitmap int height = Util.dips2pixels(96, SinkholeService.this); int width = Util.dips2pixels(96 * 5, SinkholeService.this); - Log.i(TAG, "h=" + height + " w=" + width); Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); // Create canvas @@ -376,11 +373,11 @@ public class SinkholeService extends VpnService { RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.traffic); remoteViews.setImageViewBitmap(R.id.ivTraffic, bitmap); if (txsec < 1024 && rxsec < 1024) - remoteViews.setTextViewText(R.id.tvTraffic, String.format("%.0f / %.0f B/sec", txsec, rxsec)); + remoteViews.setTextViewText(R.id.tvTraffic, String.format("▲ %.0f ▼ %.0f B/sec", txsec, rxsec)); else if (txsec < 1024 * 1024 && rxsec < 1024 * 1024) - remoteViews.setTextViewText(R.id.tvTraffic, String.format("%.1f / %.1f KiB/sec", txsec / 1024, rxsec / 1024)); + remoteViews.setTextViewText(R.id.tvTraffic, String.format("▲ %.1f ▼ %.1f KiB/sec", txsec / 1024, rxsec / 1024)); else - remoteViews.setTextViewText(R.id.tvTraffic, String.format("%.1f / %.1f MiB/sec", txsec / 1024 / 1024, rxsec / 1024 / 1024)); + remoteViews.setTextViewText(R.id.tvTraffic, String.format("▲ %.1f ▼ %.1f MiB/sec", txsec / 1024 / 1024, rxsec / 1024 / 1024)); // Show notification Intent main = new Intent(SinkholeService.this, ActivityMain.class); @@ -591,9 +588,7 @@ public class SinkholeService extends VpnService { // Start/stop stats PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); - Message msg = new Message(); - msg.what = pm.isInteractive() ? MSG_STATS_START : MSG_STATS_STOP; - mServiceHandler.sendMessage(msg); + mServiceHandler.sendEmptyMessage(pm.isInteractive() ? MSG_STATS_START : MSG_STATS_STOP); } }; diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 57cdd02a..97842dc1 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -22,11 +22,11 @@ 默认阻止漫游 选项: 管理系统应用 - Show speed notification - Speed baseline: %s KiB/sec + 显示网速通知 + 网速基准: %s KiB/秒 %1$s 分钟后自动启用 使用暗色主题 - Wi-Fi home network: %1$s + Wi-Fi 家庭网络: %1$s 控制按流量计费Wi-Fi网络 2G非按流量计费 3G非按流量计费 @@ -37,9 +37,9 @@ 导入设置 技术信息 定义系统应用规则, 仅供专业用户 - Show network speed graph in status bar notification + 在状态栏通知中显示网速示意图 禁用小部件后, 在设定分钟后自动再次启用NetGuard\n输入零以禁用此选项 - Apply Wi-Fi network rules for selected network only (apply mobile network rules for other Wi-Fi networks) + 仅将Wi-Fi网络规则应用于所选定的网络 (将移动网络规则应用于其他Wi-Fi网络) 将移动网络规则应用于按流量计费的 (付费, 共享) Wi-Fi网络 将Wi-Fi网络规则应用于2G数据连接 将Wi-Fi网络规则应用于3G数据连接 @@ -58,7 +58,7 @@ NetGuard不具有网络访问权限, 所以您无需担心您的网络流量被 捐赠完全出于自愿并且不会解锁任何功能. 捐赠仅作为您对开发者付出劳动的感谢. 捐赠即表明您同意 条款与条件 如果您在下一个对话框中无法点击确定, 可能是另一个应用正在控制屏幕(如屏幕亮度调节软件). - All + 全部 亮屏时允许Wi-Fi网络 亮屏时允许移动网络 漫游时阻止