mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Remove ModelObservable from EntryList
This commit is contained in:
@@ -41,7 +41,7 @@ import org.jetbrains.annotations.*;
|
|||||||
import static org.isoron.uhabits.utils.InterfaceUtils.*;
|
import static org.isoron.uhabits.utils.InterfaceUtils.*;
|
||||||
|
|
||||||
public class HistoryEditorDialog extends AppCompatDialogFragment
|
public class HistoryEditorDialog extends AppCompatDialogFragment
|
||||||
implements DialogInterface.OnClickListener, ModelObservable.Listener
|
implements DialogInterface.OnClickListener
|
||||||
{
|
{
|
||||||
@Nullable
|
@Nullable
|
||||||
private Habit habit;
|
private Habit habit;
|
||||||
@@ -115,19 +115,6 @@ public class HistoryEditorDialog extends AppCompatDialogFragment
|
|||||||
return builder.create();
|
return builder.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onModelChange()
|
|
||||||
{
|
|
||||||
refreshData();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPause()
|
|
||||||
{
|
|
||||||
habit.getComputedEntries().observable.removeListener(this);
|
|
||||||
super.onPause();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume()
|
public void onResume()
|
||||||
{
|
{
|
||||||
@@ -140,9 +127,7 @@ public class HistoryEditorDialog extends AppCompatDialogFragment
|
|||||||
int height = Math.min(metrics.heightPixels, maxHeight);
|
int height = Math.min(metrics.heightPixels, maxHeight);
|
||||||
|
|
||||||
getDialog().getWindow().setLayout(width, height);
|
getDialog().getWindow().setLayout(width, height);
|
||||||
|
|
||||||
refreshData();
|
refreshData();
|
||||||
habit.getComputedEntries().observable.addListener(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -41,12 +41,9 @@ public abstract class EntryList
|
|||||||
{
|
{
|
||||||
protected final Habit habit;
|
protected final Habit habit;
|
||||||
|
|
||||||
public final ModelObservable observable;
|
|
||||||
|
|
||||||
public EntryList(Habit habit)
|
public EntryList(Habit habit)
|
||||||
{
|
{
|
||||||
this.habit = habit;
|
this.habit = habit;
|
||||||
this.observable = new ModelObservable();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
|
|||||||
@@ -80,7 +80,6 @@ public class MemoryEntryList extends EntryList
|
|||||||
public void invalidateNewerThan(Timestamp timestamp)
|
public void invalidateNewerThan(Timestamp timestamp)
|
||||||
{
|
{
|
||||||
list.clear();
|
list.clear();
|
||||||
observable.notifyListeners();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user