import net.ktnx.mobileledger.R;
import net.ktnx.mobileledger.databinding.NewTransactionHeaderRowBinding;
import net.ktnx.mobileledger.R;
import net.ktnx.mobileledger.databinding.NewTransactionHeaderRowBinding;
//TODO multiple amounts with different currencies per posting?
NewTransactionHeaderItemHolder(@NonNull NewTransactionHeaderRowBinding b,
NewTransactionItemsAdapter adapter) {
//TODO multiple amounts with different currencies per posting?
NewTransactionHeaderItemHolder(@NonNull NewTransactionHeaderRowBinding b,
NewTransactionItemsAdapter adapter) {
b.newTransactionDescription.setAdapter(
new TransactionDescriptionAutocompleteAdapter(activity));
b.newTransactionDescription.setOnItemClickListener(
b.newTransactionDescription.setAdapter(
new TransactionDescriptionAutocompleteAdapter(activity));
b.newTransactionDescription.setOnItemClickListener(
- (parent, view, position, id) -> activity.descriptionSelected(
+ (parent, view, position, id) -> activity.onDescriptionSelected(
// bad idea - double pop-up, and not really necessary.
// the user can tap the input to get the calendar
//if (!tvDate.hasFocus()) tvDate.requestFocus();
// bad idea - double pop-up, and not really necessary.
// the user can tap the input to get the calendar
//if (!tvDate.hasFocus()) tvDate.requestFocus();
// probably the row was swiped out
Logger.debug("new-trans", "Ignoring request to suncData(): adapter position negative");
return false;
// probably the row was swiped out
Logger.debug("new-trans", "Ignoring request to suncData(): adapter position negative");
return false;
- b.transactionComment.setText(head.getComment());
- //styleComment(b.transactionComment, head.getComment());
+ final String comment = head.getComment();
+ b.transactionComment.setText(comment);
+ styleComment(b.transactionComment, comment); // would hide or make it visible
head.setDate(new SimpleDate(year, month + 1, day));
b.newTransactionDate.setText(head.getFormattedDate());
head.setDate(new SimpleDate(year, month + 1, day));
b.newTransactionDate.setText(head.getFormattedDate());