mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 19:42:17 +02:00
updated TODOs; better ColorDict integration
This commit is contained in:
parent
41a5751a14
commit
2845087bd0
25 changed files with 136 additions and 88 deletions
|
@ -1 +1,2 @@
|
|||
* (?) Показывать названия шрифтов соответсвующими шрифтами
|
||||
After 0.99:
|
||||
* Показывать названия шрифтов соответсвующими шрифтами
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
0.99:
|
||||
|
||||
* 'Reload' button action
|
||||
DONE apply changes from edit activity when info activity is visible again
|
||||
* apply changes from edit activity when library activity is visible again
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
After 0.99:
|
||||
* цвет в preference view
|
||||
|
||||
* preview текста в настройках цветов (и не только)
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
0.99:
|
||||
* Run 'install ColorDict' dialog
|
||||
* Synchronize resources
|
||||
DONE Run 'install ColorDict' dialog
|
||||
DONE Synchronize resources
|
||||
* Other dictionary (? if there is no way to download dictionary files for ColorDict)
|
||||
|
||||
After 0.99:
|
||||
* More convenient mode changing
|
||||
* Installation from the site if AM is not available
|
||||
* Integration with other dictionaries
|
||||
|
|
27
TODO.library
27
TODO.library
|
@ -1,26 +1,13 @@
|
|||
0.99:
|
||||
* Reload book info from file
|
||||
* returning from footnotes
|
||||
* prevent from sleep if battery is in charging mode
|
||||
* Open the help file if the current book is deleted from library
|
||||
|
||||
After 0.99:
|
||||
* Partial loading from database
|
||||
* Database updating in backgorund
|
||||
* Watch filesystem after loading
|
||||
DONE Covers loading in background
|
||||
DONE Wait messages
|
||||
DONE Favorites
|
||||
DONE Show text if the favorites list is empty
|
||||
DONE Search
|
||||
* Show wait message during search
|
||||
DONE File manager
|
||||
DONE Activity caption
|
||||
DONE Book deleting
|
||||
DONE Show book info activity instead of immediate opening/menu
|
||||
DONE Main menu
|
||||
DONE Context menu
|
||||
* Reload book info from file
|
||||
* Reload book info for all the files
|
||||
DONE Highlight current book
|
||||
DONE Bug: search with no results clears search results subtree; should not
|
||||
* garbage in Boris Akunin, Сказки для идиотов
|
||||
DONE duplicate tags in the same book
|
||||
DONE Bug: b1.zip (paths in zips?)
|
||||
DONE Bug: b1.zip, archive inside archive
|
||||
* Open the help file if the current book is deleted from library
|
||||
* returning from footnotes
|
||||
* prevent from sleep if battery is in charging mode
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
LITRES:
|
||||
|
||||
0.99:
|
||||
|
||||
DONE Тестирование наличия функций без запуска тестовой Actvity
|
||||
* Авторегистрация
|
||||
* Пополнение счета через sms
|
||||
* Автопокупка
|
||||
|
@ -15,6 +14,7 @@ LITRES:
|
|||
* что делать, если оттуда нельзя поставить, потому что запрещена установка из "Unknown sources"?
|
||||
* как дать возможность ставить из других магазинов?
|
||||
* plugin для TTS
|
||||
* заполнить все поля для плагина в маркете
|
||||
|
||||
After 0.99:
|
||||
* 'My Basket' item
|
||||
|
|
|
@ -204,6 +204,10 @@
|
|||
<node name="updatePlugin">
|
||||
<node name="title" value="Update plugin" toBeTranslated="true" />
|
||||
</node>
|
||||
<node name="installDictionary">
|
||||
<node name="title" value="Install dictionary" toBeTranslated="true" />
|
||||
<node name="message" value="Would you like to install %s?" toBeTranslated="true" />
|
||||
</node>
|
||||
<node name="BookInfo">
|
||||
<node name="fileName" value="Název souboru"/>
|
||||
<node name="title" value="Název"/>
|
||||
|
@ -555,10 +559,12 @@
|
|||
</node>
|
||||
</node>
|
||||
<node name="errorMessage">
|
||||
<node name="cannotRunAndroidMarket" value="Cannot access Android Market. Please, install %s manually" toBeTranslated="true"/>
|
||||
<node name="textNotFound" value="V knize není bohužel žádný vhodný text"/>
|
||||
<node name="bookNotFound" value="V knihovně nejsou bohužel žádné vhodné knihy"/>
|
||||
<node name="bookmarkNotFound" value="Nejsou bohužel žádné vhodné záložky"/>
|
||||
<node name="cannotOpenBook" value="Tuto knihu právě teď nelze bohužel otevřít"/>
|
||||
<node name="dictionaryIsNotInstalled" value="Dictionary is not installed, sorry" toBeTranslated="true"/>
|
||||
<node name="permissionDenied" value="Oprávnění bylo bohužel odmítnuto"/>
|
||||
<node name="noFavorites" value="Seznam oblíbených je bohužel prázdný"/>
|
||||
</node>
|
||||
|
|
|
@ -205,6 +205,10 @@
|
|||
<node name="updatePlugin">
|
||||
<node name="title" value="Update plugin" toBeTranslated="true" />
|
||||
</node>
|
||||
<node name="installDictionary">
|
||||
<node name="title" value="Install dictionary" toBeTranslated="true" />
|
||||
<node name="message" value="Would you like to install %s?" toBeTranslated="true" />
|
||||
</node>
|
||||
<node name="BookInfo">
|
||||
<node name="fileName" value="Dateiname"/>
|
||||
<node name="title" value="Titel"/>
|
||||
|
@ -556,10 +560,12 @@
|
|||
</node>
|
||||
</node>
|
||||
<node name="errorMessage">
|
||||
<node name="cannotRunAndroidMarket" value="Cannot access Android Market. Please, install %s manually" toBeTranslated="true"/>
|
||||
<node name="textNotFound" value="Es wurde kein passender Text im Buch gefunden."/>
|
||||
<node name="bookNotFound" value="Es wurden keine passenden Bücher in der Bibliothek gefunden."/>
|
||||
<node name="bookmarkNotFound" value="Es wurden kein passenden Lesezeichen gefunden."/>
|
||||
<node name="cannotOpenBook" value="Das Buch kann zurzeit nicht geöffnet werden."/>
|
||||
<node name="dictionaryIsNotInstalled" value="Dictionary is not installed, sorry" toBeTranslated="true"/>
|
||||
<node name="permissionDenied" value="Permission denied, sorry" toBeTranslated="true"/>
|
||||
<node name="noFavorites" value="Your favorites list is empty, sorry" toBeTranslated="true"/>
|
||||
</node>
|
||||
|
|
|
@ -203,6 +203,10 @@
|
|||
<node name="updatePlugin">
|
||||
<node name="title" value="Update plugin"/>
|
||||
</node>
|
||||
<node name="installDictionary">
|
||||
<node name="title" value="Install dictionary"/>
|
||||
<node name="message" value="Would you like to install %s?"/>
|
||||
</node>
|
||||
<node name="BookInfo">
|
||||
<node name="fileName" value="File name"/>
|
||||
<node name="title" value="Title"/>
|
||||
|
@ -554,11 +558,12 @@
|
|||
</node>
|
||||
</node>
|
||||
<node name="errorMessage">
|
||||
<node name="cannotRunAndroidMarket" value="Cannot access Android Market. Please, install %s manually"/>
|
||||
<node name="textNotFound" value="There is no suitable text in the book, sorry"/>
|
||||
<node name="bookNotFound" value="There are no suitable books in the library, sorry"/>
|
||||
<node name="bookmarkNotFound" value="There are no suitable bookmarks, sorry"/>
|
||||
<node name="cannotOpenBook" value="Cannot open this book at the moment, sorry"/>
|
||||
<node name="dictNotInstalled" value="Supported dictionary is not installed, sorry"/>
|
||||
<node name="dictionaryIsNotInstalled" value="Dictionary is not installed, sorry"/>
|
||||
<node name="permissionDenied" value="Permission denied, sorry"/>
|
||||
<node name="noFavorites" value="Your favorites list is empty, sorry"/>
|
||||
</node>
|
||||
|
|
|
@ -207,6 +207,10 @@
|
|||
<node name="updatePlugin">
|
||||
<node name="title" value="Update plugin" toBeTranslated="true" />
|
||||
</node>
|
||||
<node name="installDictionary">
|
||||
<node name="title" value="Install dictionary" toBeTranslated="true" />
|
||||
<node name="message" value="Would you like to install %s?" toBeTranslated="true" />
|
||||
</node>
|
||||
<node name="BookInfo">
|
||||
<node name="fileName" value="Nom du fichier"/>
|
||||
<node name="title" value="Titre"/>
|
||||
|
@ -564,10 +568,12 @@
|
|||
</node>
|
||||
</node>
|
||||
<node name="errorMessage">
|
||||
<node name="cannotRunAndroidMarket" value="Cannot access Android Market. Please, install %s manually" toBeTranslated="true"/>
|
||||
<node name="textNotFound" value="Aucune occurence dans le livre"/>
|
||||
<node name="bookNotFound" value="Aucun livre correspondant dans la bibliothèque"/>
|
||||
<node name="bookmarkNotFound" value="Aucun marque-page correspondant"/>
|
||||
<node name="cannotOpenBook" value="Impossible d'ouvrir le livre"/>
|
||||
<node name="dictionaryIsNotInstalled" value="Dictionary is not installed, sorry" toBeTranslated="true"/>
|
||||
<node name="permissionDenied" value="Permission denied, sorry" toBeTranslated="true"/>
|
||||
<node name="noFavorites" value="Your favorites list is empty, sorry" toBeTranslated="true"/>
|
||||
</node>
|
||||
|
|
|
@ -204,6 +204,10 @@
|
|||
<node name="updatePlugin">
|
||||
<node name="title" value="Update plugin" toBeTranslated="true" />
|
||||
</node>
|
||||
<node name="installDictionary">
|
||||
<node name="title" value="Install dictionary" toBeTranslated="true" />
|
||||
<node name="message" value="Would you like to install %s?" toBeTranslated="true" />
|
||||
</node>
|
||||
<node name="BookInfo">
|
||||
<node name="fileName" value="Fájlnév"/>
|
||||
<node name="title" value="Cím"/>
|
||||
|
@ -555,10 +559,12 @@
|
|||
</node>
|
||||
</node>
|
||||
<node name="errorMessage">
|
||||
<node name="cannotRunAndroidMarket" value="Cannot access Android Market. Please, install %s manually" toBeTranslated="true"/>
|
||||
<node name="textNotFound" value="A keresett szöveg sajnos nem található a könyvben"/>
|
||||
<node name="bookNotFound" value="A keresett könyv sajnos nem található meg a könyvtárban"/>
|
||||
<node name="bookmarkNotFound" value="Sajnos nem találhatóak könyvjelzők"/>
|
||||
<node name="cannotOpenBook" value="A könyv sajnos jelenleg nem nyitható meg"/>
|
||||
<node name="dictionaryIsNotInstalled" value="Dictionary is not installed, sorry" toBeTranslated="true"/>
|
||||
<node name="permissionDenied" value="Permission denied, sorry" toBeTranslated="true"/>
|
||||
<node name="noFavorites" value="Your favorites list is empty, sorry" toBeTranslated="true"/>
|
||||
</node>
|
||||
|
|
|
@ -204,6 +204,10 @@
|
|||
<node name="updatePlugin">
|
||||
<node name="title" value="Update plugin" toBeTranslated="true" />
|
||||
</node>
|
||||
<node name="installDictionary">
|
||||
<node name="title" value="Install dictionary" toBeTranslated="true" />
|
||||
<node name="message" value="Would you like to install %s?" toBeTranslated="true" />
|
||||
</node>
|
||||
<node name="BookInfo">
|
||||
<node name="fileName" value="Nome file"/>
|
||||
<node name="title" value="Titolo"/>
|
||||
|
@ -555,10 +559,12 @@
|
|||
</node>
|
||||
</node>
|
||||
<node name="errorMessage">
|
||||
<node name="cannotRunAndroidMarket" value="Cannot access Android Market. Please, install %s manually" toBeTranslated="true"/>
|
||||
<node name="textNotFound" value="Spiacente, non c'è un testo adatto all'interno del libro"/>
|
||||
<node name="bookNotFound" value="Spiacente, non ci sono libri adatti nella libreria"/>
|
||||
<node name="bookmarkNotFound" value="Spiacente, non ci sono segnalibri adatti"/>
|
||||
<node name="cannotOpenBook" value="Spiacente, non è possibile aprire il libro in questo momento"/>
|
||||
<node name="dictionaryIsNotInstalled" value="Dictionary is not installed, sorry" toBeTranslated="true"/>
|
||||
<node name="permissionDenied" value="Permission denied, sorry" toBeTranslated="true"/>
|
||||
<node name="noFavorites" value="Your favorites list is empty, sorry" toBeTranslated="true"/>
|
||||
</node>
|
||||
|
|
|
@ -203,6 +203,10 @@
|
|||
<node name="updatePlugin">
|
||||
<node name="title" value="Новая версия"/>
|
||||
</node>
|
||||
<node name="installDictionary">
|
||||
<node name="title" value="Установка словаря"/>
|
||||
<node name="message" value="Установить %s?"/>
|
||||
</node>
|
||||
<node name="BookInfo">
|
||||
<node name="fileName" value="Файл"/>
|
||||
<node name="title" value="Название"/>
|
||||
|
@ -554,11 +558,12 @@
|
|||
</node>
|
||||
</node>
|
||||
<node name="errorMessage">
|
||||
<node name="cannotRunAndroidMarket" value="Не удается запустить Android Market. Попробуйте установить %s вручную"/>
|
||||
<node name="textNotFound" value="В этой книге нет такого текста"/>
|
||||
<node name="bookNotFound" value="Нет подходящих книг"/>
|
||||
<node name="bookmarkNotFound" value="Нет подходящих закладок"/>
|
||||
<node name="cannotOpenBook" value="Не удается открыть книгу"/>
|
||||
<node name="dictNotInstalled" value="Не установлен поддерживаемый словарь"/>
|
||||
<node name="dictionaryIsNotInstalled" value="Не удалось запустить словарь"/>
|
||||
<node name="permissionDenied" value="Нет доступа к файлам" />
|
||||
<node name="noFavorites" value="Вы пока не добавили ни одной книги в «Избранное»"/>
|
||||
</node>
|
||||
|
|
|
@ -204,6 +204,10 @@
|
|||
<node name="updatePlugin">
|
||||
<node name="title" value="Update plugin" toBeTranslated="true" />
|
||||
</node>
|
||||
<node name="installDictionary">
|
||||
<node name="title" value="Install dictionary" toBeTranslated="true" />
|
||||
<node name="message" value="Would you like to install %s?" toBeTranslated="true" />
|
||||
</node>
|
||||
<node name="BookInfo">
|
||||
<node name="fileName" value="Файл"/>
|
||||
<node name="title" value="Назва"/>
|
||||
|
@ -555,10 +559,12 @@
|
|||
</node>
|
||||
</node>
|
||||
<node name="errorMessage">
|
||||
<node name="cannotRunAndroidMarket" value="Cannot access Android Market. Please, install %s manually" toBeTranslated="true"/>
|
||||
<node name="textNotFound" value="У цій книзі нема такого тексту"/>
|
||||
<node name="bookNotFound" value="Немає відповідних книг"/>
|
||||
<node name="bookmarkNotFound" value="Нема відповідних закладок"/>
|
||||
<node name="cannotOpenBook" value="Невдається відкрити книгу"/>
|
||||
<node name="dictionaryIsNotInstalled" value="Dictionary is not installed, sorry" toBeTranslated="true"/>
|
||||
<node name="permissionDenied" value="Permission denied, sorry" toBeTranslated="true"/>
|
||||
<node name="noFavorites" value="Your favorites list is empty, sorry" toBeTranslated="true"/>
|
||||
</node>
|
||||
|
|
|
@ -204,6 +204,10 @@
|
|||
<node name="updatePlugin">
|
||||
<node name="title" value="Update plugin" toBeTranslated="true" />
|
||||
</node>
|
||||
<node name="installDictionary">
|
||||
<node name="title" value="Install dictionary" toBeTranslated="true" />
|
||||
<node name="message" value="Would you like to install %s?" toBeTranslated="true" />
|
||||
</node>
|
||||
<node name="BookInfo">
|
||||
<node name="fileName" value="Tên tập tin"/>
|
||||
<node name="title" value="Tiêu đề"/>
|
||||
|
@ -555,10 +559,12 @@
|
|||
</node>
|
||||
</node>
|
||||
<node name="errorMessage">
|
||||
<node name="cannotRunAndroidMarket" value="Cannot access Android Market. Please, install %s manually" toBeTranslated="true"/>
|
||||
<node name="textNotFound" value="Xin lỗi, không có từ thích hợp"/>
|
||||
<node name="bookNotFound" value="Xin lỗi, không có quyển nào thích hợp trong thư viện"/>
|
||||
<node name="bookmarkNotFound" value="Xin lỗi, không có đánh dấu thích hợp"/>
|
||||
<node name="cannotOpenBook" value="Xin lỗi, không thể mở sách vào lúc này"/>
|
||||
<node name="dictionaryIsNotInstalled" value="Dictionary is not installed, sorry" toBeTranslated="true"/>
|
||||
<node name="permissionDenied" value="Permission denied, sorry" toBeTranslated="true"/>
|
||||
<node name="noFavorites" value="Your favorites list is empty, sorry" toBeTranslated="true"/>
|
||||
</node>
|
||||
|
|
|
@ -204,8 +204,9 @@
|
|||
<node name="updatePlugin">
|
||||
<node name="title" value="Update plugin" toBeTranslated="true" />
|
||||
</node>
|
||||
<node name="updatePlugin">
|
||||
<node name="title" value="Update plugin" toBeTranslated="true" />
|
||||
<node name="installDictionary">
|
||||
<node name="title" value="Install dictionary" toBeTranslated="true" />
|
||||
<node name="message" value="Would you like to install %s?" toBeTranslated="true" />
|
||||
</node>
|
||||
<node name="BookInfo">
|
||||
<node name="fileName" value="文件" />
|
||||
|
@ -564,10 +565,12 @@
|
|||
</node>
|
||||
</node>
|
||||
<node name="errorMessage">
|
||||
<node name="cannotRunAndroidMarket" value="Cannot access Android Market. Please, install %s manually" toBeTranslated="true"/>
|
||||
<node name="textNotFound" value="对不起,本书中找不到对应内容" />
|
||||
<node name="bookNotFound" value="对不起,书库中找不到需要的书籍" />
|
||||
<node name="bookmarkNotFound" value="对不起,找不到对应的书签" />
|
||||
<node name="cannotOpenBook" value="对不起,无法开启本书" />
|
||||
<node name="dictionaryIsNotInstalled" value="Dictionary is not installed, sorry" toBeTranslated="true"/>
|
||||
<node name="permissionDenied" value="对不起,没有权限"/>
|
||||
<node name="noFavorites" value="对不起,你的收藏列表为空"/>
|
||||
</node>
|
||||
|
|
|
@ -14,16 +14,6 @@
|
|||
<data android:scheme="http" android:host="data.fbreader.org" android:path="/packages/org.geometerplus.fbreader.plugin.network.litres.apk" />
|
||||
<data android:scheme="http" android:host="data.fbreader.org" android:path="/packages/org.geometerplus.fbreader.plugin.network.litres.apk_1" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<action android:name="android.fbreader.action.NETWORK_LIBRARY_REGISTER_TEST" />
|
||||
<data android:scheme="https" android:host="robot.litres.ru" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<action android:name="android.fbreader.action.NETWORK_LIBRARY_SMS_REFILLING_TEST" />
|
||||
<data android:scheme="http" android:host="data.fbreader.org" android:path="/catalogs/litres/index.php"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".UserRegistrationActivity" android:configChanges="orientation|keyboardHidden" android:theme="@android:style/Theme.Dialog">
|
||||
<intent-filter>
|
||||
|
@ -32,5 +22,12 @@
|
|||
<data android:scheme="https" android:host="robot.litres.ru" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".SmsRefillingActivity" android:configChanges="orientation|keyboardHidden" android:theme="@android:style/Theme.Dialog">
|
||||
<intent-filter>
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<action android:name="android.fbreader.action.NETWORK_LIBRARY_SMS_REFILLING" />
|
||||
<data android:scheme="http" android:host="data.fbreader.org" android:path="/catalogs/litres/index.php"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
|
|
|
@ -36,6 +36,7 @@ import org.geometerplus.zlibrary.core.view.ZLView;
|
|||
import org.geometerplus.zlibrary.text.view.ZLTextFixedPosition;
|
||||
import org.geometerplus.zlibrary.text.view.ZLTextPosition;
|
||||
import org.geometerplus.zlibrary.text.view.ZLTextView;
|
||||
import org.geometerplus.zlibrary.text.view.ZLTextViewMode;
|
||||
import org.geometerplus.zlibrary.ui.android.R;
|
||||
import org.geometerplus.zlibrary.ui.android.library.ZLAndroidActivity;
|
||||
import org.geometerplus.zlibrary.ui.android.library.ZLAndroidApplication;
|
||||
|
@ -135,6 +136,8 @@ public final class FBReader extends ZLAndroidActivity {
|
|||
fbReader.addAction(ActionCode.SEARCH, new SearchAction(this, fbReader));
|
||||
|
||||
fbReader.addAction(ActionCode.PROCESS_HYPERLINK, new ProcessHyperlinkAction(this, fbReader));
|
||||
fbReader.addAction(ActionCode.SET_TEXT_VIEW_MODE_VISIT_HYPERLINKS, new SwitchTextViewModeAction(this, fbReader, ZLTextViewMode.MODE_VISIT_HYPERLINKS));
|
||||
fbReader.addAction(ActionCode.SET_TEXT_VIEW_MODE_VISIT_ALL_WORDS, new SwitchTextViewModeAction(this, fbReader, ZLTextViewMode.MODE_VISIT_ALL_WORDS));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -19,9 +19,7 @@
|
|||
|
||||
package org.geometerplus.android.fbreader;
|
||||
|
||||
import android.app.SearchManager;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.widget.Toast;
|
||||
|
@ -78,18 +76,13 @@ class ProcessHyperlinkAction extends FBAction {
|
|||
if (start == end) {
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent(Intent.ACTION_SEARCH);
|
||||
intent.setComponent(new ComponentName(
|
||||
"com.socialnmobile.colordict",
|
||||
"com.socialnmobile.colordict.activity.Main"
|
||||
));
|
||||
intent.putExtra(SearchManager.QUERY, text.substring(start, end));
|
||||
final Intent intent = DictionaryUtil.getDictionaryIntent(text.substring(start, end));
|
||||
try {
|
||||
myBaseActivity.startActivity(intent);
|
||||
} catch(ActivityNotFoundException e){
|
||||
Toast.makeText(
|
||||
myBaseActivity,
|
||||
ZLResource.resource("errorMessage").getResource("dictNotInstalled").getValue(),
|
||||
ZLResource.resource("errorMessage").getResource("dictionaryIsNotInstalled").getValue(),
|
||||
Toast.LENGTH_LONG
|
||||
).show();
|
||||
}
|
||||
|
|
|
@ -17,13 +17,22 @@
|
|||
* 02110-1301, USA.
|
||||
*/
|
||||
|
||||
package org.geometerplus.fbreader.fbreader;
|
||||
package org.geometerplus.android.fbreader;
|
||||
|
||||
import org.geometerplus.zlibrary.text.view.ZLTextViewMode;
|
||||
|
||||
import org.geometerplus.fbreader.fbreader.FBAction;
|
||||
import org.geometerplus.fbreader.fbreader.FBReaderApp;
|
||||
|
||||
import org.geometerplus.android.util.PackageUtil;
|
||||
|
||||
class SwitchTextViewModeAction extends FBAction {
|
||||
private final FBReader myBaseActivity;
|
||||
private final int myMode;
|
||||
|
||||
SwitchTextViewModeAction(FBReaderApp fbreader, int mode) {
|
||||
SwitchTextViewModeAction(FBReader baseActivity, FBReaderApp fbreader, int mode) {
|
||||
super(fbreader);
|
||||
myBaseActivity = baseActivity;
|
||||
myMode = mode;
|
||||
}
|
||||
|
||||
|
@ -34,6 +43,10 @@ class SwitchTextViewModeAction extends FBAction {
|
|||
|
||||
@Override
|
||||
public void run() {
|
||||
if (myMode == ZLTextViewMode.MODE_VISIT_ALL_WORDS) {
|
||||
DictionaryUtil.installDictionaryIfNotInstalled(myBaseActivity);
|
||||
}
|
||||
|
||||
Reader.TextViewModeOption.setValue(myMode);
|
||||
Reader.BookTextView.resetRegionPointer();
|
||||
Reader.FootnoteView.resetRegionPointer();
|
|
@ -33,7 +33,7 @@ import org.geometerplus.zlibrary.core.util.ZLBoolean3;
|
|||
import org.geometerplus.zlibrary.core.network.ZLNetworkException;
|
||||
|
||||
import org.geometerplus.android.util.UIUtil;
|
||||
import org.geometerplus.android.util.PluginUtil;
|
||||
import org.geometerplus.android.util.PackageUtil;
|
||||
|
||||
import org.geometerplus.fbreader.network.*;
|
||||
import org.geometerplus.fbreader.network.tree.NetworkTreeFactory;
|
||||
|
@ -402,11 +402,11 @@ class NetworkCatalogActions extends NetworkTreeActions {
|
|||
String message = null;
|
||||
String positiveButtonKey = null;
|
||||
|
||||
if (!PluginUtil.isPluginInstalled(activity, plugin)) {
|
||||
if (!PackageUtil.isPluginInstalled(activity, plugin)) {
|
||||
dialogKey = "installPlugin";
|
||||
message = pluginData.get("androidPluginInstallMessage");
|
||||
positiveButtonKey = "install";
|
||||
} else if (!PluginUtil.isPluginInstalled(activity, plugin, pluginVersion)) {
|
||||
} else if (!PackageUtil.isPluginInstalled(activity, plugin, pluginVersion)) {
|
||||
dialogKey = "updatePlugin";
|
||||
message = pluginData.get("androidPluginUpdateMessage");
|
||||
positiveButtonKey = "update";
|
||||
|
@ -423,7 +423,7 @@ class NetworkCatalogActions extends NetworkTreeActions {
|
|||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
PluginUtil.installPackageFromMarket(activity, plugin);
|
||||
PackageUtil.installFromMarket(activity, plugin);
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
|
@ -29,6 +29,8 @@ import org.geometerplus.zlibrary.core.network.ZLNetworkException;
|
|||
import org.geometerplus.fbreader.network.INetworkLink;
|
||||
import org.geometerplus.fbreader.network.authentication.NetworkAuthenticationManager;
|
||||
|
||||
import org.geometerplus.android.util.PackageUtil;
|
||||
|
||||
abstract class Util implements UserRegistrationConstants {
|
||||
private static final String REGISTRATION_ACTION =
|
||||
"android.fbreader.action.NETWORK_LIBRARY_REGISTER";
|
||||
|
@ -36,15 +38,7 @@ abstract class Util implements UserRegistrationConstants {
|
|||
"android.fbreader.action.NETWORK_LIBRARY_SMS_REFILLING";
|
||||
|
||||
private static boolean testService(Activity activity, String action, String url) {
|
||||
if (url == null) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
activity.startActivity(new Intent(action + "_TEST", Uri.parse(url)));
|
||||
return true;
|
||||
} catch (ActivityNotFoundException e) {
|
||||
return false;
|
||||
}
|
||||
return url != null && PackageUtil.canBeStarted(activity, new Intent(action, Uri.parse(url)));
|
||||
}
|
||||
|
||||
static boolean isRegistrationSupported(Activity activity, INetworkLink link) {
|
||||
|
|
|
@ -22,9 +22,10 @@ package org.geometerplus.android.util;
|
|||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
|
||||
public abstract class PluginUtil {
|
||||
public abstract class PackageUtil {
|
||||
private static Uri marketUri(String pkg) {
|
||||
return Uri.parse("market://details?id=" + pkg);
|
||||
}
|
||||
|
@ -38,28 +39,24 @@ public abstract class PluginUtil {
|
|||
}
|
||||
|
||||
public static boolean isPluginInstalled(Activity activity, String pkg) {
|
||||
try {
|
||||
activity.startActivity(new Intent(
|
||||
"android.fbreader.action.TEST", homeUri(pkg)
|
||||
));
|
||||
return true;
|
||||
} catch (ActivityNotFoundException e) {
|
||||
return false;
|
||||
}
|
||||
return canBeStarted(
|
||||
activity,
|
||||
new Intent("android.fbreader.action.TEST", homeUri(pkg))
|
||||
);
|
||||
}
|
||||
|
||||
public static boolean isPluginInstalled(Activity activity, String pkg, String version) {
|
||||
try {
|
||||
activity.startActivity(new Intent(
|
||||
"android.fbreader.action.TEST", homeUri(pkg, version)
|
||||
));
|
||||
return true;
|
||||
} catch (ActivityNotFoundException e) {
|
||||
return false;
|
||||
}
|
||||
return canBeStarted(
|
||||
activity,
|
||||
new Intent("android.fbreader.action.TEST", homeUri(pkg, version))
|
||||
);
|
||||
}
|
||||
|
||||
public static boolean installPackageFromMarket(Activity activity, String pkg) {
|
||||
public static boolean canBeStarted(Activity activity, Intent intent) {
|
||||
return activity.getApplicationContext().getPackageManager().resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY) != null;
|
||||
}
|
||||
|
||||
public static boolean installFromMarket(Activity activity, String pkg) {
|
||||
try {
|
||||
activity.startActivity(new Intent(
|
||||
Intent.ACTION_VIEW, marketUri(pkg)
|
|
@ -117,4 +117,12 @@ public abstract class UIUtil {
|
|||
Toast.LENGTH_SHORT
|
||||
).show();
|
||||
}
|
||||
|
||||
public static void showErrorMessage(Context context, String resourceKey, String parameter) {
|
||||
Toast.makeText(
|
||||
context,
|
||||
ZLResource.resource("errorMessage").getResource(resourceKey).getValue().replace("%s", parameter),
|
||||
Toast.LENGTH_SHORT
|
||||
).show();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ import org.geometerplus.zlibrary.core.dialogs.ZLDialogManager;
|
|||
import org.geometerplus.zlibrary.core.options.*;
|
||||
|
||||
import org.geometerplus.zlibrary.text.hyphenation.ZLTextHyphenator;
|
||||
import org.geometerplus.zlibrary.text.view.ZLTextViewMode;
|
||||
|
||||
import org.geometerplus.fbreader.bookmodel.BookModel;
|
||||
import org.geometerplus.fbreader.library.Library;
|
||||
|
@ -82,7 +81,7 @@ public final class FBReaderApp extends ZLApplication {
|
|||
private final ZLKeyBindings myBindings = new ZLKeyBindings("Keys");
|
||||
|
||||
public final FBView BookTextView;
|
||||
final FBView FootnoteView;
|
||||
public final FBView FootnoteView;
|
||||
|
||||
public BookModel Model;
|
||||
|
||||
|
@ -99,9 +98,6 @@ public final class FBReaderApp extends ZLApplication {
|
|||
addAction(ActionCode.FIND_PREVIOUS, new FindPreviousAction(this));
|
||||
addAction(ActionCode.CLEAR_FIND_RESULTS, new ClearFindResultsAction(this));
|
||||
|
||||
addAction(ActionCode.SET_TEXT_VIEW_MODE_VISIT_HYPERLINKS, new SwitchTextViewModeAction(this, ZLTextViewMode.MODE_VISIT_HYPERLINKS));
|
||||
addAction(ActionCode.SET_TEXT_VIEW_MODE_VISIT_ALL_WORDS, new SwitchTextViewModeAction(this, ZLTextViewMode.MODE_VISIT_ALL_WORDS));
|
||||
|
||||
addAction(ActionCode.VOLUME_KEY_SCROLL_FORWARD, new VolumeKeyScrollingAction(this, true));
|
||||
addAction(ActionCode.VOLUME_KEY_SCROLL_BACKWARD, new VolumeKeyScrollingAction(this, false));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue