Search in sources :

Example 1 with BookBuyUrlInfo

use of org.geometerplus.fbreader.network.urlInfo.BookBuyUrlInfo in project FBReaderJ by geometer.

the class BuyBooksActivity method calculateCost.

private Money calculateCost() {
    Money cost = Money.ZERO;
    for (NetworkBookItem b : myBooks) {
        if (b.getStatus(myBookCollection) != NetworkBookItem.Status.CanBePurchased) {
            continue;
        }
        final BookBuyUrlInfo info = b.buyInfo();
        if (info == null || info.Price == null) {
            return null;
        }
        cost = cost.add(info.Price);
    }
    return cost;
}
Also used : Money(org.geometerplus.zlibrary.core.money.Money) BookBuyUrlInfo(org.geometerplus.fbreader.network.urlInfo.BookBuyUrlInfo)

Aggregations

BookBuyUrlInfo (org.geometerplus.fbreader.network.urlInfo.BookBuyUrlInfo)1 Money (org.geometerplus.zlibrary.core.money.Money)1