mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 10:49:24 +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;
|
private ZLOptionsDialog myDialog;
|
||||||
|
|
||||||
public OptionsDialog(FBReaderApp fbreader) {
|
public OptionsDialog(FBReaderApp fbreader) {
|
||||||
myDialog = ZLDialogManager.Instance().createOptionsDialog("OptionsDialog", null, new OptionsApplyRunnable(fbreader), true);
|
myDialog = ZLDialogManager.Instance().createOptionsDialog("OptionsDialog");
|
||||||
|
|
||||||
new FormatOptionsPage(myDialog.createTab("Format"));
|
new FormatOptionsPage(myDialog.createTab("Format"));
|
||||||
|
|
||||||
|
@ -55,19 +55,6 @@ public class OptionsDialog {
|
||||||
return myDialog;
|
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 static class StateOptionEntry extends ZLToggleBooleanOptionEntry {
|
||||||
private boolean myState;
|
private boolean myState;
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ public abstract class ZLDialogManager {
|
||||||
return ourInstance;
|
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);
|
public abstract void wait(String key, Runnable runnable);
|
||||||
|
|
||||||
|
|
|
@ -26,20 +26,13 @@ import org.geometerplus.zlibrary.core.resources.ZLResource;
|
||||||
public abstract class ZLOptionsDialog {
|
public abstract class ZLOptionsDialog {
|
||||||
private final ZLResource myResource;
|
private final ZLResource myResource;
|
||||||
protected final ArrayList<ZLDialogContent> myTabs = new ArrayList<ZLDialogContent>();
|
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;
|
myResource = resource;
|
||||||
myExitAction = exitAction;
|
|
||||||
myApplyAction = applyAction;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void acceptTab(ZLDialogContent tab) {
|
protected void acceptTab(ZLDialogContent tab) {
|
||||||
tab.accept();
|
tab.accept();
|
||||||
if (myApplyAction != null) {
|
|
||||||
myApplyAction.run();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void resetTab(ZLDialogContent tab) {
|
protected void resetTab(ZLDialogContent tab) {
|
||||||
|
@ -51,9 +44,6 @@ public abstract class ZLOptionsDialog {
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
myTabs.get(i).accept();
|
myTabs.get(i).accept();
|
||||||
}
|
}
|
||||||
if (myApplyAction != null) {
|
|
||||||
myApplyAction.run();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final String getCaption() {
|
protected final String getCaption() {
|
||||||
|
|
|
@ -38,8 +38,8 @@ public class ZLAndroidDialogManager extends ZLDialogManager {
|
||||||
myActivity = activity;
|
myActivity = activity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ZLOptionsDialog createOptionsDialog(String key, Runnable exitAction, Runnable applyAction, boolean showApplyButton) {
|
public ZLOptionsDialog createOptionsDialog(String key) {
|
||||||
return new ZLAndroidOptionsDialog(myActivity, getResource().getResource(key), exitAction, applyAction);
|
return new ZLAndroidOptionsDialog(myActivity, getResource().getResource(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void wait(String key, Runnable action) {
|
public void wait(String key, Runnable action) {
|
||||||
|
|
|
@ -34,8 +34,8 @@ class ZLAndroidOptionsDialog extends ZLOptionsDialog {
|
||||||
private final String myCaption;
|
private final String myCaption;
|
||||||
private final Activity myMainActivity;
|
private final Activity myMainActivity;
|
||||||
|
|
||||||
ZLAndroidOptionsDialog(Activity activity, ZLResource resource, Runnable exitAction, Runnable applyAction) {
|
ZLAndroidOptionsDialog(Activity activity, ZLResource resource) {
|
||||||
super(resource, exitAction, applyAction);
|
super(resource);
|
||||||
myCaption = resource.getResource("title").getValue();
|
myCaption = resource.getResource("title").getValue();
|
||||||
myMainActivity = activity;
|
myMainActivity = activity;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue