Beispiel #1
0
  /* (non-Javadoc)
   * @see org.chaseme.activities.helpers.SuperUI#onCreate(android.os.Bundle)
   */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_flight);

    fragmentManager = getSupportFragmentManager();
    // modeInfoPanel = fragmentManager.findFragmentById(R.id.modeInfoPanel);
    failsafeTextView = findViewById(R.id.failsafeTextView);

    // Load the activity fragments
    Fragment modeRtl = fragmentManager.findFragmentById(R.id.modeInfoPanel);
    if (modeRtl == null) {
      modeRtl = new ModeRTLFragment();
      fragmentManager.beginTransaction().add(R.id.modeInfoPanel, modeRtl).commit();
    }

    mapFragment = fragmentManager.findFragmentById(R.id.mapFragment);
    if (mapFragment == null) {
      mapFragment = new FlightMapFragment();
      fragmentManager.beginTransaction().add(R.id.mapFragment, mapFragment).commit();
    }

    Fragment telemetryFragment = fragmentManager.findFragmentById(R.id.telemetryFragment);
    if (telemetryFragment == null) {
      telemetryFragment = new TelemetryFragment();
      fragmentManager.beginTransaction().add(R.id.telemetryFragment, telemetryFragment).commit();
    }

    Fragment editorTools = fragmentManager.findFragmentById(R.id.editorToolsFragment);
    if (editorTools == null) {
      editorTools = new FlightActionsFragment();
      fragmentManager.beginTransaction().add(R.id.editorToolsFragment, editorTools).commit();
    }
  }
Beispiel #2
0
 /* (non-Javadoc)
  * @see org.chaseme.activities.helpers.SuperUI#onDroneEvent(org.chaseme.drone.DroneInterfaces.DroneEventsType, org.chaseme.drone.Drone)
  */
 @Override
 public void onDroneEvent(DroneEventsType event, Drone drone) {
   super.onDroneEvent(event, drone);
   switch (event) {
     case FAILSAFE:
       onFailsafeChanged(drone);
       break;
     case MODE:
       onModeChanged(drone);
       break;
     default:
       break;
   }
 }
Beispiel #3
0
 /* (non-Javadoc)
  * @see org.chaseme.activities.helpers.SuperUI#onStart()
  */
 @Override
 protected void onStart() {
   super.onStart();
   onModeChanged(drone); // Update the mode detail panel;
 }