mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 09:49:19 +02:00
fixed synchronization
This commit is contained in:
parent
70a58af8e7
commit
61f8b19ee4
5 changed files with 30 additions and 29 deletions
|
@ -1 +0,0 @@
|
||||||
* replace HtmlToString by android.text.Html
|
|
11
TODO.library
11
TODO.library
|
@ -1,16 +1,11 @@
|
||||||
0.99:
|
|
||||||
DONE Reload book info from file
|
|
||||||
DONE don't run several initialization threads in the same time
|
|
||||||
DONE lib.ololo.cc
|
|
||||||
|
|
||||||
After 0.99:
|
After 0.99:
|
||||||
* returning from footnotes (ask if footnote is in the same model and there was page scrolling)
|
DONE returning from footnotes (ask if footnote is in the same model and there was page scrolling)
|
||||||
* prevent from sleep if battery is in charging mode
|
* prevent from sleep if battery is in charging mode
|
||||||
* Open the help file if the current book is deleted from library
|
* Open the help file if the current book is deleted from library
|
||||||
* Partial loading from database
|
DONE Partial loading from database
|
||||||
* Database updating in backgorund
|
* Database updating in backgorund
|
||||||
* Watch filesystem after loading
|
* Watch filesystem after loading
|
||||||
* Show wait message during search
|
DONE Show wait message during search
|
||||||
* Reload book info for all the files
|
* Reload book info for all the files
|
||||||
* garbage in Boris Akunin, Сказки для идиотов
|
* garbage in Boris Akunin, Сказки для идиотов
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
* 'sign out' feature for basic-auth
|
* 'sign out' feature for basic-auth
|
||||||
* SSLCertificate processing
|
|
||||||
|
|
||||||
DONE show 'empty basket' message without opening of catalog
|
DONE show 'empty basket' message without opening of catalog
|
||||||
* update basket view if basket content is changed
|
* update basket view if basket content is changed
|
||||||
|
@ -14,14 +13,14 @@ DONE show recommendation item if basket is not empty
|
||||||
* separate search for each catalog (if search URL is presented)
|
* separate search for each catalog (if search URL is presented)
|
||||||
* menu search button should be available for all catalog levels
|
* menu search button should be available for all catalog levels
|
||||||
|
|
||||||
* float point numbers as series index
|
DONE float point numbers as series index
|
||||||
* replace AuthenticationCatalog by AuthenticationActivity
|
DONE replace AuthenticationCatalog by AuthenticationActivity
|
||||||
* 'recently visited catalogs' item
|
* 'recently visited catalogs' item
|
||||||
* load search URL for catalogs from these catalogs, not from our generic file
|
* load search URL for catalogs from these catalogs, not from our generic file
|
||||||
DONE show library name in network book activity
|
DONE show library name in network book activity
|
||||||
|
|
||||||
* litres: credit card top up
|
DONE litres: credit card top up
|
||||||
* litres: terminal (?) top up
|
* litres: self-service kiosk top up
|
||||||
DONE litres: similar books link
|
DONE litres: similar books link
|
||||||
|
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
|
@ -128,9 +128,9 @@ public class LibraryActivity extends BaseActivity implements MenuItem.OnMenuItem
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int returnCode, Intent intent) {
|
protected void onActivityResult(int requestCode, int returnCode, Intent intent) {
|
||||||
if (requestCode == BOOK_INFO_REQUEST) {
|
if (requestCode == BOOK_INFO_REQUEST) {
|
||||||
final String path = intent.getStringExtra(BookInfoActivity.CURRENT_BOOK_PATH_KEY);
|
//final String path = intent.getStringExtra(BookInfoActivity.CURRENT_BOOK_PATH_KEY);
|
||||||
final Book book = Book.getByFile(ZLFile.createFileByPath(path));
|
//final Book book = Book.getByFile(ZLFile.createFileByPath(path));
|
||||||
myLibrary.refreshBookInfo(book);
|
//myLibrary.refreshBookInfo(book);
|
||||||
getListView().invalidateViews();
|
getListView().invalidateViews();
|
||||||
} else {
|
} else {
|
||||||
super.onActivityResult(requestCode, returnCode, intent);
|
super.onActivityResult(requestCode, returnCode, intent);
|
||||||
|
|
|
@ -63,9 +63,11 @@ public class NetworkLibrary {
|
||||||
|
|
||||||
public List<String> languageCodes() {
|
public List<String> languageCodes() {
|
||||||
final TreeSet<String> languageSet = new TreeSet<String>();
|
final TreeSet<String> languageSet = new TreeSet<String>();
|
||||||
|
synchronized (myLinks) {
|
||||||
for (INetworkLink link : myLinks) {
|
for (INetworkLink link : myLinks) {
|
||||||
languageSet.add(link.getLanguage());
|
languageSet.add(link.getLanguage());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return new ArrayList<String>(languageSet);
|
return new ArrayList<String>(languageSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,12 +114,14 @@ public class NetworkLibrary {
|
||||||
private List<INetworkLink> activeLinks() {
|
private List<INetworkLink> activeLinks() {
|
||||||
final LinkedList<INetworkLink> filteredList = new LinkedList<INetworkLink>();
|
final LinkedList<INetworkLink> filteredList = new LinkedList<INetworkLink>();
|
||||||
final Collection<String> codes = activeLanguageCodes();
|
final Collection<String> codes = activeLanguageCodes();
|
||||||
|
synchronized (myLinks) {
|
||||||
for (INetworkLink link : myLinks) {
|
for (INetworkLink link : myLinks) {
|
||||||
if (link instanceof ICustomNetworkLink ||
|
if (link instanceof ICustomNetworkLink ||
|
||||||
codes.contains(link.getLanguage())) {
|
codes.contains(link.getLanguage())) {
|
||||||
filteredList.add(link);
|
filteredList.add(link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return filteredList;
|
return filteredList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,11 +162,13 @@ public class NetworkLibrary {
|
||||||
|
|
||||||
private void removeAllLoadedLinks() {
|
private void removeAllLoadedLinks() {
|
||||||
final LinkedList<INetworkLink> toRemove = new LinkedList<INetworkLink>();
|
final LinkedList<INetworkLink> toRemove = new LinkedList<INetworkLink>();
|
||||||
|
synchronized (myLinks) {
|
||||||
for (INetworkLink link : myLinks) {
|
for (INetworkLink link : myLinks) {
|
||||||
if (!(link instanceof ICustomNetworkLink)) {
|
if (!(link instanceof ICustomNetworkLink)) {
|
||||||
toRemove.add(link);
|
toRemove.add(link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
myLinks.removeAll(toRemove);
|
myLinks.removeAll(toRemove);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,11 +239,13 @@ public class NetworkLibrary {
|
||||||
|
|
||||||
public String rewriteUrl(String url, boolean externalUrl) {
|
public String rewriteUrl(String url, boolean externalUrl) {
|
||||||
final String host = ZLNetworkUtil.hostFromUrl(url).toLowerCase();
|
final String host = ZLNetworkUtil.hostFromUrl(url).toLowerCase();
|
||||||
|
synchronized (myLinks) {
|
||||||
for (INetworkLink link : myLinks) {
|
for (INetworkLink link : myLinks) {
|
||||||
if (host.contains(link.getSiteName())) {
|
if (host.contains(link.getSiteName())) {
|
||||||
url = link.rewriteUrl(url, externalUrl);
|
url = link.rewriteUrl(url, externalUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue