diff options
| author | Keith Packard <keithp@keithp.com> | 2014-08-17 20:48:23 -0700 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2014-08-17 20:48:23 -0700 |
| commit | 59dfe661fcb504f390d9726378c676f2b5b005f3 (patch) | |
| tree | 3b04fce1f5365ba7f98768dcaa3b29bfbb0afcb4 /altosdroid/src/org/altusmetrum/AltosDroid/TabAscent.java | |
| parent | b1f1844aa514893228080704da3b3ccf855bda1e (diff) | |
altosdroid: Skip updating hidden UI elements
Instead of updating everything in the UI, only update the visible UI
elements to save a bunch of computation.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosdroid/src/org/altusmetrum/AltosDroid/TabAscent.java')
| -rw-r--r-- | altosdroid/src/org/altusmetrum/AltosDroid/TabAscent.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TabAscent.java b/altosdroid/src/org/altusmetrum/AltosDroid/TabAscent.java index cb9fd5c8..c146c277 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/TabAscent.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/TabAscent.java @@ -29,7 +29,7 @@ import android.widget.ImageView; import android.widget.TextView; import android.location.Location; -public class TabAscent extends Fragment implements AltosDroidTab { +public class TabAscent extends AltosDroidTab { AltosDroid mAltosDroid; private TextView mHeightView; @@ -85,7 +85,11 @@ public class TabAscent extends Fragment implements AltosDroidTab { mAltosDroid = null; } - public void update_ui(AltosState state, AltosGreatCircle from_receiver, Location receiver) { + public String tab_name() { + return "ascent"; + } + + public void show(AltosState state, AltosGreatCircle from_receiver, Location receiver) { if (state != null) { mHeightView.setText(AltosDroid.number("%6.0f m", state.height())); mMaxHeightView.setText(AltosDroid.number("%6.0f m", state.max_height())); |
