mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 10:49:24 +02:00
double tap is now always supported; menu call by douple tap; 0.98.10
This commit is contained in:
parent
5fa2ba9304
commit
588344d416
11 changed files with 57 additions and 23 deletions
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.geometerplus.zlibrary.ui.android" android:versionCode="9809" android:versionName="0.98.9" android:installLocation="auto">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.geometerplus.zlibrary.ui.android" android:versionCode="9810" android:versionName="0.98.10" android:installLocation="auto">
|
||||||
<uses-sdk android:minSdkVersion="4" />
|
<uses-sdk android:minSdkVersion="4" />
|
||||||
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true" />
|
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
0.98.9
|
0.98.10
|
||||||
|
|
|
@ -133,6 +133,7 @@ public final class FBReader extends ZLAndroidActivity {
|
||||||
fbReader.addAction(ActionCode.SHOW_BOOKMARKS, new ShowBookmarksAction(this, fbReader));
|
fbReader.addAction(ActionCode.SHOW_BOOKMARKS, new ShowBookmarksAction(this, fbReader));
|
||||||
fbReader.addAction(ActionCode.SHOW_NETWORK_LIBRARY, new ShowNetworkLibraryAction(this, fbReader));
|
fbReader.addAction(ActionCode.SHOW_NETWORK_LIBRARY, new ShowNetworkLibraryAction(this, fbReader));
|
||||||
|
|
||||||
|
fbReader.addAction(ActionCode.SHOW_MENU, new ShowMenuAction(this, fbReader));
|
||||||
fbReader.addAction(ActionCode.SHOW_NAVIGATION, new ShowNavigationAction(this, fbReader));
|
fbReader.addAction(ActionCode.SHOW_NAVIGATION, new ShowNavigationAction(this, fbReader));
|
||||||
fbReader.addAction(ActionCode.SEARCH, new SearchAction(this, fbReader));
|
fbReader.addAction(ActionCode.SEARCH, new SearchAction(this, fbReader));
|
||||||
|
|
||||||
|
|
36
src/org/geometerplus/android/fbreader/ShowMenuAction.java
Normal file
36
src/org/geometerplus/android/fbreader/ShowMenuAction.java
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2007-2010 Geometer Plus <contact@geometerplus.com>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
|
* 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.geometerplus.android.fbreader;
|
||||||
|
|
||||||
|
import org.geometerplus.fbreader.fbreader.FBAction;
|
||||||
|
import org.geometerplus.fbreader.fbreader.FBReaderApp;
|
||||||
|
|
||||||
|
class ShowMenuAction extends FBAction {
|
||||||
|
private final FBReader myActivity;
|
||||||
|
|
||||||
|
ShowMenuAction(FBReader activity, FBReaderApp fbreader) {
|
||||||
|
super(fbreader);
|
||||||
|
myActivity = activity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void run() {
|
||||||
|
myActivity.openOptionsMenu();
|
||||||
|
}
|
||||||
|
}
|
|
@ -58,9 +58,7 @@ public class PreferenceActivity extends ZLPreferenceActivity {
|
||||||
|
|
||||||
final Screen appearanceScreen = createPreferenceScreen("appearance");
|
final Screen appearanceScreen = createPreferenceScreen("appearance");
|
||||||
appearanceScreen.addOption(androidApp.AutoOrientationOption, "autoOrientation");
|
appearanceScreen.addOption(androidApp.AutoOrientationOption, "autoOrientation");
|
||||||
if (!androidApp.isAlwaysShowStatusBar()) {
|
appearanceScreen.addOption(androidApp.ShowStatusBarOption, "showStatusBar");
|
||||||
appearanceScreen.addOption(androidApp.ShowStatusBarOption, "showStatusBar");
|
|
||||||
}
|
|
||||||
|
|
||||||
final Screen textScreen = createPreferenceScreen("text");
|
final Screen textScreen = createPreferenceScreen("text");
|
||||||
final ZLTextStyleCollection collection = ZLTextStyleCollection.Instance();
|
final ZLTextStyleCollection collection = ZLTextStyleCollection.Instance();
|
||||||
|
@ -335,7 +333,7 @@ public class PreferenceActivity extends ZLPreferenceActivity {
|
||||||
final Screen scrollingScreen = createPreferenceScreen("scrolling");
|
final Screen scrollingScreen = createPreferenceScreen("scrolling");
|
||||||
final ScrollingPreferences scrollingPreferences = ScrollingPreferences.Instance();
|
final ScrollingPreferences scrollingPreferences = ScrollingPreferences.Instance();
|
||||||
scrollingScreen.addOption(scrollingPreferences.FingerScrollingOption, "fingerScrolling");
|
scrollingScreen.addOption(scrollingPreferences.FingerScrollingOption, "fingerScrolling");
|
||||||
scrollingScreen.addOption(scrollingPreferences.DoubleTapNavigationOption, "doubleTapNavigation");
|
//scrollingScreen.addOption(scrollingPreferences.DoubleTapNavigationOption, "doubleTapNavigation");
|
||||||
scrollingScreen.addOption(scrollingPreferences.VolumeKeysOption, "volumeKeys");
|
scrollingScreen.addOption(scrollingPreferences.VolumeKeysOption, "volumeKeys");
|
||||||
scrollingScreen.addOption(scrollingPreferences.InvertVolumeKeysOption, "invertVolumeKeys");
|
scrollingScreen.addOption(scrollingPreferences.InvertVolumeKeysOption, "invertVolumeKeys");
|
||||||
scrollingScreen.addOption(scrollingPreferences.AnimateOption, "animated");
|
scrollingScreen.addOption(scrollingPreferences.AnimateOption, "animated");
|
||||||
|
|
|
@ -40,13 +40,12 @@ public interface ActionCode {
|
||||||
|
|
||||||
String VOLUME_KEY_SCROLL_FORWARD = "volumeKeyScrollForward";
|
String VOLUME_KEY_SCROLL_FORWARD = "volumeKeyScrollForward";
|
||||||
String VOLUME_KEY_SCROLL_BACKWARD = "volumeKeyScrollBackward";
|
String VOLUME_KEY_SCROLL_BACKWARD = "volumeKeyScrollBackward";
|
||||||
|
String SHOW_MENU = "menu";
|
||||||
String SHOW_NAVIGATION = "navigate";
|
String SHOW_NAVIGATION = "navigate";
|
||||||
String CANCEL = "cancel";
|
String CANCEL = "cancel";
|
||||||
String ROTATE = "rotate";
|
String ROTATE = "rotate";
|
||||||
String INCREASE_FONT = "increaseFont";
|
String INCREASE_FONT = "increaseFont";
|
||||||
String DECREASE_FONT = "decreaseFont";
|
String DECREASE_FONT = "decreaseFont";
|
||||||
String TOGGLE_FULLSCREEN = "toggleFullscreen";
|
|
||||||
String FULLSCREEN_ON = "onFullscreen";
|
|
||||||
|
|
||||||
String COPY_SELECTED_TEXT_TO_CLIPBOARD = "copyToClipboard";
|
String COPY_SELECTED_TEXT_TO_CLIPBOARD = "copyToClipboard";
|
||||||
String CLEAR_SELECTION = "clearSelection";
|
String CLEAR_SELECTION = "clearSelection";
|
||||||
|
|
|
@ -126,15 +126,20 @@ public final class FBView extends ZLTextView {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isDoubleTapSupported() {
|
public boolean isDoubleTapSupported() {
|
||||||
return ScrollingPreferences.Instance().DoubleTapNavigationOption.getValue();
|
return true;
|
||||||
|
//return ScrollingPreferences.Instance().DoubleTapNavigationOption.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onFingerDoubleTap() {
|
public boolean onFingerDoubleTap(int x, int y) {
|
||||||
if (super.onFingerDoubleTap()) {
|
if (super.onFingerDoubleTap(x, y)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
myReader.doAction(ActionCode.SHOW_NAVIGATION);
|
if (y <= myContext.getHeight() / 2) {
|
||||||
|
myReader.doAction(ActionCode.SHOW_NAVIGATION);
|
||||||
|
} else {
|
||||||
|
myReader.doAction(ActionCode.SHOW_MENU);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class ScrollingPreferences {
|
||||||
public final ZLEnumOption<FingerScrolling> FingerScrollingOption =
|
public final ZLEnumOption<FingerScrolling> FingerScrollingOption =
|
||||||
new ZLEnumOption<FingerScrolling>("Scrolling", "Finger", FingerScrolling.byTapAndFlick);
|
new ZLEnumOption<FingerScrolling>("Scrolling", "Finger", FingerScrolling.byTapAndFlick);
|
||||||
|
|
||||||
public final ZLBooleanOption DoubleTapNavigationOption = new ZLBooleanOption("Scrolling", "DoubleTapNavigation", false);
|
//public final ZLBooleanOption DoubleTapNavigationOption = new ZLBooleanOption("Scrolling", "DoubleTapNavigation", false);
|
||||||
public final ZLBooleanOption VolumeKeysOption = new ZLBooleanOption("Scrolling", "VolumeKeys", true);
|
public final ZLBooleanOption VolumeKeysOption = new ZLBooleanOption("Scrolling", "VolumeKeys", true);
|
||||||
public final ZLBooleanOption AnimateOption = new ZLBooleanOption("Scrolling", "ShowAnimated", true);
|
public final ZLBooleanOption AnimateOption = new ZLBooleanOption("Scrolling", "ShowAnimated", true);
|
||||||
public final ZLBooleanOption HorizontalOption = new ZLBooleanOption("Scrolling", "Horizontal", true);
|
public final ZLBooleanOption HorizontalOption = new ZLBooleanOption("Scrolling", "Horizontal", true);
|
||||||
|
|
|
@ -70,7 +70,7 @@ abstract public class ZLView {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean onFingerDoubleTap() {
|
public boolean onFingerDoubleTap(int x, int y) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class ZLAndroidApplication extends Application {
|
||||||
private static ZLAndroidApplication ourApplication;
|
private static ZLAndroidApplication ourApplication;
|
||||||
|
|
||||||
public final ZLBooleanOption AutoOrientationOption = new ZLBooleanOption("LookNFeel", "AutoOrientation", false);
|
public final ZLBooleanOption AutoOrientationOption = new ZLBooleanOption("LookNFeel", "AutoOrientation", false);
|
||||||
public final ZLBooleanOption ShowStatusBarOption = new ZLBooleanOption("LookNFeel", "ShowStatusBar", false);
|
public final ZLBooleanOption ShowStatusBarOption = new ZLBooleanOption("LookNFeel", "ShowStatusBar", hasNoHardwareMenuButton());
|
||||||
public final ZLIntegerRangeOption BatteryLevelToTurnScreenOffOption = new ZLIntegerRangeOption("LookNFeel", "BatteryLevelToTurnScreenOff", 0, 100, 50);
|
public final ZLIntegerRangeOption BatteryLevelToTurnScreenOffOption = new ZLIntegerRangeOption("LookNFeel", "BatteryLevelToTurnScreenOff", 0, 100, 50);
|
||||||
public final ZLBooleanOption DontTurnScreenOffDuringChargingOption = new ZLBooleanOption("LookNFeel", "DontTurnScreenOffDuringCharging", true);
|
public final ZLBooleanOption DontTurnScreenOffDuringChargingOption = new ZLBooleanOption("LookNFeel", "DontTurnScreenOffDuringCharging", true);
|
||||||
public final ZLIntegerRangeOption ScreenBrightnessLevelOption = new ZLIntegerRangeOption("LookNFeel", "ScreenBrightnessLevel", 0, 100, 0);
|
public final ZLIntegerRangeOption ScreenBrightnessLevelOption = new ZLIntegerRangeOption("LookNFeel", "ScreenBrightnessLevel", 0, 100, 0);
|
||||||
|
@ -47,13 +47,11 @@ public class ZLAndroidApplication extends Application {
|
||||||
ourApplication = this;
|
ourApplication = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAlwaysShowStatusBar() {
|
private boolean hasNoHardwareMenuButton() {
|
||||||
return
|
return
|
||||||
// Eken M001
|
// Eken M001
|
||||||
(Build.DISPLAY != null && Build.DISPLAY.contains("simenxie")) ||
|
(Build.DISPLAY != null && Build.DISPLAY.contains("simenxie")) ||
|
||||||
// Eken M003
|
// PanDigital
|
||||||
(Build.DISPLAY != null && Build.DISPLAY.contains("Donut.eng.howayhuo")) ||
|
|
||||||
// Eken PanDigital
|
|
||||||
"PD_Novel".equals(Build.MODEL);
|
"PD_Novel".equals(Build.MODEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,9 +60,6 @@ public class ZLAndroidApplication extends Application {
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
if (isAlwaysShowStatusBar()) {
|
|
||||||
ShowStatusBarOption.setValue(true);
|
|
||||||
}
|
|
||||||
new ZLSQLiteConfig(this);
|
new ZLSQLiteConfig(this);
|
||||||
new ZLAndroidImageManager();
|
new ZLAndroidImageManager();
|
||||||
new ZLAndroidDialogManager();
|
new ZLAndroidDialogManager();
|
||||||
|
|
|
@ -374,7 +374,7 @@ public class ZLAndroidWidget extends View implements View.OnLongClickListener {
|
||||||
switch (event.getAction()) {
|
switch (event.getAction()) {
|
||||||
case MotionEvent.ACTION_UP:
|
case MotionEvent.ACTION_UP:
|
||||||
if (myPendingDoubleTap) {
|
if (myPendingDoubleTap) {
|
||||||
view.onFingerDoubleTap();
|
view.onFingerDoubleTap(x, y);
|
||||||
} if (myLongClickPerformed) {
|
} if (myLongClickPerformed) {
|
||||||
view.onFingerReleaseAfterLongPress(x, y);
|
view.onFingerReleaseAfterLongPress(x, y);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue