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.*;
|
||||
|
||||
public class HistoryEditorDialog extends AppCompatDialogFragment
|
||||
implements DialogInterface.OnClickListener, ModelObservable.Listener
|
||||
implements DialogInterface.OnClickListener
|
||||
{
|
||||
@Nullable
|
||||
private Habit habit;
|
||||
@@ -115,19 +115,6 @@ public class HistoryEditorDialog extends AppCompatDialogFragment
|
||||
return builder.create();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onModelChange()
|
||||
{
|
||||
refreshData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause()
|
||||
{
|
||||
habit.getComputedEntries().observable.removeListener(this);
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume()
|
||||
{
|
||||
@@ -140,9 +127,7 @@ public class HistoryEditorDialog extends AppCompatDialogFragment
|
||||
int height = Math.min(metrics.heightPixels, maxHeight);
|
||||
|
||||
getDialog().getWindow().setLayout(width, height);
|
||||
|
||||
refreshData();
|
||||
habit.getComputedEntries().observable.addListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -41,12 +41,9 @@ public abstract class EntryList
|
||||
{
|
||||
protected final Habit habit;
|
||||
|
||||
public final ModelObservable observable;
|
||||
|
||||
public EntryList(Habit habit)
|
||||
{
|
||||
this.habit = habit;
|
||||
this.observable = new ModelObservable();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
||||
@@ -80,7 +80,6 @@ public class MemoryEntryList extends EntryList
|
||||
public void invalidateNewerThan(Timestamp timestamp)
|
||||
{
|
||||
list.clear();
|
||||
observable.notifyListeners();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user