From 60e72ad85b09f4e6954fa794249400902439d42c Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Fri, 5 Feb 2021 08:08:18 +0200 Subject: [PATCH] rename getPatternDAO to getTemplateDAO --- app/src/main/java/net/ktnx/mobileledger/db/DB.java | 2 +- .../ui/new_transaction/NewTransactionFragment.java | 4 ++-- .../mobileledger/ui/templates/TemplateDetailsViewModel.java | 4 ++-- .../ktnx/mobileledger/ui/templates/TemplateListFragment.java | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/db/DB.java b/app/src/main/java/net/ktnx/mobileledger/db/DB.java index a404ed96..136f947d 100644 --- a/app/src/main/java/net/ktnx/mobileledger/db/DB.java +++ b/app/src/main/java/net/ktnx/mobileledger/db/DB.java @@ -166,7 +166,7 @@ abstract public class DB extends RoomDatabase { .build(); } } - public abstract TemplateHeaderDAO getPatternDAO(); + public abstract TemplateHeaderDAO getTemplateDAO(); public abstract TemplateAccountDAO getPatternAccountDAO(); diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionFragment.java index 055ebbb2..6b120560 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionFragment.java @@ -111,7 +111,7 @@ public class NewTransactionFragment extends QRScanCapableFragment { return; LiveData> allPatterns = DB.get() - .getPatternDAO() + .getTemplateDAO() .getTemplates(); allPatterns.observe(getViewLifecycleOwner(), patternHeaders -> { ArrayList matchingPatterns = new ArrayList<>(); @@ -258,7 +258,7 @@ public class NewTransactionFragment extends QRScanCapableFragment { listAdapter.notifyItemChanged(0); DB.get() - .getPatternDAO() + .getTemplateDAO() .getTemplateWithAccounts(patternHeader.getId()) .observe(getViewLifecycleOwner(), entry -> { int rowIndex = 0; diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/templates/TemplateDetailsViewModel.java b/app/src/main/java/net/ktnx/mobileledger/ui/templates/TemplateDetailsViewModel.java index a24b9767..fad2d394 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/templates/TemplateDetailsViewModel.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/templates/TemplateDetailsViewModel.java @@ -96,7 +96,7 @@ public class TemplateDetailsViewModel extends ViewModel { } DB db = DB.get(); - LiveData dbList = db.getPatternDAO() + LiveData dbList = db.getTemplateDAO() .getTemplateWithAccounts(mPatternId); Observer observer = new Observer() { @Override @@ -140,7 +140,7 @@ public class TemplateDetailsViewModel extends ViewModel { TemplateDetailsItem.Header modelHeader = list.get(0) .asHeaderItem(); TemplateHeaderDAO headerDAO = DB.get() - .getPatternDAO(); + .getTemplateDAO(); TemplateHeader dbHeader = modelHeader.toDBO(); if (newPattern) { dbHeader.setId(null); diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/templates/TemplateListFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/templates/TemplateListFragment.java index 53564278..c7020e95 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/templates/TemplateListFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/templates/TemplateListFragment.java @@ -86,7 +86,7 @@ public class TemplateListFragment extends Fragment { b.templateList.setAdapter(modelAdapter); TemplateHeaderDAO pDao = DB.get() - .getPatternDAO(); + .getTemplateDAO(); LiveData> templates = pDao.getTemplates(); templates.observe(getViewLifecycleOwner(), modelAdapter::setTemplates); LinearLayoutManager llm = new LinearLayoutManager(getContext()); -- 2.39.5