From e4b6fc3238ad9911fd40ef25accf82a401cb190f Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 13 Apr 2013 11:39:14 -0700 Subject: 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 --- .../src/org/altusmetrum/AltosDroid/TabMap.java | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java') 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) { -- cgit v1.2.3