Skip to content

Commit b3757e7

Browse files
committed
added flight time to the telemetry panel.
1 parent 269561b commit b3757e7

File tree

11 files changed

+217
-94
lines changed

11 files changed

+217
-94
lines changed
636 Bytes
Loading
434 Bytes
Loading
769 Bytes
Loading
1.17 KB
Loading

Android/res/layout/fragment_droneshare_account.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
android:layout_alignParentTop="true"
1414
android:layout_alignParentLeft="true"
1515
android:layout_alignParentStart="true"
16+
android:visibility="invisible"
1617
android:src="@drawable/ic_account_circle_grey600_48dp"/>
1718

1819
<TextView

Android/res/layout/fragment_telemetry.xml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,33 @@
7979
android:orientation="horizontal"
8080
android:layout_width="wrap_content"
8181
android:layout_height="wrap_content"
82+
android:minHeight="36dp"
8283
android:layout_below="@+id/rollValueText"
84+
android:background="@drawable/round_rect_bg"
8385
android:layout_marginBottom="2dp"
84-
android:paddingLeft="10dp"
8586
android:paddingRight="10dp"
8687
android:paddingBottom="1dp"
8788
android:layout_alignLeft="@+id/rollValueText"
8889
android:layout_alignRight="@+id/aiView"
90+
android:gravity="center_vertical"
8991
>
9092

93+
<ImageButton
94+
android:id="@+id/reset_flight_timer_button"
95+
android:src="@drawable/ic_restore_white_24dp"
96+
style="?android:attr/borderlessButtonStyle"
97+
android:layout_width="36dp"
98+
android:layout_height="wrap_content"/>
99+
100+
<TextView
101+
android:id="@+id/flight_timer"
102+
android:layout_width="match_parent"
103+
android:layout_height="wrap_content"
104+
style="@style/largeTelemetryText"
105+
android:gravity="center"
106+
android:text="00:00"
107+
tools:text="99:99"/>
108+
91109
</LinearLayout>
92110

93111
<!-- ************** GROUND SPEED ********************* -->
Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<TextView
2+
<android.support.v7.widget.CardView
33
xmlns:android="http://schemas.android.com/apk/res/android"
4-
android:id="@+id/bar_flight_time_reset_timer"
5-
style="?android:attr/buttonBarButtonStyle"
4+
style="?android:attr/buttonBarStyle"
5+
android:orientation="vertical"
66
android:layout_width="match_parent"
77
android:layout_height="wrap_content"
8-
android:padding="5dp"
9-
android:textSize="@dimen/info_bar_text_size"
10-
android:gravity="left|center_vertical"
11-
android:text="Reset Timer"/>
8+
>
9+
10+
<TextView
11+
android:id="@+id/bar_flight_time_reset_timer"
12+
style="?android:attr/buttonBarButtonStyle"
13+
android:layout_width="match_parent"
14+
android:layout_height="wrap_content"
15+
android:minHeight="36dp"
16+
android:padding="10dp"
17+
android:gravity="start|center_vertical"
18+
android:textColor="@android:color/black"
19+
android:text="Reset Timer"/>
20+
21+
</android.support.v7.widget.CardView>

Android/res/values/strings.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,8 @@
456456
<string name="pref_permanent_notification_summary">Enable to make status bar notification permanent when connected.</string>
457457

458458
<string name="zoom_fit">Zoom to Fit</string>
459-
<string name="open_mission_file">Open Mission File</string>
460-
<string name="save_mission_file">Save Mission File</string>
459+
<string name="open_mission_file">Import Mission File</string>
460+
<string name="save_mission_file">Export Mission File</string>
461461

462462
<string name="pref_ui_gps_hdop_summary">Display HDOP instead of FIX in satellite info bar item</string>
463463
<string name="pref_ui_gps_hdop_title">Display Satellite HDOP</string>

Android/src/org/droidplanner/android/activities/DrawerNavigationUI.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,13 @@ private void initToolbar() {
116116
@Override
117117
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
118118
final float topMargin = getActionDrawerTopMargin();
119-
((ViewGroup.MarginLayoutParams) actionDrawer.getLayoutParams()).topMargin = (int) (topMargin + (bottom - top));
120-
actionDrawer.requestLayout();
119+
final int fullTopMargin = (int) (topMargin + (bottom - top));
120+
121+
ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) actionDrawer.getLayoutParams();
122+
if(lp.topMargin != fullTopMargin) {
123+
lp.topMargin = fullTopMargin;
124+
actionDrawer.requestLayout();
125+
}
121126
}
122127
});
123128

Android/src/org/droidplanner/android/fragments/EditorToolsFragment.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import android.content.Context;
66
import android.content.Intent;
77
import android.content.IntentFilter;
8+
import android.content.res.Resources;
89
import android.graphics.drawable.Drawable;
910
import android.os.Bundle;
1011
import android.util.TypedValue;
@@ -123,14 +124,15 @@ public void onViewCreated(View view, Bundle savedInstanceState) {
123124
toolImpl.onRestoreInstanceState(savedInstanceState);
124125
}
125126

126-
popupLeftMargin = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, getResources().getDisplayMetrics());
127+
final Resources res = getResources();
128+
popupLeftMargin = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, res.getDisplayMetrics());
127129

128130
final Context context = getContext();
129131
final LayoutInflater inflater = getActivity().getLayoutInflater();
130132

131133
final int popupWidth = ViewGroup.LayoutParams.WRAP_CONTENT;
132134
final int popupHeight = ViewGroup.LayoutParams.WRAP_CONTENT;
133-
final Drawable popupBg = getResources().getDrawable(android.R.color.transparent);
135+
final Drawable popupBg = res.getDrawable(android.R.color.transparent);
134136

135137
mEditorRadioGroup = (RadioGroup) view.findViewById(R.id.editor_tools_layout);
136138

0 commit comments

Comments
 (0)