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

Droneshare removal #1706

Merged
merged 8 commits into from
Feb 22, 2016
Prev Previous commit
Next Next commit
Replace deprecated methods of the dronekit-android api
  • Loading branch information
m4gr3d committed Feb 21, 2016
commit ff6239086b1c26ec254dd683aa5239e3789e8754
Original file line number Diff line number Diff line change
@@ -14,6 +14,9 @@

import com.google.android.gms.analytics.HitBuilders;
import com.o3dr.android.client.Drone;
import com.o3dr.android.client.apis.ControlApi;
import com.o3dr.android.client.apis.FollowApi;
import com.o3dr.android.client.apis.VehicleApi;
import com.o3dr.services.android.lib.drone.attribute.AttributeEvent;
import com.o3dr.services.android.lib.drone.attribute.AttributeType;
import com.o3dr.services.android.lib.drone.property.GuidedState;
@@ -319,25 +322,25 @@ public void onClick(View v) {
break;

case R.id.mc_homeBtn:
drone.changeVehicleMode(VehicleMode.PLANE_RTL);
VehicleApi.getApi(drone).setVehicleMode(VehicleMode.PLANE_RTL);
eventBuilder.setAction(ACTION_FLIGHT_ACTION_BUTTON)
.setLabel(VehicleMode.PLANE_RTL.getLabel());
break;

case R.id.mc_pause: {
final FollowState followState = drone.getAttribute(AttributeType.FOLLOW_STATE);
if (followState.isEnabled()) {
drone.disableFollowMe();
FollowApi.getApi(drone).disableFollowMe();
}

drone.pauseAtCurrentLocation();
ControlApi.getApi(drone).pauseAtCurrentLocation(null);
eventBuilder.setAction(ACTION_FLIGHT_ACTION_BUTTON).setLabel("Pause");
break;
}

case R.id.mc_TakeoffInAutoBtn:
case R.id.mc_autoBtn:
drone.changeVehicleMode(VehicleMode.PLANE_AUTO);
VehicleApi.getApi(drone).setVehicleMode(VehicleMode.PLANE_AUTO);
eventBuilder.setAction(ACTION_FLIGHT_ACTION_BUTTON).setLabel(VehicleMode.PLANE_AUTO.getLabel());
break;