1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-03 09:49:19 +02:00

3 options for tapping action in dictionary mode

This commit is contained in:
Nikolay Pultsin 2010-12-31 02:41:15 +00:00
parent d6cd430c32
commit 920dc5cebb
14 changed files with 43 additions and 30 deletions

View file

@ -3,6 +3,8 @@ DONE Run 'install ColorDict' dialog
DONE Synchronize resources DONE Synchronize resources
DONE Option for opening ColorDict immediately by finger tap DONE Option for opening ColorDict immediately by finger tap
DONE Synchronize resources DONE Synchronize resources
* 3-mode tapping behaviour
* long tapping processing instead of short one?
After 0.99: After 0.99:
* More convenient mode changing * More convenient mode changing

View file

@ -475,8 +475,8 @@
<node name="dictionary" value="Dictionary" toBeTranslated="true"> <node name="dictionary" value="Dictionary" toBeTranslated="true">
<node name="summary" value="Dictionary settings" toBeTranslated="true"/> <node name="summary" value="Dictionary settings" toBeTranslated="true"/>
<node name="tappingAction" value="Tapping on word" toBeTranslated="true"> <node name="tappingAction" value="Tapping on word" toBeTranslated="true">
<node name="does nothing" value="Tapping does nothing" toBeTranslated="true"/> <node name="doNothing" value="Tapping does nothing" toBeTranslated="true"/>
<node name="selectsWord" value="Tapping selects the word" toBeTranslated="true"/> <node name="selectWord" value="Tapping selects the word" toBeTranslated="true"/>
<node name="openDictionary" value="Tapping selects the word and opens dictionary" toBeTranslated="true"/> <node name="openDictionary" value="Tapping selects the word and opens dictionary" toBeTranslated="true"/>
</node> </node>
</node> </node>

View file

@ -476,8 +476,8 @@
<node name="dictionary" value="Dictionary" toBeTranslated="true"> <node name="dictionary" value="Dictionary" toBeTranslated="true">
<node name="summary" value="Dictionary settings" toBeTranslated="true"/> <node name="summary" value="Dictionary settings" toBeTranslated="true"/>
<node name="tappingAction" value="Tapping on word" toBeTranslated="true"> <node name="tappingAction" value="Tapping on word" toBeTranslated="true">
<node name="does nothing" value="Tapping does nothing" toBeTranslated="true"/> <node name="doNothing" value="Tapping does nothing" toBeTranslated="true"/>
<node name="selectsWord" value="Tapping selects the word" toBeTranslated="true"/> <node name="selectWord" value="Tapping selects the word" toBeTranslated="true"/>
<node name="openDictionary" value="Tapping selects the word and opens dictionary" toBeTranslated="true"/> <node name="openDictionary" value="Tapping selects the word and opens dictionary" toBeTranslated="true"/>
</node> </node>
</node> </node>

View file

@ -474,8 +474,8 @@
<node name="dictionary" value="Dictionary"> <node name="dictionary" value="Dictionary">
<node name="summary" value="Dictionary settings"/> <node name="summary" value="Dictionary settings"/>
<node name="tappingAction" value="Tapping on word"> <node name="tappingAction" value="Tapping on word">
<node name="does nothing" value="Tapping does nothing"/> <node name="doNothing" value="Tapping does nothing"/>
<node name="selectsWord" value="Tapping selects the word"/> <node name="selectWord" value="Tapping selects the word"/>
<node name="openDictionary" value="Tapping selects the word and opens dictionary"/> <node name="openDictionary" value="Tapping selects the word and opens dictionary"/>
</node> </node>
</node> </node>

View file

@ -484,8 +484,8 @@
<node name="dictionary" value="Dictionary" toBeTranslated="true"> <node name="dictionary" value="Dictionary" toBeTranslated="true">
<node name="summary" value="Dictionary settings" toBeTranslated="true"/> <node name="summary" value="Dictionary settings" toBeTranslated="true"/>
<node name="tappingAction" value="Tapping on word" toBeTranslated="true"> <node name="tappingAction" value="Tapping on word" toBeTranslated="true">
<node name="does nothing" value="Tapping does nothing" toBeTranslated="true"/> <node name="doNothing" value="Tapping does nothing" toBeTranslated="true"/>
<node name="selectsWord" value="Tapping selects the word" toBeTranslated="true"/> <node name="selectWord" value="Tapping selects the word" toBeTranslated="true"/>
<node name="openDictionary" value="Tapping selects the word and opens dictionary" toBeTranslated="true"/> <node name="openDictionary" value="Tapping selects the word and opens dictionary" toBeTranslated="true"/>
</node> </node>
</node> </node>

