Skip to content

Commit c90c482

Browse files
Merge branch 'master' into beta
2 parents db28260 + 4e03818 commit c90c482

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3137
-270
lines changed

Android/AndroidManifest.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
34
package="org.droidplanner"
4-
android:versionCode="81"
5+
android:versionCode="82"
56
android:versionName="please run version.sh to get the version name">
67

78
<uses-sdk
@@ -59,7 +60,8 @@
5960
android:icon="@drawable/ic_launcher"
6061
android:label="@string/app_title"
6162
android:theme="@style/CustomActionBarTheme"
62-
android:windowSoftInputMode="adjustPan" >
63+
android:windowSoftInputMode="adjustPan"
64+
tools:replace="android:label">
6365

6466
<!-- You must insert your own Google Maps for Android API v2 key in here. -->
6567
<meta-data
7.56 KB
Binary file not shown.

Android/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ dependencies {
2121
compile project(':Core')
2222
compile project(':Mavlink')
2323
compile project(':HorizontalVariableListView:HorizontalVariableListView')
24+
compile project(':PebbleKit')
2425
compile project(':usb-serial-for-android:UsbSerialLibrary')
2526
}
2627

Android/project.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ android.library.reference.2=../HorizontalVariableListView/HorizontalVariableList
1717
android.library.reference.3=../Mavlink
1818
android.library.reference.4=../Core
1919
android.library.reference.5=../google-play-services_lib
20+
android.library.reference.6=../PebbleKit

Android/res/layout/fragment_mode_follow.xml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,15 @@
3232
android:layout_height="wrap_content"
3333
android:layout_below="@id/desc_rect"
3434
android:orientation="vertical"
35-
android:padding="16dp" >
36-
35+
android:padding="3dp" >
36+
37+
<!-- Follow Type Spinner -->
38+
39+
<Spinner
40+
android:id="@+id/follow_type_spinner"
41+
android:layout_width="fill_parent"
42+
android:layout_height="wrap_content" />
43+
3744
<!-- Altitude buttons -->
3845

3946
<TextView
@@ -62,7 +69,7 @@
6269
style="@style/modeControl"
6370
android:layout_width="76dp"
6471
android:layout_height="64dp"
65-
android:layout_marginBottom="20dp"
72+
android:layout_marginBottom="3dp"
6673
android:layout_marginRight="3dp"
6774
android:background="@drawable/button_mode_options"
6875
android:text="-1" />
@@ -98,7 +105,7 @@
98105
android:layout_alignParentLeft="true"
99106
android:layout_below="@+id/linearLayout1"
100107
android:orientation="vertical"
101-
android:padding="16dp" >
108+
android:padding="3dp" >
102109

103110
<TextView
104111
android:id="@+id/follow_radius"
@@ -126,7 +133,7 @@
126133
style="@style/modeControl"
127134
android:layout_width="76dp"
128135
android:layout_height="64dp"
129-
android:layout_marginBottom="20dp"
136+
android:layout_marginBottom="3dp"
130137
android:layout_marginRight="3dp"
131138
android:background="@drawable/button_mode_options"
132139
android:text="-" />

Android/res/values/preferences_keys.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ This file is used to store the preferences keys so that it's accessible and modi
2828
<string name="pref_usage_statistics_key">pref_usage_statistics</string>
2929
<string name="pref_version_key">pref_version</string>
3030
<string name="pref_request_max_volume_key">pref_request_max_volume</string>
31+
<string name="pref_pebble_install_key">pref_pebble_install_key</string>
3132
<string name="pref_keep_screen_bright_key">pref_keep_screen_bright</string>
3233
<string name="pref_permanent_notification_key">pref_permanent_notification</string>
3334
</resources>

Android/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
<string name="pref_follow_me_mode_enabled_summary">In development</string>
5959
<string name="pref_heading_mode">Enable FPV heading mode</string>
6060
<string name="pref_heading_mode_summary">Change heading mode to FPV (-180º to 180º)</string>
61+
<string name="pref_pebble">PEBBLE</string>
62+
<string name="pref_pebble_install_watchapp">Update Pebble</string>
6163
<string name="pref_advanced">Advanced</string>
6264
<string name="pref_advanced_use_offline_maps">Use offline maps</string>
6365
<string name="pref_advanced_use_offline_maps_summary">Use map tiles on the local storage, for offline map view</string>

