fix checklist issues

This commit is contained in:
Phillip Thelen 2017-07-17 19:00:38 +02:00
parent cc79b47fb3
commit 0def043b7f
5 changed files with 6 additions and 17 deletions

View file

@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.habitrpg.android.habitica"
android:versionCode="1917"
android:versionCode="1919"
android:versionName="1.1.4"
android:screenOrientation="portrait"
android:installLocation="auto" >

View file

@ -115,7 +115,7 @@ public class TaskRepositoryImpl extends BaseRepositoryImpl<TaskLocalRepository>
public Observable<Task> scoreChecklistItem(String taskId, String itemId) {
return apiClient.scoreChecklistItem(taskId, itemId)
.flatMap(task -> localRepository.getTask(taskId))
.flatMap(task -> localRepository.getTask(taskId).first())
.doOnNext(task -> localRepository.executeTransaction(realm -> {
for (ChecklistItem item : task.getChecklist()) {
if (itemId.equals(item.getId())) {

View file

@ -5,11 +5,7 @@ import java.util.Date;
import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;
/**
* Created by keithholliday on 5/31/16.
*/
public class RemindersItem extends RealmObject {
Task task;
@PrimaryKey
private String id;
private Date startDate;
@ -51,14 +47,6 @@ public class RemindersItem extends RealmObject {
this.time = time;
}
public Task getTask() {
return task;
}
public void setTask(Task task) {
this.task = task;
}
public String getType() {
return this.type;
}

View file

@ -278,9 +278,6 @@ public class Task extends RealmObject implements Parcelable {
}
public void setReminders(RealmList<RemindersItem> reminders) {
for (RemindersItem reminder : reminders) {
reminder.setTask(this);
}
this.reminders = reminders;
}

View file

@ -1091,6 +1091,10 @@ public class TaskFormActivity extends BaseActivity implements AdapterView.OnItem
return false;
}
if (!task.isValid()) {
return true;
}
taskRepository.executeTransaction(realm -> {
task.text = text;