mirror of https://github.com/M66B/NetGuard.git
Traffic accounting units
This commit is contained in:
parent
b4810bcd61
commit
53b6b99764
|
@ -158,8 +158,17 @@ public class AdapterAccess extends CursorAdapter {
|
|||
tvDest.setTextColor(colorOff);
|
||||
|
||||
tvTraffic.setVisibility(sent > 0 || received > 0 ? View.VISIBLE : View.GONE);
|
||||
tvTraffic.setText(context.getString(R.string.msg_kb,
|
||||
(sent > 0 ? sent / 1024f : 0),
|
||||
(received > 0 ? received / 1024f : 0)));
|
||||
if (sent > 1024 * 1204 * 1024L || received > 1024 * 1024 * 1024L)
|
||||
tvTraffic.setText(context.getString(R.string.msg_gb,
|
||||
(sent > 0 ? sent / (1024 * 1024 * 1024f) : 0),
|
||||
(received > 0 ? received / (1024 * 1024 * 1024f) : 0)));
|
||||
else if (sent > 1204 * 1024L || received > 1024 * 1024L)
|
||||
tvTraffic.setText(context.getString(R.string.msg_mb,
|
||||
(sent > 0 ? sent / (1024 * 1024f) : 0),
|
||||
(received > 0 ? received / (1024 * 1024f) : 0)));
|
||||
else
|
||||
tvTraffic.setText(context.getString(R.string.msg_kb,
|
||||
(sent > 0 ? sent / 1024f : 0),
|
||||
(received > 0 ? received / 1024f : 0)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -149,6 +149,8 @@ Your internet traffic is not being sent to a remote VPN server.</string>
|
|||
<string name="msg_kbsec">%7.3f KB/s</string>
|
||||
<string name="msg_mbsec">%7.3f MB/s</string>
|
||||
<string name="msg_kb">%1$.3f▲ %2$.3f▼ KB</string>
|
||||
<string name="msg_mb">%1$.3f▲ %2$.3f▼ MB</string>
|
||||
<string name="msg_gb">%1$.3f▲ %2$.3f▼ GB</string>
|
||||
<string name="msg_filter">Using filtering will cause Android to attribute data and power usage to NetGuard - Android assumes the data and power are being used by NetGuard, rather than the original applications</string>
|
||||
<string name="msg_log_disabled">Traffic logging is disabled, use the switch above to enable logging. Traffic logging might result in extra battery usage.</string>
|
||||
<string name="msg_clear_rules">This will reset the rules and conditions to their default values</string>
|
||||
|
|
Loading…
Reference in New Issue