diff --git a/app/src/main/java/org/ntlab/acanthus_client/views/paint/PaintActivity.java b/app/src/main/java/org/ntlab/acanthus_client/views/paint/PaintActivity.java index 05da37c..8a5a6b7 100644 --- a/app/src/main/java/org/ntlab/acanthus_client/views/paint/PaintActivity.java +++ b/app/src/main/java/org/ntlab/acanthus_client/views/paint/PaintActivity.java @@ -14,6 +14,7 @@ import org.ntlab.acanthus_client.R; import org.ntlab.acanthus_client.databinding.ActivityPaintBinding; import org.ntlab.acanthus_client.entities.Stroke; +import org.ntlab.acanthus_client.views.paint.page.PageViewModel; import java.util.Collection; @@ -29,6 +30,7 @@ private ActivityPaintBinding binding; private PaintViewModel paintViewModel; + private PageViewModel pageViewModel; private boolean buttonView = false; @@ -37,6 +39,7 @@ @Override public void onDestroy() { super.onDestroy(); + pageViewModel.resetPageNo(); } //----------------------------------------------------------------- @@ -60,7 +63,6 @@ @Override protected void onPause() { super.onPause(); -// paintViewModel.stop(); } //----------------------------------------------------------------- @@ -69,7 +71,10 @@ private void init() { Acanthus acanthus = (Acanthus) getApplication(); paintViewModel = new ViewModelProvider(this).get(PaintViewModel.class); + pageViewModel = new ViewModelProvider(this).get(PageViewModel.class); + paintViewModel.init(acanthus); + pageViewModel.init(acanthus); startObserve(); }