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

CancelAction splitted into ShowCancelMenuAction & ExitAction

This commit is contained in:
Nikolay Pultsin 2011-03-24 19:02:52 +00:00
parent ee8fc1bb92
commit db42d8afca
6 changed files with 44 additions and 5 deletions

View file

@ -2,7 +2,7 @@
<keymap>
<binding key="&lt;VolumeDown&gt;" action="volumeKeyScrollForward"/>
<binding key="&lt;VolumeUp&gt;" action="volumeKeyScrollBackward"/>
<binding key="&lt;Back&gt;" action="cancel"/>
<binding key="&lt;Back&gt;" action="cancelMenu"/>
<binding key="&lt;Enter&gt;" action="processHyperlink"/>
<binding key="&lt;PadCenter&gt;" action="processHyperlink"/>
</keymap>

View file

@ -101,7 +101,7 @@ public final class FBReader extends ZLAndroidActivity {
fbReader.addAction(ActionCode.PROCESS_HYPERLINK, new ProcessHyperlinkAction(this, fbReader));
fbReader.addAction(ActionCode.CANCEL, new CancelAction(this, fbReader));
fbReader.addAction(ActionCode.SHOW_CANCEL_MENU, new ShowCancelMenuAction(this, fbReader));
}
@Override

View file

@ -26,10 +26,10 @@ import android.content.Intent;
import org.geometerplus.fbreader.fbreader.FBAction;
import org.geometerplus.fbreader.fbreader.FBReaderApp;
class CancelAction extends FBAction {
class ShowCancelMenuAction extends FBAction {
private final FBReader myBaseActivity;
CancelAction(FBReader baseActivity, FBReaderApp fbreader) {
ShowCancelMenuAction(FBReader baseActivity, FBReaderApp fbreader) {
super(fbreader);
myBaseActivity = baseActivity;
}

View file

@ -45,7 +45,10 @@ public interface ActionCode {
String VOLUME_KEY_SCROLL_BACK = "volumeKeyScrollBackward";
String SHOW_MENU = "menu";
String SHOW_NAVIGATION = "navigate";
String CANCEL = "cancel";
String EXIT = "exit";
String SHOW_CANCEL_MENU = "cancelMenu";
String ROTATE = "rotate";
String INCREASE_FONT = "increaseFont";
String DECREASE_FONT = "decreaseFont";

View file

@ -0,0 +1,34 @@
/*
* Copyright (C) 2007-2011 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.fbreader.fbreader;
class ExitAction extends FBAction {
ExitAction(FBReaderApp fbreader) {
super(fbreader);
}
public void run() {
if (Reader.getCurrentView() != Reader.BookTextView) {
Reader.showBookTextView();
} else {
Reader.closeWindow();
}
}
}

View file

@ -127,6 +127,8 @@ public final class FBReaderApp extends ZLApplication {
addAction(ActionCode.SWITCH_TO_DAY_PROFILE, new SwitchProfileAction(this, ColorProfile.DAY));
addAction(ActionCode.SWITCH_TO_NIGHT_PROFILE, new SwitchProfileAction(this, ColorProfile.NIGHT));
addAction(ActionCode.EXIT, new ExitAction(this));
BookTextView = new FBView(this);
FootnoteView = new FBView(this);