View file

@ -475,8 +475,8 @@
<node name="dictionary" value="Dictionary" toBeTranslated="true"> <node name="dictionary" value="Dictionary" toBeTranslated="true">
<node name="summary" value="Dictionary settings" toBeTranslated="true"/> <node name="summary" value="Dictionary settings" toBeTranslated="true"/>
<node name="tappingAction" value="Tapping on word" toBeTranslated="true"> <node name="tappingAction" value="Tapping on word" toBeTranslated="true">
<node name="does nothing" value="Tapping does nothing" toBeTranslated="true"/> <node name="doNothing" value="Tapping does nothing" toBeTranslated="true"/>
<node name="selectsWord" value="Tapping selects the word" toBeTranslated="true"/> <node name="selectWord" value="Tapping selects the word" toBeTranslated="true"/>
<node name="openDictionary" value="Tapping selects the word and opens dictionary" toBeTranslated="true"/> <node name="openDictionary" value="Tapping selects the word and opens dictionary" toBeTranslated="true"/>
</node> </node>
</node> </node>

View file

@ -475,8 +475,8 @@
<node name="dictionary" value="Dictionary" toBeTranslated="true"> <node name="dictionary" value="Dictionary" toBeTranslated="true">
<node name="summary" value="Dictionary settings" toBeTranslated="true"/> <node name="summary" value="Dictionary settings" toBeTranslated="true"/>
<node name="tappingAction" value="Tapping on word" toBeTranslated="true"> <node name="tappingAction" value="Tapping on word" toBeTranslated="true">
<node name="does nothing" value="Tapping does nothing" toBeTranslated="true"/> <node name="doNothing" value="Tapping does nothing" toBeTranslated="true"/>
<node name="selectsWord" value="Tapping selects the word" toBeTranslated="true"/> <node name="selectWord" value="Tapping selects the word" toBeTranslated="true"/>
<node name="openDictionary" value="Tapping selects the word and opens dictionary" toBeTranslated="true"/> <node name="openDictionary" value="Tapping selects the word and opens dictionary" toBeTranslated="true"/>
</node> </node>
</node> </node>

View file

@ -474,8 +474,8 @@
<node name="dictionary" value="Словарь"> <node name="dictionary" value="Словарь">
<node name="summary" value="Настройки словаря"/> <node name="summary" value="Настройки словаря"/>
<node name="tappingAction" value="Дествие при нажатии на экран"> <node name="tappingAction" value="Дествие при нажатии на экран">
<node name="does nothing" value="Не делать ничего"/> <node name="doNothing" value="Не делать ничего"/>
<node name="selectsWord" value="Выделять слово"/> <node name="selectWord" value="Выделять слово"/>
<node name="openDictionary" value="Выделять слово и запускать словарь"/> <node name="openDictionary" value="Выделять слово и запускать словарь"/>
</node> </node>
</node> </node>

View file

@ -475,8 +475,8 @@
<node name="dictionary" value="Dictionary" toBeTranslated="true"> <node name="dictionary" value="Dictionary" toBeTranslated="true">
<node name="summary" value="Dictionary settings" toBeTranslated="true"/> <node name="summary" value="Dictionary settings" toBeTranslated="true"/>
<node name="tappingAction" value="Tapping on word" toBeTranslated="true"> <node name="tappingAction" value="Tapping on word" toBeTranslated="true">
<node name="does nothing" value="Tapping does nothing" toBeTranslated="true"/> <node name="doNothing" value="Tapping does nothing" toBeTranslated="true"/>
<node name="selectsWord" value="Tapping selects the word" toBeTranslated="true"/> <node name="selectWord" value="Tapping selects the word" toBeTranslated="true"/>
<node name="openDictionary" value="Tapping selects the word and opens dictionary" toBeTranslated="true"/> <node name="openDictionary" value="Tapping selects the word and opens dictionary" toBeTranslated="true"/>
</node> </node>
</node> </node>

View file

@ -475,8 +475,8 @@
<node name="dictionary" value="Dictionary" toBeTranslated="true"> <node name="dictionary" value="Dictionary" toBeTranslated="true">
<node name="summary" value="Dictionary settings" toBeTranslated="true"/> <node name="summary" value="Dictionary settings" toBeTranslated="true"/>
<node name="tappingAction" value="Tapping on word" toBeTranslated="true"> <node name="tappingAction" value="Tapping on word" toBeTranslated="true">
<node name="does nothing" value="Tapping does nothing" toBeTranslated="true"/> <node name="doNothing" value="Tapping does nothing" toBeTranslated="true"/>
<node name="selectsWord" value="Tapping selects the word" toBeTranslated="true"/> <node name="selectWord" value="Tapping selects the word" toBeTranslated="true"/>
<node name="openDictionary" value="Tapping selects the word and opens dictionary" toBeTranslated="true"/> <node name="openDictionary" value="Tapping selects the word and opens dictionary" toBeTranslated="true"/>
</node> </node>
</node> </node>

