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:
parent
ee8fc1bb92
commit
db42d8afca
6 changed files with 44 additions and 5 deletions
|
@ -2,7 +2,7 @@
|
|||
<keymap>
|
||||
<binding key="<VolumeDown>" action="volumeKeyScrollForward"/>
|
||||
<binding key="<VolumeUp>" action="volumeKeyScrollBackward"/>
|
||||
<binding key="<Back>" action="cancel"/>
|
||||
<binding key="<Back>" action="cancelMenu"/>
|
||||
<binding key="<Enter>" action="processHyperlink"/>
|
||||
<binding key="<PadCenter>" action="processHyperlink"/>
|
||||
</keymap>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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";
|
||||
|
|
34
src/org/geometerplus/fbreader/fbreader/ExitAction.java
Normal file
34
src/org/geometerplus/fbreader/fbreader/ExitAction.java
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue