summaryrefslogtreecommitdiff
path: root/altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-04-13 11:39:14 -0700
committerKeith Packard <keithp@keithp.com>2013-04-13 11:39:14 -0700
commite4b6fc3238ad9911fd40ef25accf82a401cb190f (patch)
treebcabafa1f7c2657cd0d8883ad0ef069206268293 /altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java
parent2f7015afcca7c6042365d2124d3a5b7219e8e588 (diff)
altosdroid: Show our position in the map tab. Squeeze to fit phones
Shrink everything to fit on phones, then add phone location to the map tab Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java')
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java21
1 files changed, 15 insertions, 6 deletions
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java b/altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java
index 0a208fa8..29696dbf 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java
@@ -55,8 +55,10 @@ public class TabMap extends Fragment implements AltosDroidTab {
private TextView mDistanceView;
private TextView mBearingView;
- private TextView mLatitudeView;
- private TextView mLongitudeView;
+ private TextView mTargetLatitudeView;
+ private TextView mTargetLongitudeView;
+ private TextView mReceiverLatitudeView;
+ private TextView mReceiverLongitudeView;
@Override
public void onAttach(Activity activity) {
@@ -84,8 +86,10 @@ public class TabMap extends Fragment implements AltosDroidTab {
View v = inflater.inflate(R.layout.tab_map, container, false);
mDistanceView = (TextView)v.findViewById(R.id.distance_value);
mBearingView = (TextView)v.findViewById(R.id.bearing_value);
- mLatitudeView = (TextView)v.findViewById(R.id.lat_value);
- mLongitudeView = (TextView)v.findViewById(R.id.lon_value);
+ mTargetLatitudeView = (TextView)v.findViewById(R.id.target_lat_value);
+ mTargetLongitudeView = (TextView)v.findViewById(R.id.target_lon_value);
+ mReceiverLatitudeView = (TextView)v.findViewById(R.id.receiver_lat_value);
+ mReceiverLongitudeView = (TextView)v.findViewById(R.id.receiver_lon_value);
return v;
}
@@ -146,8 +150,13 @@ public class TabMap extends Fragment implements AltosDroidTab {
mBearingView.setText(String.format("%3.0f°", state.from_pad.bearing));
}
if (state.gps != null) {
- mLatitudeView.setText(AltosDroid.pos(state.gps.lat, "N", "S"));
- mLongitudeView.setText(AltosDroid.pos(state.gps.lon, "W", "E"));
+ mTargetLatitudeView.setText(AltosDroid.pos(state.gps.lat, "N", "S"));
+ mTargetLongitudeView.setText(AltosDroid.pos(state.gps.lon, "W", "E"));
+ }
+
+ if (receiver != null) {
+ mReceiverLatitudeView.setText(AltosDroid.pos(receiver.getLatitude(), "N", "S"));
+ mReceiverLongitudeView.setText(AltosDroid.pos(receiver.getLongitude(), "W", "E"));
}
if (mapLoaded) {