X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosdroid%2Fsrc%2Forg%2Faltusmetrum%2FAltosDroid%2FTabAscent.java;h=2c4063396cbd1b5d58e454c9d05d3206feecfe0e;hb=7339d2379713b5b7e4c4fe6bad89ed93f9d39e82;hp=cb9fd5c8dfb27bd484cc8f80499065dcff93ec5f;hpb=bd440afc2a6e37b74fffcf1b977e149485095316;p=fw%2Faltos diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TabAscent.java b/altosdroid/src/org/altusmetrum/AltosDroid/TabAscent.java index cb9fd5c8..2c406339 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,18 +85,23 @@ 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())); - mSpeedView.setText(AltosDroid.number("%6.0f m/s", state.speed())); - mMaxSpeedView.setText(AltosDroid.number("%6.0f m/s", state.max_speed())); - mAccelView.setText(AltosDroid.number("%6.0f m/s²", state.acceleration())); - mMaxAccelView.setText(AltosDroid.number("%6.0f m/s²", state.max_acceleration())); + set_value(mHeightView, AltosConvert.height, 6, state.height()); + set_value(mHeightView, AltosConvert.height, 6, state.height()); + set_value(mMaxHeightView, AltosConvert.height, 6, state.max_height()); + set_value(mSpeedView, AltosConvert.speed, 6, state.speed()); + set_value(mMaxSpeedView, AltosConvert.speed, 6, state.max_speed()); + set_value(mAccelView, AltosConvert.accel, 6, state.acceleration()); + set_value(mMaxAccelView, AltosConvert.accel, 6, state.max_acceleration()); if (state.gps != null) { mLatitudeView.setText(AltosDroid.pos(state.gps.lat, "N", "S")); - mLongitudeView.setText(AltosDroid.pos(state.gps.lon, "W", "E")); + mLongitudeView.setText(AltosDroid.pos(state.gps.lon, "E", "W")); } else { mLatitudeView.setText(""); mLongitudeView.setText("");