Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dronepro integration #1710

Merged
merged 7 commits into from
Mar 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,23 @@ android:
components:
- platform-tools
- tools

# The BuildTools version used by your project
- build-tools-23.0.2

# The SDK version used to compile your project
- android-23

# Additional components
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
- extra-android-support

licenses:
- 'android-sdk-license-.+'

before_script:
- echo yes | android update sdk -u -a -t tools
- echo yes | android update sdk -u -a -t build-tools-23.0.2
- echo yes | android update sdk -u -a -t android-23
- echo yes | android update sdk -u -a -t extra-google-m2repository
- echo yes | android update sdk -u -a -t extra-android-m2repository
- echo yes | android update sdk -u -a -t extra-android-support,extra-google-google_play_services
- export GRADLE_OPTS="-XX:MaxPermSize=2048m -Xmx1536m"

script: ./gradlew clean assembleDevDebug
9 changes: 9 additions & 0 deletions Android/res/drawable/ic_input_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#626262"
android:pathData="M21,3.01H3c-1.1,0 -2,0.9 -2,2V9h2V4.99h18v14.03H3V15H1v4.01c0,1.1 0.9,1.98 2,1.98h18c1.1,0 2,-0.88 2,-1.98v-14c0,-1.11 -0.9,-2 -2,-2zM11,16l4,-4 -4,-4v3H1v2h10v3z"/>
</vector>
19 changes: 19 additions & 0 deletions Android/res/drawable/ic_vr_google_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="64"
android:viewportHeight="64">

<path
android:fillColor="#626262"
android:strokeWidth="1"
android:pathData="M53.7,17 L9.7,17 C7.6,17 6,18.7 6,20.7 L6,43.3 C6,45.4 7.7,47 9.7,47 L23.1,47
C24.2,47 25.2,46.4 25.6,45.4 L28.6,37.9 C29.8,35.3 33.5,35.4 34.6,38 L37.2,45.3
C37.6,46.3 38.6,47 39.7,47 L53.6,47 C55.7,47 57.3,45.3 57.3,43.3 L57.3,20.8
C57.5,18.7 55.8,17 53.7,17 L53.7,17 Z M20.7,38.5 C17.5,38.5 15,35.9 15,32.8
C15,29.7 17.6,27.1 20.7,27.1 C23.8,27.1 26.4,29.7 26.4,32.8 C26.4,35.9 23.9,38.5
20.7,38.5 L20.7,38.5 Z M42.7,38.5 C39.5,38.5 37,35.9 37,32.8 C37,29.7 39.6,27.1
42.7,27.1 C45.8,27.1 48.4,29.7 48.4,32.8 C48.4,35.9 45.9,38.5 42.7,38.5
L42.7,38.5 Z" />
</vector>
4 changes: 2 additions & 2 deletions Android/res/layout/dialog_yes_no_content.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">

<ScrollView
<android.support.v4.widget.NestedScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -27,7 +27,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dip"/>
</ScrollView>
</android.support.v4.widget.NestedScrollView>

<CheckBox
android:id="@+id/yes_no_dont_show_checkbox"
Expand Down
11 changes: 11 additions & 0 deletions Android/res/layout/navigation_fpv_menu_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic_input_24dp" />
</FrameLayout>
8 changes: 7 additions & 1 deletion Android/res/menu/navigation_drawer_items.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<group
android:id="@+id/flight_screens"
Expand All @@ -19,6 +20,11 @@
android:icon="@drawable/ic_menu_flight_history_grey600_24dp"
android:title="@string/locator" />

<item android:id="@+id/navigation_fvp_goggle"
android:icon="@drawable/ic_vr_google_24dp"
android:title="FPV"
app:actionLayout="@layout/navigation_fpv_menu_item"/>

</group>

<group
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package org.droidplanner.android.activities;

import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.NavigationView;
import android.support.v4.content.LocalBroadcastManager;
Expand Down Expand Up @@ -184,13 +187,43 @@ public boolean onNavigationItemSelected(MenuItem menuItem) {
case R.id.navigation_settings:
mNavigationIntent = new Intent(this, SettingsActivity.class);
break;

case R.id.navigation_fvp_goggle:
mNavigationIntent = launchFpvApp();
break;
}

DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}

private Intent launchFpvApp(){
final String appId = "meavydev.DronePro";

//Check if the dronepro app is installed.
final PackageManager pm = getPackageManager();
Intent launchIntent = pm.getLaunchIntentForPackage(appId);
if(launchIntent == null){

//Search for the dronepro app in the play store
launchIntent = new Intent(Intent.ACTION_VIEW)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
.setData(Uri.parse("market://details?id=" + appId));

if(pm.resolveActivity(launchIntent, PackageManager.MATCH_DEFAULT_ONLY) == null){
launchIntent = new Intent(Intent.ACTION_VIEW)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
.setData(Uri.parse("https://play.google.com/store/apps/details?id=" + appId));
}
}
else {
launchIntent.putExtra("meavydev.DronePro.launchFPV", "Tower");
}

return launchIntent;
}

protected void onToolbarLayoutChange(int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ public void onApiConnected() {
//Invalid state. We should not have been able to get here.
//If the parent activity is listening, it will remove this fragment when the selection is empty.
mMissionProxy.selection.notifySelectionUpdate();

//Dismiss this dialog fragment
dismiss();
return;
}

if(getResource() == R.layout.fragment_editor_detail_generic) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,13 @@ public void onApiConnected() {
mSidelapPicker.addScrollListener(this);
mAltitudePicker.addScrollListener(this);

final T referenceItem = getMissionItems().get(0);
if (referenceItem instanceof SplineSurvey)
typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.SPLINE_SURVEY));
else
typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.SURVEY));
if(!getMissionItems().isEmpty()) {
final T referenceItem = getMissionItems().get(0);
if (referenceItem instanceof SplineSurvey)
typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.SPLINE_SURVEY));
else
typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.SURVEY));
}

getBroadcastManager().registerReceiver(eventReceiver, eventFilter);
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip