X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosdroid%2Fsrc%2Forg%2Faltusmetrum%2FAltosDroid%2FTabRecover.java;h=ac211230446082324a81c241862e2c52ddd4379c;hb=a61217f0a6d0ef48b6471f632c4600255867e831;hp=0ab20f5f6c8f9890f3e09fe65cde17cf5a502522;hpb=2b6768ed32d7be444c49caa40d30b520177bb22a;p=fw%2Faltos diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TabRecover.java b/altosdroid/src/org/altusmetrum/AltosDroid/TabRecover.java index 0ab20f5f..ac211230 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/TabRecover.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/TabRecover.java @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -17,7 +18,7 @@ package org.altusmetrum.AltosDroid; -import org.altusmetrum.altoslib_7.*; +import org.altusmetrum.altoslib_12.*; import android.app.Activity; import android.os.Bundle; @@ -30,6 +31,7 @@ import android.location.Location; public class TabRecover extends AltosDroidTab { private TextView mBearingView; + private TextView mDirectionView; private TextView mDistanceView; private TextView mTargetLatitudeView; private TextView mTargetLongitudeView; @@ -44,6 +46,7 @@ public class TabRecover extends AltosDroidTab { View v = inflater.inflate(R.layout.tab_recover, container, false); mBearingView = (TextView) v.findViewById(R.id.bearing_value); + mDirectionView = (TextView) v.findViewById(R.id.direction_value); mDistanceView = (TextView) v.findViewById(R.id.distance_value); mTargetLatitudeView = (TextView) v.findViewById(R.id.target_lat_value); mTargetLongitudeView = (TextView) v.findViewById(R.id.target_lon_value); @@ -56,12 +59,17 @@ public class TabRecover extends AltosDroidTab { return v; } - public String tab_name() { return "recover"; } + public String tab_name() { return AltosDroid.tab_recover_name; } public void show(TelemetryState telem_state, AltosState state, AltosGreatCircle from_receiver, Location receiver) { if (from_receiver != null) { mBearingView.setText(String.format("%3.0f°", from_receiver.bearing)); set_value(mDistanceView, AltosConvert.distance, 6, from_receiver.distance); + String direction = AltosDroid.direction(from_receiver, receiver); + if (direction == null) + mDirectionView.setText(""); + else + mDirectionView.setText(direction); } if (state != null && state.gps != null) { mTargetLatitudeView.setText(AltosDroid.pos(state.gps.lat, "N", "S"));