]> git.ktnx.net Git - mobile-ledger.git/commitdiff
fix linter warning about calling LayoutInflater.inflate with root=null
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 15 Aug 2020 12:08:27 +0000 (12:08 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 15 Aug 2020 12:48:13 +0000 (12:48 +0000)
app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListAdapter.java

index b959acfdf30ed75523c64a020c32328b1753cc0a..bea94667085a961fb1ebd6ef309fb3080f932fc6 100644 (file)
@@ -227,11 +227,10 @@ public class TransactionListAdapter extends RecyclerView.Adapter<TransactionRowH
                     Context ctx = holder.row.getContext();
                     LinearLayout row = (LinearLayout) holder.tableAccounts.getChildAt(rowIndex);
                     if (row == null) {
+                        row = new LinearLayout(ctx);
                         LayoutInflater inflater = ((Activity) ctx).getLayoutInflater();
-                        row = (LinearLayout) inflater.inflate(
-                                R.layout.transaction_list_row_accounts_table_row, null);
-                        // if the rootView above is given (and the line below is spared)
-                        // the accounts remain with their default text (set in the layout resource)
+                        inflater.inflate(
+                                R.layout.transaction_list_row_accounts_table_row, row);
                         holder.tableAccounts.addView(row);
                     }
                     TextView dummyText = row.findViewById(R.id.dummy_text);