]> git.ktnx.net Git - mobile-ledger.git/commitdiff
private access when appropriate
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 3 May 2020 09:10:14 +0000 (12:10 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 3 May 2020 09:10:14 +0000 (12:10 +0300)
app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemsAdapter.java

index 741af1b048252dc4ae84ee195f3e114ee8c71957..7aaacf9ed3e6ba4da3548749ceb48cc707585c7c 100644 (file)
@@ -52,7 +52,7 @@ import static net.ktnx.mobileledger.utils.Logger.debug;
 
 class NewTransactionItemsAdapter extends RecyclerView.Adapter<NewTransactionItemHolder>
         implements DescriptionSelectedCallback {
-    NewTransactionModel model;
+    private NewTransactionModel model;
     private MobileLedgerProfile mProfile;
     private ItemTouchHelper touchHelper;
     private RecyclerView recyclerView;
@@ -126,10 +126,10 @@ class NewTransactionItemsAdapter extends RecyclerView.Adapter<NewTransactionItem
     public void setProfile(MobileLedgerProfile profile) {
         mProfile = profile;
     }
-    int addRow() {
+    private int addRow() {
         return addRow(null);
     }
-    int addRow(String commodity) {
+    private int addRow(String commodity) {
         final int newAccountCount = model.addAccount(new LedgerTransactionAccount("", commodity));
         Logger.debug("new-transaction",
                 String.format(Locale.US, "invoking notifyItemInserted(%d)", newAccountCount));
@@ -160,7 +160,7 @@ class NewTransactionItemsAdapter extends RecyclerView.Adapter<NewTransactionItem
     public int getItemCount() {
         return model.getAccountCount() + 2;
     }
-    boolean accountListIsEmpty() {
+    private boolean accountListIsEmpty() {
         for (int i = 0; i < model.getAccountCount(); i++) {
             LedgerTransactionAccount acc = model.getAccount(i);
             if (!acc.getAccountName()
@@ -344,7 +344,7 @@ class NewTransactionItemsAdapter extends RecyclerView.Adapter<NewTransactionItem
             // TODO perhaps do only one notification about the whole range (notifyDatasetChanged)?
         }
     }
-    public void reset() {
+    void reset() {
         int presentItemCount = model.getAccountCount();
         model.reset();
         notifyItemChanged(0);       // header changed
@@ -352,16 +352,16 @@ class NewTransactionItemsAdapter extends RecyclerView.Adapter<NewTransactionItem
         if (presentItemCount > 2)
             notifyItemRangeRemoved(3, presentItemCount - 2); // all the rest are gone
     }
-    public void updateFocusedItem(int position) {
+    void updateFocusedItem(int position) {
         model.updateFocusedItem(position);
     }
-    public void noteFocusIsOnAccount(int position) {
+    void noteFocusIsOnAccount(int position) {
         model.noteFocusChanged(position, NewTransactionModel.FocusedElement.Account);
     }
-    public void noteFocusIsOnAmount(int position) {
+    void noteFocusIsOnAmount(int position) {
         model.noteFocusChanged(position, NewTransactionModel.FocusedElement.Amount);
     }
-    public void noteFocusIsOnComment(int position) {
+    void noteFocusIsOnComment(int position) {
         model.noteFocusChanged(position, NewTransactionModel.FocusedElement.Comment);
     }
     private void holdSubmittableChecks() {