Commit 9adf1171 authored by Mygod's avatar Mygod

Hide stats for profiles that have no traffic

parent c4c16829
...@@ -59,11 +59,13 @@ class ProfileManagerActivity extends AppCompatActivity with OnMenuItemClickListe ...@@ -59,11 +59,13 @@ class ProfileManagerActivity extends AppCompatActivity with OnMenuItemClickListe
def updateText() { def updateText() {
val builder = new SpannableStringBuilder val builder = new SpannableStringBuilder
builder.append(item.name) builder.append(item.name)
if (item.tx != 0 || item.rx != 0) {
val start = builder.length val start = builder.length
builder.append(getString(R.string.stat_profiles, builder.append(getString(R.string.stat_profiles,
TrafficMonitor.formatTraffic(item.tx), TrafficMonitor.formatTraffic(item.rx))) TrafficMonitor.formatTraffic(item.tx), TrafficMonitor.formatTraffic(item.rx)))
builder.setSpan(new TextAppearanceSpan(ProfileManagerActivity.this, android.R.style.TextAppearance_Small), builder.setSpan(new TextAppearanceSpan(ProfileManagerActivity.this, android.R.style.TextAppearance_Small),
start + 1, builder.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) start + 1, builder.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
}
text.setText(builder) text.setText(builder)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment