mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 01:39:18 +02:00
3 options for tapping action in dictionary mode
This commit is contained in:
parent
d6cd430c32
commit
920dc5cebb
14 changed files with 43 additions and 30 deletions
|
@ -3,6 +3,8 @@ DONE Run 'install ColorDict' dialog
|
|||
DONE Synchronize resources
|
||||
DONE Option for opening ColorDict immediately by finger tap
|
||||
DONE Synchronize resources
|
||||
* 3-mode tapping behaviour
|
||||
* long tapping processing instead of short one?
|
||||
|
||||
After 0.99:
|
||||
* More convenient mode changing
|
||||
|
|
|
@ -475,8 +475,8 @@
|
|||
<node name="dictionary" value="Dictionary" toBeTranslated="true">
|
||||
<node name="summary" value="Dictionary settings" toBeTranslated="true"/>
|
||||
<node name="tappingAction" value="Tapping on word" toBeTranslated="true">
|
||||
<node name="does nothing" value="Tapping does nothing" toBeTranslated="true"/>
|
||||
<node name="selectsWord" value="Tapping selects the word" toBeTranslated="true"/>
|
||||
<node name="doNothing" value="Tapping does nothing" 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>
|
||||
</node>
|
||||
|
|
|
@ -476,8 +476,8 @@
|
|||
<node name="dictionary" value="Dictionary" toBeTranslated="true">
|
||||
<node name="summary" value="Dictionary settings" toBeTranslated="true"/>
|
||||
<node name="tappingAction" value="Tapping on word" toBeTranslated="true">
|
||||
<node name="does nothing" value="Tapping does nothing" toBeTranslated="true"/>
|
||||
<node name="selectsWord" value="Tapping selects the word" toBeTranslated="true"/>
|
||||
<node name="doNothing" value="Tapping does nothing" 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>
|
||||
</node>
|
||||
|
|
|
@ -474,8 +474,8 @@
|
|||
<node name="dictionary" value="Dictionary">
|
||||
<node name="summary" value="Dictionary settings"/>
|
||||
<node name="tappingAction" value="Tapping on word">
|
||||
<node name="does nothing" value="Tapping does nothing"/>
|
||||
<node name="selectsWord" value="Tapping selects the word"/>
|
||||
<node name="doNothing" value="Tapping does nothing"/>
|
||||
<node name="selectWord" value="Tapping selects the word"/>
|
||||
<node name="openDictionary" value="Tapping selects the word and opens dictionary"/>
|
||||
</node>
|
||||
</node>
|
||||
|
|
|
@ -484,8 +484,8 @@
|
|||
<node name="dictionary" value="Dictionary" toBeTranslated="true">
|
||||
<node name="summary" value="Dictionary settings" toBeTranslated="true"/>
|
||||
<node name="tappingAction" value="Tapping on word" toBeTranslated="true">
|
||||
<node name="does nothing" value="Tapping does nothing" toBeTranslated="true"/>
|
||||
<node name="selectsWord" value="Tapping selects the word" toBeTranslated="true"/>
|
||||
<node name="doNothing" value="Tapping does nothing" 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>
|
||||
</node>
|
||||
|
|
|
@ -475,8 +475,8 @@
|
|||
<node name="dictionary" value="Dictionary" toBeTranslated="true">
|
||||
<node name="summary" value="Dictionary settings" toBeTranslated="true"/>
|
||||
<node name="tappingAction" value="Tapping on word" toBeTranslated="true">
|
||||
<node name="does nothing" value="Tapping does nothing" toBeTranslated="true"/>
|
||||
<node name="selectsWord" value="Tapping selects the word" toBeTranslated="true"/>
|
||||
<node name="doNothing" value="Tapping does nothing" 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>
|
||||
</node>
|
||||
|
|
|
@ -475,8 +475,8 @@
|
|||
<node name="dictionary" value="Dictionary" toBeTranslated="true">
|
||||
<node name="summary" value="Dictionary settings" toBeTranslated="true"/>
|
||||
<node name="tappingAction" value="Tapping on word" toBeTranslated="true">
|
||||
<node name="does nothing" value="Tapping does nothing" toBeTranslated="true"/>
|
||||
<node name="selectsWord" value="Tapping selects the word" toBeTranslated="true"/>
|
||||
<node name="doNothing" value="Tapping does nothing" 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>
|
||||
</node>
|
||||
|
|
|
@ -474,8 +474,8 @@
|
|||
<node name="dictionary" value="Словарь">
|
||||
<node name="summary" value="Настройки словаря"/>
|
||||
<node name="tappingAction" value="Дествие при нажатии на экран">
|
||||
<node name="does nothing" value="Не делать ничего"/>
|
||||
<node name="selectsWord" value="Выделять слово"/>
|
||||
<node name="doNothing" value="Не делать ничего"/>
|
||||
<node name="selectWord" value="Выделять слово"/>
|
||||
<node name="openDictionary" value="Выделять слово и запускать словарь"/>
|
||||
</node>
|
||||
</node>
|
||||
|
|
|
@ -475,8 +475,8 @@
|
|||
<node name="dictionary" value="Dictionary" toBeTranslated="true">
|
||||
<node name="summary" value="Dictionary settings" toBeTranslated="true"/>
|
||||
<node name="tappingAction" value="Tapping on word" toBeTranslated="true">
|
||||
<node name="does nothing" value="Tapping does nothing" toBeTranslated="true"/>
|
||||
<node name="selectsWord" value="Tapping selects the word" toBeTranslated="true"/>
|
||||
<node name="doNothing" value="Tapping does nothing" 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>
|
||||
</node>
|
||||
|
|
|
@ -475,8 +475,8 @@
|
|||
<node name="dictionary" value="Dictionary" toBeTranslated="true">
|
||||
<node name="summary" value="Dictionary settings" toBeTranslated="true"/>
|
||||
<node name="tappingAction" value="Tapping on word" toBeTranslated="true">
|
||||
<node name="does nothing" value="Tapping does nothing" toBeTranslated="true"/>
|
||||
<node name="selectsWord" value="Tapping selects the word" toBeTranslated="true"/>
|
||||
<node name="doNothing" value="Tapping does nothing" 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>
|
||||
</node>
|
||||
|
|
|
@ -481,8 +481,8 @@
|
|||
<node name="dictionary" value="Dictionary" toBeTranslated="true">
|
||||
<node name="summary" value="Dictionary settings" toBeTranslated="true"/>
|
||||
<node name="tappingAction" value="Tapping on word" toBeTranslated="true">
|
||||
<node name="does nothing" value="Tapping does nothing" toBeTranslated="true"/>
|
||||
<node name="selectsWord" value="Tapping selects the word" toBeTranslated="true"/>
|
||||
<node name="doNothing" value="Tapping does nothing" 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>
|
||||
</node>
|
||||
|
|
|
@ -341,11 +341,10 @@ public class PreferenceActivity extends ZLPreferenceActivity {
|
|||
scrollingScreen.addOption(scrollingPreferences.HorizontalOption, "horizontal");
|
||||
|
||||
final Screen dictionaryScreen = createPreferenceScreen("dictionary");
|
||||
dictionaryScreen.addPreference(new ZLBooleanPreference(
|
||||
this,
|
||||
fbReader.OpenDictionaryOnTapOption,
|
||||
dictionaryScreen.Resource,
|
||||
"runDictionaryOnTap"
|
||||
final String[] actions = { "doNothing", "selectWord", "openDictionary" };
|
||||
dictionaryScreen.addPreference(new ZLChoicePreference(
|
||||
this, dictionaryScreen.Resource, "tappingAction",
|
||||
fbReader.DictionaryModeTappingActionOption, actions
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,8 +44,14 @@ public final class FBReaderApp extends ZLApplication {
|
|||
|
||||
public final ZLIntegerRangeOption TextViewModeOption =
|
||||
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 =
|
||||
new ZLIntegerRangeOption("Options", "LeftMargin", 0, 30, 4);
|
||||
|
|
|
@ -95,10 +95,16 @@ public final class FBView extends ZLTextView {
|
|||
|
||||
final ZLTextElementRegion region = findRegion(x, y, 10);
|
||||
if (region != null) {
|
||||
selectRegion(region);
|
||||
myReader.repaintView();
|
||||
final int action = myReader.DictionaryModeTappingActionOption.getValue();
|
||||
|
||||
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);
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue