Add popups

This commit is contained in:
Manfred Karrer 2015-11-16 15:20:50 +01:00
parent 8bf207b656
commit cb8761b74e
32 changed files with 178 additions and 117 deletions

View file

@ -21,7 +21,9 @@ public class PopupId {
// We don't use an enum because it would break updates if we add a new item in a new version
public static String SEC_DEPOSIT = "SEC_DEPOSIT";
public static String TRADE_WALLET = "TRADE_WALLET";
public static String TRADE_WALLET = "tradeWallet";
public static String SEND_PAYMENT_INFO = "sendPaymentInfo";
public static String PAYMENT_SENT = "paymentSent";
public static String PAYMENT_RECEIVED = "paymentReceived";
}

View file

@ -143,8 +143,10 @@ public class Preferences implements Serializable {
showTakeOfferConfirmation = true;
showAgainMap = new HashMap<>();
showAgainMap.put(PopupId.SEC_DEPOSIT, true);
showAgainMap.put(PopupId.TRADE_WALLET, true);
showAgainMap.put(PopupId.SEND_PAYMENT_INFO, true);
showAgainMap.put(PopupId.PAYMENT_SENT, true);
showAgainMap.put(PopupId.PAYMENT_RECEIVED, true);
storage.queueUpForSave();
}
@ -345,6 +347,10 @@ public class Preferences implements Serializable {
return showAgainMap;
}
public boolean showAgain(String key) {
return getShowAgainMap().containsKey(key) && getShowAgainMap().get(key);
}
public boolean getTacAccepted() {
return tacAccepted;
}

View file

@ -269,7 +269,11 @@ public class User implements Serializable {
}*/
public Arbitrator getAcceptedArbitratorByAddress(Address address) {
return acceptedArbitrators.stream().filter(e -> e.getArbitratorAddress().equals(address)).findFirst().get();
Optional<Arbitrator> arbitratorOptional = acceptedArbitrators.stream().filter(e -> e.getArbitratorAddress().equals(address)).findFirst();
if (arbitratorOptional.isPresent())
return arbitratorOptional.get();
else
return null;
}