Example #1
0
    @Override
    public void updateItemView(final Context context, final Drone drone) {
      if (mItemView != null) {

        final String update;
        if (drone == null) {
          update = "--";
        } else if (mAppPrefs.shouldGpsHdopBeDisplayed()) {
          update =
              String.format(
                  Locale.ENGLISH,
                  "Satellite\n%d, %.1f",
                  drone.GPS.getSatCount(),
                  drone.GPS.getGpsEPH());
        } else {
          update =
              String.format(
                  Locale.ENGLISH,
                  "Satellite\n%d, %s",
                  drone.GPS.getSatCount(),
                  drone.GPS.getFixType());
        }

        ((TextView) mItemView).setText(update);
      }
    }
 @Override
 public void onDroneEvent(DroneEventsType event, Drone drone) {
   switch (event) {
     case ARMING:
       // Clear the previous flight path when arming.
       if (drone.state.isArmed()) {
         mMapFragment.clearFlightPath();
       }
       break;
     case GPS:
       animateCameraIfNeeded(drone.GPS.getPosition());
       break;
     default:
       break;
   }
   super.onDroneEvent(event, drone);
 }