mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 19:42:17 +02:00
Merge branch 'topup' of github.com:geometer/FBReaderJ into topup
This commit is contained in:
commit
eb9c150b9e
20 changed files with 775 additions and 728 deletions
|
@ -1,3 +1,6 @@
|
|||
===== 1.1.11 (Sep ??, 2011) =====
|
||||
* Updated Italian localization
|
||||
|
||||
===== 1.1.10 (Aug 03, 2011) =====
|
||||
* Spanish localization (by Antonio Trueba)
|
||||
* Swipe distance for starting page scrolling is <= .5 inch for all devices
|
||||
|
|
|
@ -617,6 +617,7 @@
|
|||
<node name="signOut" value="Odhlašování. Čekejte..."/>
|
||||
<node name="purchaseBook" value="Nakupování knihy. Čekejte..."/>
|
||||
<node name="loadingCatalogInfo" value="Načítání informací o katalogu. Čekejte..."/>
|
||||
<node name="loadingNetworkBookInfo" value="Loading book information. Please, wait…" toBeTranslated="true" />
|
||||
<node name="updatingCatalogsList" value="Aktualizace seznamu katalogů. Čekejte..."/>
|
||||
</node>
|
||||
<node name="networkError">
|
||||
|
|
|
@ -602,6 +602,7 @@
|
|||
<node name="signOut" value="Buch wird ausgetragen. Bitte warten..."/>
|
||||
<node name="purchaseBook" value="Buch wird gekauft. Bitte warten..."/>
|
||||
<node name="loadingCatalogInfo" value="Kataloginformation wird geladen. Bitte warten..."/>
|
||||
<node name="loadingNetworkBookInfo" value="Loading book information. Please, wait…" toBeTranslated="true" />
|
||||
<node name="updatingCatalogsList" value="Katalogliste wird aktualisiert. Bitte warten..."/>
|
||||
</node>
|
||||
<node name="networkError">
|
||||
|
|
|
@ -617,6 +617,7 @@
|
|||
<node name="signOut" value="Signing out. Please, wait…" />
|
||||
<node name="purchaseBook" value="Purchase book. Please, wait…" />
|
||||
<node name="loadingCatalogInfo" value="Loading catalog information. Please, wait…" />
|
||||
<node name="loadingNetworkBookInfo" value="Loading book information. Please, wait…" />
|
||||
<node name="updatingCatalogsList" value="Updating catalogs list. Please, wait…"/>
|
||||
</node>
|
||||
<node name="networkError">
|
||||
|
|
|
@ -604,6 +604,7 @@
|
|||
<node name="signOut" value="Registrando. Espere..." />
|
||||
<node name="purchaseBook" value="Comprando el libro. Espere..." />
|
||||
<node name="loadingCatalogInfo" value="Cargando la información del catálogo. Espere..." />
|
||||
<node name="loadingNetworkBookInfo" value="Loading book information. Please, wait…" toBeTranslated="true" />
|
||||
<node name="updatingCatalogsList" value="Actualizando la lista de catálogos. Espere..."/>
|
||||
</node>
|
||||
<node name="networkError">
|
||||
|
|
|
@ -599,6 +599,7 @@
|
|||
<node name="signOut" value="Déconnexion en cours, veuillez patienter..." />
|
||||
<node name="purchaseBook" value="Achat du livre. Veuillez patienter..."/>
|
||||
<node name="loadingCatalogInfo" value="Chargement du catalogue, veuillez patienter..." />
|
||||
<node name="loadingNetworkBookInfo" value="Loading book information. Please, wait…" toBeTranslated="true" />
|
||||
<node name="updatingCatalogsList" value="Mise à jour de la liste, veuillez patentier..."/>
|
||||
</node>
|
||||
<node name="networkError">
|
||||
|
|
|
@ -599,6 +599,7 @@
|
|||
<node name="signOut" value="Rexistrando. Agarde..." />
|
||||
<node name="purchaseBook" value="Comprando libro. Agarde..." />
|
||||
<node name="loadingCatalogInfo" value="Cargando a información do catálogo. Agarde..." />
|
||||
<node name="loadingNetworkBookInfo" value="Loading book information. Please, wait…" toBeTranslated="true" />
|
||||
<node name="updatingCatalogsList" value="Actualizando a lista de catálogos. Agarde..."/>
|
||||
</node>
|
||||
<node name="networkError">
|
||||
|
|
|
@ -599,6 +599,7 @@
|
|||
<node name="signOut" value="Kijelentkezés. Egy kis türelmet..." />
|
||||
<node name="purchaseBook" value="Könyv vásárlása. Egy kis türelmet..." />
|
||||
<node name="loadingCatalogInfo" value="Katalógus információ letöltése. Egy kis türelmet..." />
|
||||
<node name="loadingNetworkBookInfo" value="Loading book information. Please, wait…" toBeTranslated="true" />
|
||||
<node name="updatingCatalogsList" value="Katalógus listák frissítése. Egy kis türelmet..."/>
|
||||
</node>
|
||||
<node name="networkError">
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -599,6 +599,7 @@
|
|||
<node name="signOut" value="Afmelden. Een ogenblik..." />
|
||||
<node name="purchaseBook" value="Boek wordt gekocht. Een ogenblik..." />
|
||||
<node name="loadingCatalogInfo" value="Catalogusinformati wordt geladen. Een ogenblik..." />
|
||||
<node name="loadingNetworkBookInfo" value="Loading book information. Please, wait…" toBeTranslated="true" />
|
||||
<node name="updatingCatalogsList" value="Cataloguslijst wordt bijgewerkt. Een ogenblik..."/>
|
||||
</node>
|
||||
<node name="networkError">
|
||||
|
|
|
@ -607,6 +607,7 @@
|
|||
<node name="signOut" value="Выход из системы. Подождите, пожалуйста..." />
|
||||
<node name="purchaseBook" value="Идет покупка книги. Подождите, пожалуйста..." />
|
||||
<node name="loadingCatalogInfo" value="Загрузка информации из каталога. Подождите, пожалуйста..." />
|
||||
<node name="loadingNetworkBookInfo" value="Загрузка информации о книге. Подождите, пожалуйста..." />
|
||||
<node name="updatingCatalogsList" value="Обновляется список каталогов. Подождите, пожалуйста..."/>
|
||||
</node>
|
||||
<node name="networkError">
|
||||
|
|
|
@ -599,6 +599,7 @@
|
|||
<node name="signOut" value="กำลังออกจากระบบ, กรุณารอสักครู่..."/>
|
||||
<node name="purchaseBook" value="กำลังซื้อหนังสือ, กรุณารอสักครู่..."/>
|
||||
<node name="loadingCatalogInfo" value="กำลังดาวน์โหลข้อมูลของแคตตาล็อก, กรุณารอสักครู่..."/>
|
||||
<node name="loadingNetworkBookInfo" value="Loading book information. Please, wait…" toBeTranslated="true" />
|
||||
<node name="updatingCatalogsList" value="กำลังอัพเดตรายการแคตตาล็อก, กรุณารอสักครู่..." />
|
||||
</node>
|
||||
<node name="networkError">
|
||||
|
|
|
@ -599,6 +599,7 @@
|
|||
<node name="signOut" value="Вихід із системи. Зачекайте, будь ласка..." />
|
||||
<node name="purchaseBook" value="Йде придбання книги. Зачекайте, будь ласка..." />
|
||||
<node name="loadingCatalogInfo" value="Завантаження інформації з каталогу. Зачекайте, будь ласка..." />
|
||||
<node name="loadingNetworkBookInfo" value="Loading book information. Please, wait…" toBeTranslated="true" />
|
||||
<node name="updatingCatalogsList" value="Оновлюється список каталогів. Зачекайте, будь ласка..."/>
|
||||
</node>
|
||||
<node name="networkError">
|
||||
|
|
|
@ -599,6 +599,7 @@
|
|||
<node name="signOut" value="Đang thoát. Xin chờ..." />
|
||||
<node name="purchaseBook" value="Mua sách. Xin chờ..." />
|
||||
<node name="loadingCatalogInfo" value="Loading catalog information. Please, wait..." />
|
||||
<node name="loadingNetworkBookInfo" value="Loading book information. Please, wait…" toBeTranslated="true" />
|
||||
<node name="updatingCatalogsList" value="Updating catalogs list. Please, wait..."/>
|
||||
</node>
|
||||
<node name="networkError">
|
||||
|
|
|
@ -599,6 +599,7 @@
|
|||
<node name="signOut" value="退出. 正在处理,请稍等..." />
|
||||
<node name="purchaseBook" value="书籍购买中. 请等待..." />
|
||||
<node name="loadingCatalogInfo" value="加载书库目录信息中,请稍待..." />
|
||||
<node name="loadingNetworkBookInfo" value="Loading book information. Please, wait…" toBeTranslated="true" />
|
||||
<node name="updatingCatalogsList" value="更新书库目录列表中,请稍待..."/>
|
||||
</node>
|
||||
<node name="networkError">
|
||||
|
|
|
@ -618,6 +618,7 @@
|
|||
<node name="signOut" value="登出中,請稍候..." />
|
||||
<node name="purchaseBook" value="正購買書藉,請稍候..." />
|
||||
<node name="loadingCatalogInfo" value="讀取目錄內容中,請稍候..." />
|
||||
<node name="loadingNetworkBookInfo" value="Loading book information. Please, wait…" toBeTranslated="true" />
|
||||
<node name="updatingCatalogsList" value="更新目錄列表中,請稍倣..."/>
|
||||
</node>
|
||||
<node name="networkError">
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
android:layout_weight="1"
|
||||
android:maxLines="2"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
<Button
|
||||
android:id="@+id/network_book_button3"
|
||||
|
@ -27,6 +28,7 @@
|
|||
android:layout_weight="1"
|
||||
android:maxLines="2"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
|
@ -53,6 +55,7 @@
|
|||
android:layout_weight="1"
|
||||
android:maxLines="2"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
<Button
|
||||
android:id="@+id/network_book_button1"
|
||||
|
@ -60,6 +63,7 @@
|
|||
android:layout_weight="1"
|
||||
android:maxLines="2"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
<LinearLayout
|
||||
android:id="@+id/network_book_right_spacer"
|
||||
|
|
|
@ -52,6 +52,8 @@ import org.geometerplus.fbreader.network.opds.OPDSBookItem;
|
|||
import org.geometerplus.android.fbreader.network.action.OpenCatalogAction;
|
||||
import org.geometerplus.android.fbreader.network.action.NetworkBookActions;
|
||||
|
||||
import org.geometerplus.android.util.UIUtil;
|
||||
|
||||
public class NetworkBookInfoActivity extends Activity implements NetworkLibrary.ChangeListener {
|
||||
private NetworkBookItem myBook;
|
||||
private View myMainView;
|
||||
|
@ -74,55 +76,64 @@ public class NetworkBookInfoActivity extends Activity implements NetworkLibrary.
|
|||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
final NetworkLibrary library = NetworkLibrary.Instance();
|
||||
if (!library.isInitialized()) {
|
||||
// TODO: waiting message
|
||||
try {
|
||||
if (SQLiteNetworkDatabase.Instance() == null) {
|
||||
new SQLiteNetworkDatabase();
|
||||
UIUtil.wait("loadingBookInfo", myInitializer, this);
|
||||
}
|
||||
|
||||
private final Runnable myInitializer = new Runnable() {
|
||||
public void run() {
|
||||
final NetworkLibrary library = NetworkLibrary.Instance();
|
||||
if (!library.isInitialized()) {
|
||||
try {
|
||||
if (SQLiteNetworkDatabase.Instance() == null) {
|
||||
new SQLiteNetworkDatabase();
|
||||
}
|
||||
library.initialize();
|
||||
} catch (ZLNetworkException e) {
|
||||
// ignore
|
||||
}
|
||||
library.initialize();
|
||||
} catch (ZLNetworkException e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
if (myBook == null) {
|
||||
final Uri url = getIntent().getData();
|
||||
if (url != null && "litres-book".equals(url.getScheme())) {
|
||||
myBook = OPDSBookItem.create(
|
||||
NetworkLibrary.Instance().getLinkBySiteName("litres.ru"),
|
||||
url.toString().replace("litres-book://", "http://")
|
||||
);
|
||||
} else {
|
||||
final NetworkTree tree = Util.getTreeFromIntent(getIntent());
|
||||
if (tree instanceof NetworkBookTree) {
|
||||
myBook = ((NetworkBookTree)tree).Book;
|
||||
}
|
||||
}
|
||||
|
||||
runOnUiThread(myViewInitializer);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (myBook == null) {
|
||||
final Uri url = getIntent().getData();
|
||||
if (url != null && "litres-book".equals(url.getScheme())) {
|
||||
// TODO: waiting message
|
||||
myBook = OPDSBookItem.create(
|
||||
NetworkLibrary.Instance().getLinkBySiteName("litres.ru"),
|
||||
url.toString().replace("litres-book://", "http://")
|
||||
);
|
||||
} else {
|
||||
final NetworkTree tree = Util.getTreeFromIntent(getIntent());
|
||||
if (tree instanceof NetworkBookTree) {
|
||||
myBook = ((NetworkBookTree)tree).Book;
|
||||
}
|
||||
}
|
||||
|
||||
private final Runnable myViewInitializer = new Runnable() {
|
||||
public void run() {
|
||||
if (myBook == null) {
|
||||
finish();
|
||||
return;
|
||||
} else {
|
||||
myConnection = new BookDownloaderServiceConnection();
|
||||
bindService(
|
||||
new Intent(getApplicationContext(), BookDownloaderService.class),
|
||||
myConnection,
|
||||
BIND_AUTO_CREATE
|
||||
);
|
||||
|
||||
setTitle(myBook.Title);
|
||||
|
||||
setupDescription();
|
||||
setupExtraLinks();
|
||||
setupInfo();
|
||||
setupCover();
|
||||
setupButtons();
|
||||
}
|
||||
|
||||
myConnection = new BookDownloaderServiceConnection();
|
||||
bindService(
|
||||
new Intent(getApplicationContext(), BookDownloaderService.class),
|
||||
myConnection,
|
||||
BIND_AUTO_CREATE
|
||||
);
|
||||
|
||||
setTitle(myBook.Title);
|
||||
|
||||
setupDescription();
|
||||
setupExtraLinks();
|
||||
setupInfo();
|
||||
setupCover();
|
||||
setupButtons();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
View getMainView() {
|
||||
return myMainView;
|
||||
|
|
|
@ -158,7 +158,14 @@ public abstract class AbstractNetworkLink implements INetworkLink, Basket {
|
|||
|
||||
// method from Basket interface
|
||||
public final Money cost() {
|
||||
return Money.ZERO;
|
||||
Money sum = Money.ZERO;
|
||||
for (NetworkBookItem b : books()) {
|
||||
final BookBuyUrlInfo info = b.buyInfo();
|
||||
if (info != null) {
|
||||
sum = sum.add(info.Price);
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
public NetworkOperationData createOperationData(NetworkOperationData.OnNewItemListener listener) {
|
||||
|
|
|
@ -22,6 +22,7 @@ package org.geometerplus.fbreader.network.opds;
|
|||
import org.geometerplus.zlibrary.core.util.ZLNetworkUtil;
|
||||
|
||||
import org.geometerplus.fbreader.network.NetworkLibrary;
|
||||
import org.geometerplus.fbreader.network.Basket;
|
||||
import org.geometerplus.fbreader.network.urlInfo.UrlInfo;
|
||||
import org.geometerplus.fbreader.network.urlInfo.UrlInfoCollection;
|
||||
|
||||
|
@ -40,12 +41,17 @@ public class BasketItem extends OPDSCatalogItem {
|
|||
|
||||
@Override
|
||||
public CharSequence getSummary() {
|
||||
final int size = Link.basket().bookIds().size();
|
||||
final Basket basket = Link.basket();
|
||||
final int size = basket.bookIds().size();
|
||||
if (size == 0) {
|
||||
return super.getSummary();
|
||||
} else if (size == basket.books().size()) {
|
||||
return NetworkLibrary.resource().getResource("basketSummary").getValue()
|
||||
.replace("%0", String.valueOf(size)).replace("%1", basket.cost().toString());
|
||||
} else {
|
||||
return NetworkLibrary.resource().getResource("basketSummaryCountOnly").getValue()
|
||||
.replace("%0", String.valueOf(size));
|
||||
}
|
||||
return NetworkLibrary.resource().getResource("basketSummary").getValue()
|
||||
.replace("%0", String.valueOf(size)).replace("%1", "XXX");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue