android:layout_height="wrap_content"
android:layout_below="@+id/callsign_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/serial_label"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/flight_label"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/state_label"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/rssi_label"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/age_label"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
</LinearLayout>
android:layout_alignParentRight="true"
android:layout_below="@id/height_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_alignParentRight="true"
android:layout_below="@id/max_height_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
</LinearLayout>
android:layout_alignParentRight="true"
android:layout_below="@id/speed_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_alignParentRight="true"
android:layout_below="@id/max_speed_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
</LinearLayout>
android:layout_alignParentRight="true"
android:layout_below="@id/accel_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_alignParentRight="true"
android:layout_below="@id/max_accel_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
</LinearLayout>
android:layout_alignParentRight="true"
android:layout_below="@id/lat_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_alignParentRight="true"
android:layout_below="@id/lon_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_below="@id/apogee_voltage_label"
android:layout_toRightOf="@id/apogee_greenled"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_below="@id/main_voltage_label"
android:layout_toRightOf="@id/main_greenled"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
android:layout_alignParentRight="true"
android:layout_below="@id/speed_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_alignParentRight="true"
android:layout_below="@id/height_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
</LinearLayout>
android:layout_alignParentRight="true"
android:layout_below="@id/elevation_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_alignParentRight="true"
android:layout_below="@id/range_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
</LinearLayout>
android:layout_alignParentRight="true"
android:layout_below="@id/bearing_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_alignParentRight="true"
android:layout_below="@id/compass_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
</LinearLayout>
android:layout_alignParentRight="true"
android:layout_below="@id/distance_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<TextView
android:layout_alignParentRight="true"
android:layout_below="@id/lat_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_alignParentRight="true"
android:layout_below="@id/lon_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_below="@id/apogee_voltage_label"
android:layout_toRightOf="@id/apogee_greenled"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_below="@id/main_voltage_label"
android:layout_toRightOf="@id/main_greenled"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
</LinearLayout>
android:layout_alignParentRight="true"
android:layout_below="@+id/bearing_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_alignParentRight="true"
android:layout_below="@+id/distance_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_alignParentRight="true"
android:layout_below="@id/lat_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_alignParentRight="true"
android:layout_below="@id/lon_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_alignParentRight="true"
android:layout_below="@id/max_height_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_alignParentRight="true"
android:layout_below="@id/max_speed_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_alignParentRight="true"
android:layout_below="@id/max_accel_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
android:id="@+id/distance_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:paddingRight="4dp"
android:text="@string/distance_label" />
<TextView
android:id="@+id/distance_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_below="@+id/distance_label"
+ android:layout_toRightOf="@+id/distance_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/bearing_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:paddingRight="4dp"
android:text="@string/bearing_label" />
<TextView
android:id="@+id/bearing_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_below="@+id/bearing_label"
+ android:layout_toRightOf="@+id/bearing_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
</LinearLayout>
android:paddingTop="5dp" >
<TextView
- android:id="@+id/lat_label"
+ android:id="@+id/target_lat_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="@string/latitude_label" />
+ android:paddingRight="4dp"
+ android:text="@string/target_latitude_label" />
<TextView
- android:id="@+id/lat_value"
+ android:id="@+id/target_lat_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_below="@id/lat_label"
+ android:layout_toRightOf="@id/target_lat_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:paddingTop="5dp" >
<TextView
- android:id="@+id/lon_label"
+ android:id="@+id/target_lon_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="@string/longitude_label" />
+ android:paddingRight="4dp"
+ android:text="@string/target_longitude_label" />
<TextView
- android:id="@+id/lon_value"
+ android:id="@+id/target_lon_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_below="@id/lon_label"
+ android:layout_toRightOf="@id/target_lon_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
+ </RelativeLayout>
+ </LinearLayout>
+
+ <LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:baselineAligned="true"
+ android:orientation="horizontal" >
+
+ <RelativeLayout
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:paddingTop="5dp" >
+
+ <TextView
+ android:id="@+id/receiver_lat_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingRight="4dp"
+ android:text="@string/receiver_latitude_label" />
+
+ <TextView
+ android:id="@+id/receiver_lat_value"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_toRightOf="@id/receiver_lat_label"
+ android:text=""
+ android:textAppearance="?android:attr/textAppearanceSmall" />
+ </RelativeLayout>
+
+ <RelativeLayout
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:paddingTop="5dp" >
+
+ <TextView
+ android:id="@+id/receiver_lon_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingRight="4dp"
+ android:text="@string/receiver_longitude_label" />
+
+ <TextView
+ android:id="@+id/receiver_lon_value"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_toRightOf="@id/receiver_lon_label"
+ android:text=""
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
android:layout_below="@id/battery_voltage_label"
android:layout_toRightOf="@id/battery_greenled"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_below="@id/apogee_voltage_label"
android:layout_toRightOf="@id/apogee_greenled"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_below="@id/main_voltage_label"
android:layout_toRightOf="@id/main_greenled"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_below="@id/logging_label"
android:layout_toRightOf="@id/logging_greenled"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_below="@id/gps_locked_label"
android:layout_toRightOf="@id/gps_locked_greenled"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:layout_below="@id/gps_ready_label"
android:layout_toRightOf="@id/gps_ready_greenled"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/pad_lat_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android.paddingRight="4dp"
android:layout_toRightOf="@id/gps_ready_greenled"
android:text="@string/pad_lat_label" />
android:id="@+id/pad_lat_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_below="@id/pad_lat_label"
- android:layout_toRightOf="@id/gps_ready_greenled"
+ android:layout_toRightOf="@id/pad_lat_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/pad_lon_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android.paddingRight="4dp"
android:layout_toRightOf="@id/gps_ready_greenled"
android:text="@string/pad_lon_label" />
android:id="@+id/pad_lon_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_below="@id/pad_lon_label"
- android:layout_toRightOf="@id/gps_ready_greenled"
+ android:layout_toRightOf="@id/pad_lon_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/pad_alt_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android.paddingRight="4dp"
android:layout_toRightOf="@id/gps_ready_greenled"
android:text="@string/pad_alt_label" />
android:id="@+id/pad_alt_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_below="@id/pad_alt_label"
- android:layout_toRightOf="@id/gps_ready_greenled"
+ android:layout_toRightOf="@id/pad_alt_label"
android:text=""
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
<string name="gps_ready_label">GPS Ready</string>
<string name="latitude_label">Latitude</string>
<string name="longitude_label">Longitude</string>
- <string name="pad_lat_label">Pad Latitude</string>
- <string name="pad_lon_label">Pad Longitude</string>
- <string name="pad_alt_label">Pad Altitude</string>
+ <string name="target_latitude_label">Tar Lat</string>
+ <string name="target_longitude_label">Tar Lon</string>
+ <string name="receiver_latitude_label">My Lat</string>
+ <string name="receiver_longitude_label">My Lon</string>
+ <string name="pad_lat_label">Pad Lat</string>
+ <string name="pad_lon_label">Pad Lon</string>
+ <string name="pad_alt_label">Pad Alt</string>
</resources>
}
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
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);
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) {
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;
}
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) {
}
private void startAltosBluetooth() {
+ if (device == null) {
+ return;
+ }
if (mAltosBluetooth == null) {
if (D) Log.d(TAG, String.format("startAltosBluetooth(): Connecting to %s (%s)", device.getName(), device.getAddress()));
mAltosBluetooth = new AltosBluetooth(device, mHandler);
private void connected() {
try {
+ if (mAltosBluetooth == null)
+ throw new InterruptedException("no bluetooth");
mConfigData = mAltosBluetooth.config_data();
} catch (InterruptedException e) {
} catch (TimeoutException e) {