View file

@ -481,8 +481,8 @@
<node name="dictionary" value="Dictionary" toBeTranslated="true"> <node name="dictionary" value="Dictionary" toBeTranslated="true">
<node name="summary" value="Dictionary settings" toBeTranslated="true"/> <node name="summary" value="Dictionary settings" toBeTranslated="true"/>
<node name="tappingAction" value="Tapping on word" toBeTranslated="true"> <node name="tappingAction" value="Tapping on word" toBeTranslated="true">
<node name="does nothing" value="Tapping does nothing" toBeTranslated="true"/> <node name="doNothing" value="Tapping does nothing" toBeTranslated="true"/>
<node name="selectsWord" value="Tapping selects the word" toBeTranslated="true"/> <node name="selectWord" value="Tapping selects the word" toBeTranslated="true"/>
<node name="openDictionary" value="Tapping selects the word and opens dictionary" toBeTranslated="true"/> <node name="openDictionary" value="Tapping selects the word and opens dictionary" toBeTranslated="true"/>
</node> </node>
</node> </node>

View file

@ -341,11 +341,10 @@ public class PreferenceActivity extends ZLPreferenceActivity {
scrollingScreen.addOption(scrollingPreferences.HorizontalOption, "horizontal"); scrollingScreen.addOption(scrollingPreferences.HorizontalOption, "horizontal");
final Screen dictionaryScreen = createPreferenceScreen("dictionary"); final Screen dictionaryScreen = createPreferenceScreen("dictionary");
dictionaryScreen.addPreference(new ZLBooleanPreference( final String[] actions = { "doNothing", "selectWord", "openDictionary" };
this, dictionaryScreen.addPreference(new ZLChoicePreference(
fbReader.OpenDictionaryOnTapOption, this, dictionaryScreen.Resource, "tappingAction",
dictionaryScreen.Resource, fbReader.DictionaryModeTappingActionOption, actions
"runDictionaryOnTap"
)); ));
} }
} }

View file

@ -44,8 +44,14 @@ public final class FBReaderApp extends ZLApplication {
public final ZLIntegerRangeOption TextViewModeOption = public final ZLIntegerRangeOption TextViewModeOption =
new ZLIntegerRangeOption("Options", "TextViewMode", 0, 1, 0); new ZLIntegerRangeOption("Options", "TextViewMode", 0, 1, 0);
public final ZLBooleanOption OpenDictionaryOnTapOption =
new ZLBooleanOption("Options", "OpenDictionaryOnTap", false); public interface DictionaryModeTappingAction {
int DO_NOTHING = 0;
int SELECT_WORD = 1;
int OPEN_DICTIONARY = 2;
}
public final ZLIntegerRangeOption DictionaryModeTappingActionOption =
new ZLIntegerRangeOption("Options", "DictionaryModeTappingAction", 0, 2, DictionaryModeTappingAction.SELECT_WORD);
public final ZLIntegerRangeOption LeftMarginOption = public final ZLIntegerRangeOption LeftMarginOption =
new ZLIntegerRangeOption("Options", "LeftMargin", 0, 30, 4); new ZLIntegerRangeOption("Options", "LeftMargin", 0, 30, 4);

View file

@ -95,10 +95,16 @@ public final class FBView extends ZLTextView {
final ZLTextElementRegion region = findRegion(x, y, 10); final ZLTextElementRegion region = findRegion(x, y, 10);
if (region != null) { if (region != null) {
selectRegion(region); final int action = myReader.DictionaryModeTappingActionOption.getValue();
myReader.repaintView();
if (region instanceof ZLTextHyperlinkRegion || if (region instanceof ZLTextHyperlinkRegion ||
myReader.OpenDictionaryOnTapOption.getValue()) { action == FBReaderApp.DictionaryModeTappingAction.SELECT_WORD ||
action == FBReaderApp.DictionaryModeTappingAction.OPEN_DICTIONARY) {
selectRegion(region);
myReader.repaintView();
}
if (region instanceof ZLTextHyperlinkRegion ||
action == FBReaderApp.DictionaryModeTappingAction.OPEN_DICTIONARY) {
myReader.doAction(ActionCode.PROCESS_HYPERLINK); myReader.doAction(ActionCode.PROCESS_HYPERLINK);
} }
return true; return true;