Average KB/day

This commit is contained in:
M66B 2015-12-25 11:35:09 +01:00
parent 7fdc5f1b1f
commit 64800bd8d4
2 changed files with 4 additions and 6 deletions

View File

@ -435,11 +435,9 @@ public class RuleAdapter extends RecyclerView.Adapter<RuleAdapter.ViewHolder> im
// Traffic statistics
holder.tvStatistics.setVisibility(debuggable ? View.VISIBLE : View.GONE);
if (debuggable)
holder.tvStatistics.setText(context.getString(R.string.msg_traffic,
TrafficStats.getUidTxBytes(rule.info.applicationInfo.uid) / 1024f,
TrafficStats.getUidRxBytes(rule.info.applicationInfo.uid) / 1024f,
SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.SHORT, SimpleDateFormat.SHORT)
.format(new Date(System.currentTimeMillis() - SystemClock.elapsedRealtime()))
holder.tvStatistics.setText(context.getString(R.string.msg_kbday,
TrafficStats.getUidTxBytes(rule.info.applicationInfo.uid) / 1024f * 24 * 3600 * 1000L / SystemClock.elapsedRealtime(),
TrafficStats.getUidRxBytes(rule.info.applicationInfo.uid) / 1024f * 24 * 3600 * 1000L / SystemClock.elapsedRealtime()
));
}

View File

@ -71,7 +71,7 @@ Since NetGuard has no internet permission, you know your internet traffic is not
<string name="msg_voluntary">Donations are completely voluntary and do not unlock any feature. Donations are meant as a way to show your appreciation for the work done.</string>
<string name="msg_terms">By donating you agree to the <a href="http://www.netguard.me/#terms">terms &amp; conditions</a></string>
<string name="msg_dimming">If you cannot press OK in the next dialog, another (screen dimming) application is likely manipulating the screen.</string>
<string name="msg_traffic" translatable="false">%1$.1f/%2$.1f KiB since %3$s</string>
<string name="msg_kbday" translatable="false">&#177;%1$1.0f/%2$1.0f KB/day</string>
<string name="msg_kbsec">%7.3f KB/s</string>
<string name="msg_mbsec">%7.3f MB/s</string>