mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 10:49:24 +02:00
code simplification
This commit is contained in:
parent
97107959a0
commit
74abbad08a
5 changed files with 9 additions and 11 deletions
|
@ -194,6 +194,7 @@ public final class FBReader extends ZLAndroidActivity {
|
||||||
fbReader.addAction(ActionCode.SHOW_NETWORK_LIBRARY, new ShowNetworkLibraryAction(this, fbReader));
|
fbReader.addAction(ActionCode.SHOW_NETWORK_LIBRARY, new ShowNetworkLibraryAction(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));
|
||||||
|
|
||||||
return fbReader;
|
return fbReader;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,13 +17,17 @@
|
||||||
* 02110-1301, USA.
|
* 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.geometerplus.fbreader.fbreader;
|
package org.geometerplus.android.fbreader;
|
||||||
|
|
||||||
import org.geometerplus.zlibrary.core.dialogs.ZLDialogManager;
|
import org.geometerplus.fbreader.fbreader.FBReaderApp;
|
||||||
|
import org.geometerplus.fbreader.fbreader.FBAction;
|
||||||
|
|
||||||
class SearchAction extends FBAction {
|
class SearchAction extends FBAction {
|
||||||
SearchAction(FBReaderApp fbreader) {
|
private final FBReader myActivity;
|
||||||
|
|
||||||
|
SearchAction(FBReader activity, FBReaderApp fbreader) {
|
||||||
super(fbreader);
|
super(fbreader);
|
||||||
|
myActivity = activity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isVisible() {
|
public boolean isVisible() {
|
||||||
|
@ -31,6 +35,6 @@ class SearchAction extends FBAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
ZLDialogManager.Instance().startSearch();
|
myActivity.onSearchRequested();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,6 @@ public final class FBReaderApp extends ZLApplication {
|
||||||
addAction(ActionCode.DECREASE_FONT, new ChangeFontSizeAction(this, -2));
|
addAction(ActionCode.DECREASE_FONT, new ChangeFontSizeAction(this, -2));
|
||||||
addAction(ActionCode.ROTATE, new RotateAction(this));
|
addAction(ActionCode.ROTATE, new RotateAction(this));
|
||||||
|
|
||||||
addAction(ActionCode.SEARCH, new SearchAction(this));
|
|
||||||
addAction(ActionCode.FIND_NEXT, new FindNextAction(this));
|
addAction(ActionCode.FIND_NEXT, new FindNextAction(this));
|
||||||
addAction(ActionCode.FIND_PREVIOUS, new FindPreviousAction(this));
|
addAction(ActionCode.FIND_PREVIOUS, new FindPreviousAction(this));
|
||||||
addAction(ActionCode.CLEAR_FIND_RESULTS, new ClearFindResultsAction(this));
|
addAction(ActionCode.CLEAR_FIND_RESULTS, new ClearFindResultsAction(this));
|
||||||
|
|
|
@ -45,8 +45,6 @@ public abstract class ZLDialogManager {
|
||||||
|
|
||||||
public abstract void wait(String key, Runnable runnable);
|
public abstract void wait(String key, Runnable runnable);
|
||||||
|
|
||||||
public abstract void startSearch();
|
|
||||||
|
|
||||||
public static String getButtonText(String key) {
|
public static String getButtonText(String key) {
|
||||||
return getResource().getResource("button").getResource(key).getValue();
|
return getResource().getResource("button").getResource(key).getValue();
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,8 +45,4 @@ public class ZLAndroidDialogManager extends ZLDialogManager {
|
||||||
public void wait(String key, Runnable action) {
|
public void wait(String key, Runnable action) {
|
||||||
AndroidUtil.wait(key, action, myActivity);
|
AndroidUtil.wait(key, action, myActivity);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startSearch() {
|
|
||||||
myActivity.onSearchRequested();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue