コード例 #1
0
 private void setupButtonsByFlightState() {
   final State droneState = getDrone().getAttribute(AttributeType.STATE);
   if (droneState != null && droneState.isConnected()) {
     if (droneState.isArmed()) {
       if (droneState.isFlying()) {
         setupButtonsForFlying();
       } else {
         setupButtonsForArmed();
       }
     } else {
       setupButtonsForDisarmed();
     }
   } else {
     setupButtonsForDisconnected();
   }
 }
コード例 #2
0
 @Override
 public boolean isSlidingUpPanelEnabled(Drone drone) {
   final State droneState = drone.getAttribute(AttributeType.STATE);
   return droneState.isConnected() && droneState.isArmed() && droneState.isFlying();
 }