+ void observeEditableFlag(NewTransactionActivity activity, Observer<Boolean> observer) {
+ editable.observe(activity, observer);
+ }
+ void stopObservingEditableFlag(Observer<Boolean> observer) {
+ editable.removeObserver(observer);
+ }
+ void observeCommentVisible(NewTransactionActivity activity, Observer<Boolean> observer) {
+ commentVisible.observe(activity, observer);
+ }
+ void stopObservingCommentVisible(Observer<Boolean> observer) {
+ commentVisible.removeObserver(observer);
+ }
+ void observeComment(NewTransactionActivity activity, Observer<String> observer) {
+ comment.observe(activity, observer);
+ }
+ void stopObservingComment(Observer<String> observer) {
+ comment.removeObserver(observer);
+ }
+ public void setComment(String comment) {
+ getAccount().setComment(comment);
+ this.comment.postValue(comment);
+ }
+ public Currency getCurrency() {
+ return this.currency.getValue();
+ }
+ public void setCurrency(Currency currency) {
+ Currency present = this.currency.getValue();
+ if ((currency == null) && (present != null) ||
+ (currency != null) && !currency.equals(present))
+ {
+ getAccount().setCurrency((currency != null && !currency.getName()
+ .isEmpty())
+ ? currency.getName() : null);
+ this.currency.setValue(currency);
+ }
+ }
+ void observeCurrency(NewTransactionActivity activity, Observer<Currency> observer) {
+ currency.observe(activity, observer);
+ }
+ void stopObservingCurrency(Observer<Currency> observer) {
+ currency.removeObserver(observer);
+ }
+ boolean isOfType(ItemType type) {
+ return this.type == type;
+ }
+ boolean isAmountHintSet() {
+ return amountHintIsSet;
+ }