- NewTransactionItemHolder(@NonNull View itemView, NewTransactionItemsAdapter adapter) {
- super(itemView);
- lAccount = itemView.findViewById(R.id.ntr_account);
- tvAccount = lAccount.findViewById(R.id.account_row_acc_name);
- tvComment = lAccount.findViewById(R.id.comment);
- tvTransactionComment = itemView.findViewById(R.id.transaction_comment);
- new TextViewClearHelper().attachToTextView((EditText) tvComment);
- tvAmount = itemView.findViewById(R.id.account_row_acc_amounts);
- tvCurrency = itemView.findViewById(R.id.currency);
- tvDate = itemView.findViewById(R.id.new_transaction_date);
- tvDescription = itemView.findViewById(R.id.new_transaction_description);
- tvDummy = itemView.findViewById(R.id.dummy_text);
- lHead = itemView.findViewById(R.id.ntr_data);
- lPadding = itemView.findViewById(R.id.ntr_padding);
- final View commentLayout = itemView.findViewById(R.id.comment_layout);
- final View transactionCommentLayout =
- itemView.findViewById(R.id.transaction_comment_layout);
-
- tvDescription.setNextFocusForwardId(View.NO_ID);
- tvAccount.setNextFocusForwardId(View.NO_ID);
- tvAmount.setNextFocusForwardId(View.NO_ID); // magic!
-
- tvDate.setOnClickListener(v -> pickTransactionDate());
-
- lAccount.findViewById(R.id.comment_button)
- .setOnClickListener(v -> {
- tvComment.setVisibility(View.VISIBLE);
- tvComment.requestFocus();
- });
-
- transactionCommentLayout.findViewById(R.id.comment_button)
- .setOnClickListener(v -> {
- tvTransactionComment.setVisibility(View.VISIBLE);
- tvTransactionComment.requestFocus();
- });
+ NewTransactionItemHolder(@NonNull NewTransactionRowBinding b,
+ NewTransactionItemsAdapter adapter) {
+ super(b.getRoot());
+ this.b = b;
+ new TextViewClearHelper().attachToTextView((EditText) b.comment);
+
+ b.newTransactionDescription.setNextFocusForwardId(View.NO_ID);
+ b.accountRowAccName.setNextFocusForwardId(View.NO_ID);
+ b.accountRowAccAmounts.setNextFocusForwardId(View.NO_ID); // magic!
+
+ b.newTransactionDate.setOnClickListener(v -> pickTransactionDate());
+
+ b.accountCommentButton.setOnClickListener(v -> {
+ b.comment.setVisibility(View.VISIBLE);
+ b.comment.requestFocus();
+ });
+
+ b.transactionCommentButton.setOnClickListener(v -> {
+ b.transactionComment.setVisibility(View.VISIBLE);
+ b.transactionComment.requestFocus();
+ });