altosdroid: Show our position in the map tab. Squeeze to fit phones
[fw/altos] / altosdroid / src / org / altusmetrum / AltosDroid / AltosDroid.java
index b1d080dbb9d67aee5eb986d1e3e4b4d894dab943..3715c3f9600a4d1d06b55c5f0efb08e3f81173de 100644 (file)
@@ -233,9 +233,12 @@ public class AltosDroid extends FragmentActivity {
                AltosGreatCircle from_receiver = null;
 
                if (saved_location != null && state.gps != null && state.gps.locked) {
+                       double altitude = 0;
+                       if (saved_location.hasAltitude())
+                               altitude = saved_location.getAltitude();
                        from_receiver = new AltosGreatCircle(saved_location.getLatitude(),
                                                             saved_location.getLongitude(),
-                                                            saved_location.getAltitude(),
+                                                            altitude,
                                                             state.gps.lat,
                                                             state.gps.lon,
                                                             state.gps.alt);
@@ -248,7 +251,7 @@ public class AltosDroid extends FragmentActivity {
                mRSSIView.setText(String.format("%d", state.data.rssi));
 
                for (AltosDroidTab mTab : mTabs)
-                       mTab.update_ui(state, from_receiver);
+                       mTab.update_ui(state, from_receiver, saved_location);
 
                mAltosVoice.tell(state);
        }
@@ -268,7 +271,7 @@ public class AltosDroid extends FragmentActivity {
                }
                int deg = (int) Math.floor(p);
                double min = (p - Math.floor(p)) * 60.0;
-               return String.format("%d° %9.6f\" %s", deg, min, h);
+               return String.format("%d°%9.4f\" %s", deg, min, h);
        }
 
        @Override
@@ -309,6 +312,8 @@ public class AltosDroid extends FragmentActivity {
                mTabsAdapter.addTab(mTabHost.newTabSpec("landed").setIndicator("Landed"), TabLanded.class, null);
                mTabsAdapter.addTab(mTabHost.newTabSpec("map").setIndicator("Map"), TabMap.class, null);
 
+               for (int i = 0; i < 5; i++)
+                       mTabHost.getTabWidget().getChildAt(i).getLayoutParams().height = 45;
 
                // Set up the custom title
                mTitle = (TextView) findViewById(R.id.title_left_text);