Skip to content

Commit

Permalink
Merge pull request #1334 from ne0fhyk/3dr_services_client_lib_impl_up…
Browse files Browse the repository at this point in the history
…date

3dr services client lib update
  • Loading branch information
m4gr3d committed Dec 22, 2014
2 parents dd603df + df286dd commit 74ee02c
Show file tree
Hide file tree
Showing 55 changed files with 1,134 additions and 791 deletions.
3 changes: 1 addition & 2 deletions Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.droidplanner.android">

<supports-screens
Expand Down Expand Up @@ -50,7 +49,7 @@
android:label="@string/app_title"
android:theme="@style/CustomActionBarTheme"
android:windowSoftInputMode="adjustPan"
tools:replace="android:label">
>

<!-- You must insert your own Google Maps for Android API v2 key in here. -->
<meta-data
Expand Down
9 changes: 7 additions & 2 deletions Android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies {
compile 'com.android.support:cardview-v7:21.0.2'
compile 'com.android.support:recyclerview-v7:21.0.2'

compile 'com.o3dr:3dr-services-lib:2.1.14'
compile 'com.o3dr:3dr-services-lib:2.1.23'

compile files('libs/droneapi-java.jar')
compile files('libs/j2xx.jar')
Expand All @@ -29,10 +29,15 @@ android {
applicationId 'org.droidplanner.android'
minSdkVersion 14
targetSdkVersion 21
versionCode 30010
versionCode 30011
versionName getGitVersion()
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
Expand Down
24 changes: 7 additions & 17 deletions Android/res/layout/fragment_editor_detail_set_servo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,25 +93,15 @@
android:layout_height="wrap_content"
android:orientation="vertical"
android:text="@string/channel_label" />

<TextView
style="@style/ModeDetailText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/pwm"
android:textAppearance="?android:attr/textAppearanceMedium" />

<EditText
android:id="@+id/PwmEditText"

<org.droidplanner.android.widgets.spinnerWheel.CardWheelHorizontalView
android:id="@+id/pwmPicker"
style="@style/missionItemDetailCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:imeOptions="actionDone"
android:paddingLeft="16dp"
android:paddingRight="16dp"
/>

android:orientation="vertical"
android:text="@string/pwm"/>

</LinearLayout>

</RelativeLayout>
42 changes: 26 additions & 16 deletions Android/res/menu/menu_super_activiy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,36 @@
/>

<item
android:id="@+id/menu_send_mission"
android:id="@+id/menu_upload_mission"
app:showAsAction="never"
android:title="@string/send_mission"/>
android:title="@string/upload_mission"/>
<item
android:id="@+id/menu_load_mission"
android:id="@+id/menu_download_mission"
app:showAsAction="never"
android:title="@string/load_mission"/>

<item
android:id="@+id/menu_triggerCamera"
app:showAsAction="never"
android:title="Picture"/>
<item
android:id="@+id/menu_epm_release"
app:showAsAction="never"
android:title="Release"/>
android:title="@string/download_mission"/>

<item
android:id="@+id/menu_epm_grab"
app:showAsAction="never"
android:title="Grab"/>
android:id="@+id/menu_advanced"
android:enabled="false"
android:visible="false"
android:title="Advanced"
app:showAsAction="never">
<menu>
<item
android:id="@+id/menu_triggerCamera"
app:showAsAction="never"
android:title="Picture"/>
<item
android:id="@+id/menu_epm_release"
app:showAsAction="never"
android:title="Release"/>
<item
android:id="@+id/menu_epm_grab"
app:showAsAction="never"
android:title="Grab"/>
</menu>
</item>

</group>

<item
Expand Down
4 changes: 2 additions & 2 deletions Android/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<string name="help">Hilfe</string>
<string name="menu_drone_setup">Drohnen-Setup</string>
<string name="editor">Editor</string>
<string name="send_mission">Mission senden</string>
<string name="load_mission">Mission laden</string>
<string name="upload_mission">Mission senden</string>
<string name="download_mission">Mission laden</string>

<!-- Drone Setup tabs -->
<string name="screen_tuning">Tuning</string>
Expand Down
4 changes: 2 additions & 2 deletions Android/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<string name="app_settings">Impostazioni App</string>
<string name="flight_data">Dati volo</string>
<string name="editor">Editore</string>
<string name="send_mission">Invia missione</string>
<string name="load_mission">Carica missione</string>
<string name="upload_mission">Invia missione</string>
<string name="download_mission">Carica missione</string>

<!-- Drone Setup tabs -->
<string name="screen_tuning">Messa a punto</string>
Expand Down
7 changes: 2 additions & 5 deletions Android/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<string name="app_settings">应用设置</string>
<string name="flight_data">飞行数据</string>
<string name="editor">编辑器</string>
<string name="send_mission">发送任务</string>
<string name="load_mission">加载任务</string>
<string name="upload_mission">发送任务</string>
<string name="download_mission">加载任务</string>

<!-- Map related strings -->
<string name="mapbox_id">ne0fhyk.ighceofk</string>
Expand Down Expand Up @@ -211,9 +211,6 @@
<string name="waypointInfo_ROI">设置一个位置和高度来设定飞行器指向,瞄准可选的相机。</string>
<string name="waypointInfo_SetJump">重复航点</string>

<!-- Custom waypoint info -->
<string name="pwm">PWM:</string>

<!-- Waypoint editor -->
<string name="editor_err_land_rtl_added">在LAND或RTL后无法添加新的航点</string>
<string name="editor_info_window">距离:200m,飞行时间:3:30s</string>
Expand Down
4 changes: 2 additions & 2 deletions Android/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<string name="app_settings">App 設定</string>
<string name="flight_data">飛行數據</string>
<string name="editor">編輯器</string>
<string name="send_mission">發送任務</string>
<string name="load_mission">載入任務</string>
<string name="upload_mission">發送任務</string>
<string name="download_mission">載入任務</string>

<!-- Drone Setup tabs -->
<string name="screen_tuning">調整參數</string>
Expand Down
1 change: 1 addition & 0 deletions Android/res/values/preferences_keys.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This file is used to store the preferences keys so that it's accessible and modi
<string name="pref_connection_type_key">pref_connection_param_type</string>
<string name="pref_map_type_key">pref_map_type</string>
<string name="pref_advanced_use_offline_maps_key">pref_advanced_use_offline_maps</string>
<string name="pref_advanced_menu_toggle_key">pref_advanced_menu_toggle</string>
<string name="pref_baud_type_key">pref_baud_type</string>
<string name="pref_server_ip_key">pref_server_ip</string>
<string name="pref_server_port_key">pref_server_port</string>
Expand Down
11 changes: 5 additions & 6 deletions Android/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@
<string name="app_settings">App Settings</string>
<string name="flight_data">Flight Data</string>
<string name="editor">Editor</string>
<string name="send_mission">Send Mission</string>
<string name="load_mission">Load Mission</string>

<!-- Map related strings -->
<string name="mapbox_id">ne0fhyk.ighceofk</string>
<string name="upload_mission">Upload Mission</string>
<string name="download_mission">Download Mission</string>

<!-- Drone Setup tabs -->
<string name="screen_tuning">Tuning</string>
Expand Down Expand Up @@ -212,7 +209,7 @@
<string name="waypointInfo_SetJump">Repeat waypoint</string>

<!-- Custom waypoint info -->
<string name="pwm">PWM:</string>
<string name="pwm">PWM</string>

<!-- Waypoint editor -->
<string name="editor_err_land_rtl_added">One cannot add new waypoints after LAND or RTL</string>
Expand Down Expand Up @@ -535,5 +532,7 @@
dronie.</string>
<string name="editor_multi_edit_no_waypoint_error">No waypoint(s) selected.</string>
<string name="failed_start_calibration_message">Unable to start calibration!</string>
<string name="pref_advanced_menu_title">Advanced Menu</string>
<string name="pref_advanced_menu_summary">Enable advanced menu options.</string>

</resources>
7 changes: 7 additions & 0 deletions Android/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,13 @@
android:summary="@string/pref_ui_gps_hdop_summary"
android:title="@string/pref_ui_gps_hdop_title" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_misc_title">
<CheckBoxPreference
android:defaultValue="false"
android:key="@string/pref_advanced_menu_toggle_key"
android:title="@string/pref_advanced_menu_title"
android:summary="@string/pref_advanced_menu_summary"/>
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_pebble" >
<Preference
android:key="@string/pref_pebble_install_key"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,25 @@ public abstract class SuperUI extends ActionBarActivity implements DroidPlannerA
static {
superIntentFilter.addAction(AttributeEvent.STATE_CONNECTED);
superIntentFilter.addAction(AttributeEvent.STATE_DISCONNECTED);
superIntentFilter.addAction(Utils.ACTION_UPDATE_OPTIONS_MENU);
}

private final BroadcastReceiver superReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
if (AttributeEvent.STATE_CONNECTED.equals(action)) {
onDroneConnected();
} else if (AttributeEvent.STATE_DISCONNECTED.equals(action)) {
onDroneDisconnected();
switch (action) {
case AttributeEvent.STATE_CONNECTED:
onDroneConnected();
break;

case AttributeEvent.STATE_DISCONNECTED:
onDroneDisconnected();
break;

case Utils.ACTION_UPDATE_OPTIONS_MENU:
invalidateOptionsMenu();
break;
}
}
};
Expand Down Expand Up @@ -182,13 +191,18 @@ public boolean onCreateOptionsMenu(Menu menu) {
menu.setGroupEnabled(R.id.menu_group_connected, true);
menu.setGroupVisible(R.id.menu_group_connected, true);

final boolean isAdvancedEnabled = mAppPrefs.isAdvancedMenuEnabled();
final MenuItem advancedSubMenu = menu.findItem(R.id.menu_advanced);
advancedSubMenu.setEnabled(isAdvancedEnabled);
advancedSubMenu.setVisible(isAdvancedEnabled);

final boolean areMissionMenusEnabled = enableMissionMenus();

final MenuItem sendMission = menu.findItem(R.id.menu_send_mission);
final MenuItem sendMission = menu.findItem(R.id.menu_upload_mission);
sendMission.setEnabled(areMissionMenusEnabled);
sendMission.setVisible(areMissionMenusEnabled);

final MenuItem loadMission = menu.findItem(R.id.menu_load_mission);
final MenuItem loadMission = menu.findItem(R.id.menu_download_mission);
loadMission.setEnabled(areMissionMenusEnabled);
loadMission.setVisible(areMissionMenusEnabled);

Expand Down Expand Up @@ -223,7 +237,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
toggleDroneConnection();
return true;

case R.id.menu_send_mission: {
case R.id.menu_upload_mission: {
final MissionProxy missionProxy = dpApp.getMissionProxy();
if (missionProxy.getItems().isEmpty() || missionProxy.hasTakeoffAndLandOrRTL()) {
missionProxy.sendMissionToAPM(dpApi);
Expand Down Expand Up @@ -252,7 +266,7 @@ public void onNo() {
return true;
}

case R.id.menu_load_mission:
case R.id.menu_download_mission:
dpApi.loadWaypoints();
return true;
case R.id.menu_triggerCamera:
Expand Down
Loading

0 comments on commit 74ee02c

Please sign in to comment.