]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListAdapter.java
Data.transactions -> observable list
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / transaction_list / TransactionListAdapter.java
index 45d63af47c3760e1f1226ab00061fd46fd9dd49a..bad849e95bf95477c207ff8213dc51f0be4c2351 100644 (file)
@@ -32,6 +32,7 @@ import android.widget.LinearLayout;
 import android.widget.TextView;
 
 import net.ktnx.mobileledger.R;
+import net.ktnx.mobileledger.model.Data;
 import net.ktnx.mobileledger.model.LedgerTransaction;
 import net.ktnx.mobileledger.model.LedgerTransactionAccount;
 import net.ktnx.mobileledger.model.TransactionListItem;
@@ -79,9 +80,9 @@ public class TransactionListAdapter extends RecyclerView.Adapter<TransactionRowH
                 // WORKAROUND what seems to be a bug in CardHolder somewhere
                 // when a view that was previously holding a delimiter is re-purposed
                 // occasionally it stays too short (not high enough)
-//                holder.vTransaction.measure(View.MeasureSpec
-//                                .makeMeasureSpec(holder.itemView.getWidth(), View.MeasureSpec.EXACTLY),
-//                        View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
+                holder.vTransaction.measure(View.MeasureSpec
+                                .makeMeasureSpec(holder.itemView.getWidth(), View.MeasureSpec.EXACTLY),
+                        View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
                 break;
             case DELIMITER:
                 Date date = item.getDate();
@@ -126,7 +127,7 @@ public class TransactionListAdapter extends RecyclerView.Adapter<TransactionRowH
 
     @Override
     public int getItemCount() {
-        return TransactionListViewModel.getTransactionCount() + 1;
+        return Data.transactions.size() + 1;
     }
     public void setBoldAccountName(String boldAccountName) {
         this.boldAccountName = boldAccountName;
@@ -144,7 +145,7 @@ public class TransactionListAdapter extends RecyclerView.Adapter<TransactionRowH
             LedgerTransaction tr = p[0].transaction;
             boolean odd = p[0].odd;
 
-            SQLiteDatabase db = MLDB.getReadableDatabase();
+            SQLiteDatabase db = MLDB.getDatabase();
             tr.loadData(db);
 
             publishProgress(new TransactionLoaderStep(p[0].holder, p[0].position, tr, odd));