import net.ktnx.mobileledger.model.MobileLedgerProfile;
import net.ktnx.mobileledger.ui.CurrencySelectorFragment;
import net.ktnx.mobileledger.ui.DatePickerFragment;
-import net.ktnx.mobileledger.ui.OnCurrencySelectedListener;
import net.ktnx.mobileledger.ui.TextViewClearHelper;
import net.ktnx.mobileledger.utils.Colors;
import net.ktnx.mobileledger.utils.DimensionUtils;
import static net.ktnx.mobileledger.ui.activity.NewTransactionModel.ItemType;
class NewTransactionItemHolder extends RecyclerView.ViewHolder
- implements DatePickerFragment.DatePickedListener, DescriptionSelectedCallback,
- OnCurrencySelectedListener {
+ implements DatePickerFragment.DatePickedListener, DescriptionSelectedCallback {
private final String decimalSeparator;
private final String decimalDot;
private final TextView tvCurrency;
tvCurrency.setOnClickListener(v -> {
CurrencySelectorFragment cpf = new CurrencySelectorFragment();
- cpf.setOnCurrencySelectedListener(this);
cpf.showPositionAndPadding();
+ cpf.setOnCurrencySelectedListener(c -> item.setCurrency(c));
final AppCompatActivity activity = (AppCompatActivity) v.getContext();
cpf.show(activity.getSupportFragmentManager(), "currency-selector");
});
}
@Override
- public void onCurrencySelected(Currency currency) {
- adapter.model.setItemCurrency(this.item, currency, adapter);
- }
- @Override
public void descriptionSelected(String description) {
tvAccount.setText(description);
tvAmount.requestFocus(View.FOCUS_FORWARD);