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)
val start = builder.length if (item.tx != 0 || item.rx != 0) {
builder.append(getString(R.string.stat_profiles, val start = builder.length
TrafficMonitor.formatTraffic(item.tx), TrafficMonitor.formatTraffic(item.rx))) builder.append(getString(R.string.stat_profiles,
builder.setSpan(new TextAppearanceSpan(ProfileManagerActivity.this, android.R.style.TextAppearance_Small), TrafficMonitor.formatTraffic(item.tx), TrafficMonitor.formatTraffic(item.rx)))
start + 1, builder.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) builder.setSpan(new TextAppearanceSpan(ProfileManagerActivity.this, android.R.style.TextAppearance_Small),
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