Android/res/xml/preferences.xml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -288,16 +288,13 @@
288288
android:key="@string/pref_max_flight_path_size_key"
289289
android:summary="@string/pref_max_flight_path_size_summary"
290290
android:title="@string/pref_max_flight_path_size" />
291-
<CheckBoxPreference
292-
android:defaultValue="true"
293-
android:key="pref_guided_mode_on_long_press"
294-
android:summary="@string/pref_guided_mode_on_long_press_summary"
295-
android:title="@string/pref_guided_mode_on_long_press" />
296-
<CheckBoxPreference
297-
android:defaultValue="false"
298-
android:key="pref_heading_mode"
299-
android:summary="@string/pref_heading_mode_summary"
300-
android:title="@string/pref_heading_mode" />
291+
</PreferenceCategory>
292+
293+
<PreferenceCategory
294+
android:title="@string/pref_pebble" >
295+
<Preference
296+
android:key="@string/pref_pebble_install_key"
297+
android:title="@string/pref_pebble_install_watchapp" />
301298
</PreferenceCategory>
302299
</PreferenceScreen>
303300
</PreferenceCategory>

Android/src/org/droidplanner/android/DroidPlannerApp.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.droidplanner.android;
22

3-
import org.droidplanner.android.gcs.FollowMe;
3+
import org.droidplanner.android.gcs.follow.Follow;
44
import org.droidplanner.android.utils.prefs.DroidPlannerPrefs;
55
import org.droidplanner.android.utils.analytics.GAUtils;
66
import org.droidplanner.android.proxy.mission.MissionProxy;
@@ -24,7 +24,7 @@ public class DroidPlannerApp extends ErrorReportApp implements MAVLinkStreams.Ma
2424
DroneInterfaces.OnDroneListener {
2525

2626
private Drone drone;
27-
public FollowMe followMe;
27+
public Follow followMe;
2828
public MissionProxy missionProxy;
2929
private MavLinkMsgHandler mavLinkMsgHandler;
3030

@@ -68,7 +68,7 @@ public void postDelayed(Runnable thread, long timeout) {
6868
missionProxy = new MissionProxy(getDrone().mission);
6969
mavLinkMsgHandler = new org.droidplanner.core.MAVLink.MavLinkMsgHandler(getDrone());
7070

71-
followMe = new FollowMe(this, getDrone());
71+
followMe = new Follow(this, getDrone());
7272
NetworkStateReceiver.register(context);
7373

7474
GAUtils.initGATracker(this);

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public class EditorActivity extends SuperUI implements OnPathFinishedListener,
7272
private View mSplineToggleContainer;
7373
private boolean mIsSplineEnabled;
7474

75+
private View mLocationButtonsContainer;
7576
private ImageButton mGoToMyLocation;
7677
private ImageButton mGoToDroneLocation;
7778

@@ -106,6 +107,7 @@ public void onCreate(Bundle savedInstanceState) {
106107
mSplineToggleContainer = findViewById(R.id.editorSplineToggleContainer);
107108
mSplineToggleContainer.setVisibility(View.GONE);
108109

110+
mLocationButtonsContainer = findViewById(R.id.location_button_container);
109111
mGoToMyLocation = (ImageButton)findViewById(R.id.my_location_button);
110112
mGoToMyLocation.setOnClickListener(new View.OnClickListener(){
111113
@Override
@@ -165,6 +167,23 @@ public void onClick(View v) {
165167
gestureMapFragment.setOnPathFinishedListener(this);
166168
}
167169

170+
@Override
171+
public void onWindowFocusChanged(boolean hasFocus) {
172+
super.onWindowFocusChanged(hasFocus);
173+
updateMapPadding();
174+
}
175+
176+
/**
177+
* Account for the various ui elements and update the map padding so that it
178+
* remains 'visible'.
179+
*/
180+
private void updateMapPadding() {
181+
int topPadding = mLocationButtonsContainer.getBottom() + mLocationButtonsContainer.getPaddingBottom();
182+
int leftPadding = mLocationButtonsContainer.getLeft() - mLocationButtonsContainer
183+
.getPaddingLeft();
184+
planningMapFragment.setMapPadding(leftPadding, topPadding, 0, 0);
185+
}
186+
168187
@Override
169188
public void onResume(){
170189
super.onResume();
@@ -468,6 +487,7 @@ public void onItemClick(MissionItemProxy item) {
468487

469488
@Override
470489
public void onListVisibilityChanged() {
490+
updateMapPadding();
471491
}
472492

473493
@Override

0 commit comments

Comments
 (0)