Beispiel #1
0
  public void onRoutineSessionAdded(String sessionName, int index) {

    int orderIndex;
    String requestID;

    if (index == -1) {
      orderIndex = routineSessionData.getDataCount();
    } else {
      orderIndex = index;
    }

    RoutineSession routineSession = new RoutineSession();
    routineSession.setUserRoutineID(currentRoutineID);
    routineSession.setRoutineSessionName(sessionName);
    routineSession.setOrderIndex(orderIndex);

    if (index == -1) {
      requestID = routineSessionData.dataAddTemporary(routineSession);
    } else {
      requestID = routineSessionData.dataAddTemporary(routineSession, index);
    }

    routineService
        .getService()
        .addRoutineSession(
            User.instance().getToken(),
            requestID,
            routineSession,
            new CallbackScreener(callbackAddRoutineSession()));
  }
Beispiel #2
0
  public void onSessionExerciseAdded(SessionExercise sessionExercise) {

    String requestID = sessionExerciseData.dataAddTemporary(sessionExercise);

    routineService
        .getService()
        .addSessionExercise(
            User.instance().getToken(),
            requestID,
            sessionExercise,
            new CallbackScreener(callbackAddSessionExercise()));
  }
Beispiel #3
0
  public void onKeyPress(Widget sender, char keyCode, int modifiers) {
    if (sender == txtNewRoutine && keyCode == KEY_ENTER && txtNewRoutine.getText().length() > 0) {

      UserRoutine userRoutine = new UserRoutine();
      userRoutine.setRoutineName(txtNewRoutine.getText());

      String requestID = userRoutineData.dataAddTemporary(userRoutine);
      routineService
          .getService()
          .addUserRoutine(
              User.instance().getToken(),
              requestID,
              userRoutine,
              new CallbackScreener(callbackAddUserRoutine()));
      txtNewRoutine.setText("");
    }
  }