Exemplo n.º 1
0
  @Override
  public boolean persist(Metadata item) {
    if (!item.containsValue(Metadata.CREATION_DATE))
      item.setValue(Metadata.CREATION_DATE, DateUtilities.now());

    boolean state = super.persist(item);
    if (Preferences.getBoolean(AstridPreferences.P_FIRST_LIST, true)) {
      if (state && item.getValue(Metadata.KEY).equals(TagService.KEY)) {
        StatisticsService.reportEvent(StatisticsConstants.USER_FIRST_LIST);
        Preferences.setBoolean(AstridPreferences.P_FIRST_LIST, false);
      }
    }
    Astrid2TaskProvider.notifyDatabaseModification();
    return state;
  }
Exemplo n.º 2
0
  @Override
  public boolean persist(Metadata item) {
    if (!item.containsValue(Metadata.CREATION_DATE)) {
      item.setValue(Metadata.CREATION_DATE, DateUtilities.now());
    }

    boolean state = super.persist(item);
    if (Preferences.getBoolean(AstridPreferences.P_FIRST_LIST, true)) {
      if (state
          && item.containsNonNullValue(Metadata.KEY)
          && item.getValue(Metadata.KEY).equals(TaskToTagMetadata.KEY)) {
        Preferences.setBoolean(AstridPreferences.P_FIRST_LIST, false);
      }
    }
    Astrid2TaskProvider.notifyDatabaseModification();
    return state;
  }