diff --git a/TODO.dictionary b/TODO.dictionary index 6f0e203da..09e5dae5c 100644 --- a/TODO.dictionary +++ b/TODO.dictionary @@ -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 diff --git a/assets/resources/application/cs.xml b/assets/resources/application/cs.xml index ad3b4e5a6..692c8a4df 100644 --- a/assets/resources/application/cs.xml +++ b/assets/resources/application/cs.xml @@ -475,8 +475,8 @@ - - + + diff --git a/assets/resources/application/de.xml b/assets/resources/application/de.xml index 39ba0a631..9b8cc3f1d 100644 --- a/assets/resources/application/de.xml +++ b/assets/resources/application/de.xml @@ -476,8 +476,8 @@ - - + + diff --git a/assets/resources/application/en.xml b/assets/resources/application/en.xml index c98be0557..2a7217a8b 100644 --- a/assets/resources/application/en.xml +++ b/assets/resources/application/en.xml @@ -474,8 +474,8 @@ - - + + diff --git a/assets/resources/application/fr.xml b/assets/resources/application/fr.xml index 3d2fb8199..b9f25f0b9 100644 --- a/assets/resources/application/fr.xml +++ b/assets/resources/application/fr.xml @@ -484,8 +484,8 @@ - - + + diff --git a/assets/resources/application/hu.xml b/assets/resources/application/hu.xml index 87186001b..00a700fb5 100644 --- a/assets/resources/application/hu.xml +++ b/assets/resources/application/hu.xml @@ -475,8 +475,8 @@ - - + + diff --git a/assets/resources/application/it.xml b/assets/resources/application/it.xml index 38f4d785d..84753c5e6 100644 --- a/assets/resources/application/it.xml +++ b/assets/resources/application/it.xml @@ -475,8 +475,8 @@ - - + + diff --git a/assets/resources/application/ru.xml b/assets/resources/application/ru.xml index 69314265a..2f5c4abd4 100644 --- a/assets/resources/application/ru.xml +++ b/assets/resources/application/ru.xml @@ -474,8 +474,8 @@ - - + + diff --git a/assets/resources/application/uk.xml b/assets/resources/application/uk.xml index db1840828..92053a858 100644 --- a/assets/resources/application/uk.xml +++ b/assets/resources/application/uk.xml @@ -475,8 +475,8 @@ - - + + diff --git a/assets/resources/application/vi.xml b/assets/resources/application/vi.xml index 95f6963d2..2af3f667b 100644 --- a/assets/resources/application/vi.xml +++ b/assets/resources/application/vi.xml @@ -475,8 +475,8 @@ - - + + diff --git a/assets/resources/application/zh.xml b/assets/resources/application/zh.xml index 51cf069c9..a42a62037 100644 --- a/assets/resources/application/zh.xml +++ b/assets/resources/application/zh.xml @@ -481,8 +481,8 @@ - - + + diff --git a/src/org/geometerplus/android/fbreader/preferences/PreferenceActivity.java b/src/org/geometerplus/android/fbreader/preferences/PreferenceActivity.java index 9d974e088..51bb960a8 100644 --- a/src/org/geometerplus/android/fbreader/preferences/PreferenceActivity.java +++ b/src/org/geometerplus/android/fbreader/preferences/PreferenceActivity.java @@ -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 )); } } diff --git a/src/org/geometerplus/fbreader/fbreader/FBReaderApp.java b/src/org/geometerplus/fbreader/fbreader/FBReaderApp.java index 90fe0296b..cd38ebdc1 100644 --- a/src/org/geometerplus/fbreader/fbreader/FBReaderApp.java +++ b/src/org/geometerplus/fbreader/fbreader/FBReaderApp.java @@ -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); diff --git a/src/org/geometerplus/fbreader/fbreader/FBView.java b/src/org/geometerplus/fbreader/fbreader/FBView.java index 3acab15cb..a3cde205e 100644 --- a/src/org/geometerplus/fbreader/fbreader/FBView.java +++ b/src/org/geometerplus/fbreader/fbreader/FBView.java @@ -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;