mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 02:39:23 +02:00
cleanup: unused code has been removed
This commit is contained in:
parent
7defe26255
commit
ee7fcb6413
5 changed files with 7 additions and 30 deletions
|
@ -30,7 +30,7 @@ public class OptionsDialog {
|
|||
private ZLOptionsDialog myDialog;
|
||||
|
||||
public OptionsDialog(FBReaderApp fbreader) {
|
||||
myDialog = ZLDialogManager.Instance().createOptionsDialog("OptionsDialog", null, new OptionsApplyRunnable(fbreader), true);
|
||||
myDialog = ZLDialogManager.Instance().createOptionsDialog("OptionsDialog");
|
||||
|
||||
new FormatOptionsPage(myDialog.createTab("Format"));
|
||||
|
||||
|
@ -55,19 +55,6 @@ public class OptionsDialog {
|
|||
return myDialog;
|
||||
}
|
||||
|
||||
private static class OptionsApplyRunnable implements Runnable {
|
||||
private final FBReaderApp myFBReader;
|
||||
|
||||
public OptionsApplyRunnable(FBReaderApp fbreader) {
|
||||
myFBReader = fbreader;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
myFBReader.clearTextCaches();
|
||||
myFBReader.repaintView();
|
||||
}
|
||||
}
|
||||
|
||||
/*private static class StateOptionEntry extends ZLToggleBooleanOptionEntry {
|
||||
private boolean myState;
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ public abstract class ZLDialogManager {
|
|||
return ourInstance;
|
||||
}
|
||||
|
||||
public abstract ZLOptionsDialog createOptionsDialog(String key, Runnable exitAction, Runnable applyAction, boolean showApplyButton);
|
||||
public abstract ZLOptionsDialog createOptionsDialog(String key);
|
||||
|
||||
public abstract void wait(String key, Runnable runnable);
|
||||
|
||||
|
|
|
@ -26,20 +26,13 @@ import org.geometerplus.zlibrary.core.resources.ZLResource;
|
|||
public abstract class ZLOptionsDialog {
|
||||
private final ZLResource myResource;
|
||||
protected final ArrayList<ZLDialogContent> myTabs = new ArrayList<ZLDialogContent>();
|
||||
protected Runnable myExitAction;
|
||||
protected Runnable myApplyAction;
|
||||
|
||||
protected ZLOptionsDialog(ZLResource resource, Runnable exitAction, Runnable applyAction) {
|
||||
protected ZLOptionsDialog(ZLResource resource) {
|
||||
myResource = resource;
|
||||
myExitAction = exitAction;
|
||||
myApplyAction = applyAction;
|
||||
}
|
||||
|
||||
protected void acceptTab(ZLDialogContent tab) {
|
||||
tab.accept();
|
||||
if (myApplyAction != null) {
|
||||
myApplyAction.run();
|
||||
}
|
||||
}
|
||||
|
||||
protected void resetTab(ZLDialogContent tab) {
|
||||
|
@ -51,9 +44,6 @@ public abstract class ZLOptionsDialog {
|
|||
for (int i = 0; i < size; i++) {
|
||||
myTabs.get(i).accept();
|
||||
}
|
||||
if (myApplyAction != null) {
|
||||
myApplyAction.run();
|
||||
}
|
||||
}
|
||||
|
||||
protected final String getCaption() {
|
||||
|
|
|
@ -38,8 +38,8 @@ public class ZLAndroidDialogManager extends ZLDialogManager {
|
|||
myActivity = activity;
|
||||
}
|
||||
|
||||
public ZLOptionsDialog createOptionsDialog(String key, Runnable exitAction, Runnable applyAction, boolean showApplyButton) {
|
||||
return new ZLAndroidOptionsDialog(myActivity, getResource().getResource(key), exitAction, applyAction);
|
||||
public ZLOptionsDialog createOptionsDialog(String key) {
|
||||
return new ZLAndroidOptionsDialog(myActivity, getResource().getResource(key));
|
||||
}
|
||||
|
||||
public void wait(String key, Runnable action) {
|
||||
|
|
|
@ -34,8 +34,8 @@ class ZLAndroidOptionsDialog extends ZLOptionsDialog {
|
|||
private final String myCaption;
|
||||
private final Activity myMainActivity;
|
||||
|
||||
ZLAndroidOptionsDialog(Activity activity, ZLResource resource, Runnable exitAction, Runnable applyAction) {
|
||||
super(resource, exitAction, applyAction);
|
||||
ZLAndroidOptionsDialog(Activity activity, ZLResource resource) {
|
||||
super(resource);
|
||||
myCaption = resource.getResource("title").getValue();
|
||||
myMainActivity = activity;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue