private TextView speed_view;
private TextView height_view;
private TextView altitude_view;
+ private View tilt_view;
+ private TextView tilt_value;
private TextView max_speed_view;
private TextView max_height_view;
private TextView max_altitude_view;
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.tab_flight, container, false);
- speed_view = (TextView) v.findViewById(R.id.speed_value);
- height_view = (TextView) v.findViewById(R.id.height_value);
- altitude_view = (TextView) v.findViewById(R.id.altitude_value);
- max_speed_view = (TextView) v.findViewById(R.id.max_speed_value);
- max_height_view= (TextView) v.findViewById(R.id.max_height_value);
+ speed_view = (TextView) v.findViewById(R.id.speed_value);
+ height_view = (TextView) v.findViewById(R.id.height_value);
+ altitude_view = (TextView) v.findViewById(R.id.altitude_value);
+ tilt_view = (View) v.findViewById(R.id.tilt_view);
+ tilt_value = (TextView) v.findViewById(R.id.tilt_value);
+ max_speed_view = (TextView) v.findViewById(R.id.max_speed_value);
+ max_height_view = (TextView) v.findViewById(R.id.max_height_value);
max_altitude_view= (TextView) v.findViewById(R.id.max_altitude_value);
elevation_view = (TextView) v.findViewById(R.id.elevation_value);
range_view = (TextView) v.findViewById(R.id.range_value);
set_value(speed_view, AltosConvert.speed, 1, state.speed());
set_value(height_view, AltosConvert.height, 1, state.height());
set_value(altitude_view, AltosConvert.height, 1, state.altitude());
+ double orient = state.orient();
+ if (orient == AltosLib.MISSING) {
+ tilt_view.setVisibility(View.GONE);
+ } else {
+ tilt_value.setText(AltosDroid.number("%1.0f°", orient));
+ tilt_view.setVisibility(View.VISIBLE);
+ }
set_value(max_speed_view, AltosConvert.speed, 1, state.max_speed());
set_value(max_height_view, AltosConvert.height, 1, state.max_height());
set_value(max_altitude_view, AltosConvert.height, 1, state.max_altitude());
private TextView[] ignite_voltage_label = new TextView[4];
private GoNoGoLights[] ignite_lights = new GoNoGoLights[4];
+ private View tilt_view;
+ private TextView tilt_value;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
(ImageView) v.findViewById(R.id.gps_ready_greenled),
getResources());
+ tilt_view = (View) v.findViewById(R.id.tilt_view);
+ tilt_value = (TextView) v.findViewById(R.id.tilt_value);
+
for (int i = 0; i < 4; i++) {
int row_id, view_id, label_id, lights_id;
int red_id, green_id;
} else
gps_locked_lights.set(false, true);
gps_ready_lights.set(state.gps_ready, state.gps == null);
+
+ double orient = state.orient();
+
+ if (orient == AltosLib.MISSING) {
+ tilt_view.setVisibility(View.GONE);
+ } else {
+ tilt_value.setText(AltosDroid.number("%1.0f°", orient));
+ tilt_view.setVisibility(View.VISIBLE);
+ }
}
+
if (telem_state != null) {
if (telem_state.receiver_battery == AltosLib.MISSING) {
receiver_row.setVisibility(View.GONE);
android:textAppearance="?android:attr/textAppearanceSmall" />
</TableRow>
+ <TableRow
+ android:id="@+id/tilt_view"
+ android:visibility="gone"
+ android:layout_gravity="center"
+ android:layout_weight="1"
+ android:padding="2dip"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ >
+
+ <TextView
+ android:id="@+id/tilt_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_column="2"
+ android:text="@string/tilt_label" />
+
+ <TextView
+ android:id="@+id/tilt_value"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text=""
+ android:textAppearance="?android:attr/textAppearanceSmall" />
+ </TableRow>
+
<TableRow
android:layout_gravity="center"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceSmall" />
</TableRow>
+ <TableRow
+ android:id="@+id/tilt_view"
+ android:visibility="gone"
+ android:layout_gravity="center"
+ android:layout_weight="1"
+ android:padding="2dip"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ >
+
+ <TextView
+ android:id="@+id/tilt_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_column="2"
+ android:text="@string/tilt_label" />
+
+ <TextView
+ android:id="@+id/tilt_value"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text=""
+ android:textAppearance="?android:attr/textAppearanceSmall" />
+ </TableRow>
+
<TableRow
android:padding="2dip"
android:layout_width="wrap_content"
<string name="altitude_label">Altitude</string>
<string name="speed_label">Speed</string>
<string name="accel_label">Acceleration</string>
+ <string name="tilt_label">Tilt</string>
<string name="bearing_label">Bearing</string>
<string name="direction_label">Direction</string>
<string name="elevation_label">Elevation</string>