From: Damyan Ivanov Date: Fri, 5 Feb 2021 06:08:18 +0000 (+0200) Subject: rename getPatternDAO to getTemplateDAO X-Git-Tag: v0.17.0~158 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=60e72ad85b09f4e6954fa794249400902439d42c;p=mobile-ledger.git rename getPatternDAO to getTemplateDAO --- 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());