|
|
@ -72,6 +72,7 @@ public class ActivityCode extends ActivityBase {
|
|
|
|
private boolean sanitize = false;
|
|
|
|
private boolean sanitize = false;
|
|
|
|
private boolean lines = false;
|
|
|
|
private boolean lines = false;
|
|
|
|
private boolean links = false;
|
|
|
|
private boolean links = false;
|
|
|
|
|
|
|
|
private boolean pretty = true;
|
|
|
|
private String searching = null;
|
|
|
|
private String searching = null;
|
|
|
|
|
|
|
|
|
|
|
|
private static final int REQUEST_SAVE = 1;
|
|
|
|
private static final int REQUEST_SAVE = 1;
|
|
|
@ -85,6 +86,7 @@ public class ActivityCode extends ActivityBase {
|
|
|
|
sanitize = savedInstanceState.getBoolean("fair:sanitize");
|
|
|
|
sanitize = savedInstanceState.getBoolean("fair:sanitize");
|
|
|
|
lines = savedInstanceState.getBoolean("fair:lines");
|
|
|
|
lines = savedInstanceState.getBoolean("fair:lines");
|
|
|
|
links = savedInstanceState.getBoolean("fair:links");
|
|
|
|
links = savedInstanceState.getBoolean("fair:links");
|
|
|
|
|
|
|
|
pretty = savedInstanceState.getBoolean("fair:pretty");
|
|
|
|
searching = savedInstanceState.getString("fair:searching");
|
|
|
|
searching = savedInstanceState.getString("fair:searching");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -159,6 +161,7 @@ public class ActivityCode extends ActivityBase {
|
|
|
|
outState.putBoolean("fair:sanitize", sanitize);
|
|
|
|
outState.putBoolean("fair:sanitize", sanitize);
|
|
|
|
outState.putBoolean("fair:lines", lines);
|
|
|
|
outState.putBoolean("fair:lines", lines);
|
|
|
|
outState.putBoolean("fair:links", links);
|
|
|
|
outState.putBoolean("fair:links", links);
|
|
|
|
|
|
|
|
outState.putBoolean("fair:pretty", pretty);
|
|
|
|
outState.putString("fair:searching", searching);
|
|
|
|
outState.putString("fair:searching", searching);
|
|
|
|
super.onSaveInstanceState(outState);
|
|
|
|
super.onSaveInstanceState(outState);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -227,7 +230,7 @@ public class ActivityCode extends ActivityBase {
|
|
|
|
|
|
|
|
|
|
|
|
menu.findItem(R.id.menu_lines).setChecked(lines);
|
|
|
|
menu.findItem(R.id.menu_lines).setChecked(lines);
|
|
|
|
menu.findItem(R.id.menu_links).setChecked(links);
|
|
|
|
menu.findItem(R.id.menu_links).setChecked(links);
|
|
|
|
menu.findItem(R.id.menu_check_html).setVisible(BuildConfig.DEBUG || debug);
|
|
|
|
menu.findItem(R.id.menu_pretty).setChecked(pretty);
|
|
|
|
|
|
|
|
|
|
|
|
return super.onPrepareOptionsMenu(menu);
|
|
|
|
return super.onPrepareOptionsMenu(menu);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -258,6 +261,11 @@ public class ActivityCode extends ActivityBase {
|
|
|
|
item.setChecked(links);
|
|
|
|
item.setChecked(links);
|
|
|
|
load();
|
|
|
|
load();
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
|
|
|
|
} else if (itemId == R.id.menu_pretty) {
|
|
|
|
|
|
|
|
pretty = !pretty;
|
|
|
|
|
|
|
|
item.setChecked(pretty);
|
|
|
|
|
|
|
|
load();
|
|
|
|
|
|
|
|
return true;
|
|
|
|
} else if (itemId == R.id.menu_check_html) {
|
|
|
|
} else if (itemId == R.id.menu_check_html) {
|
|
|
|
checkHtml();
|
|
|
|
checkHtml();
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
@ -303,6 +311,7 @@ public class ActivityCode extends ActivityBase {
|
|
|
|
args.putLong("id", id);
|
|
|
|
args.putLong("id", id);
|
|
|
|
args.putCharSequence("selected", selected);
|
|
|
|
args.putCharSequence("selected", selected);
|
|
|
|
args.putBoolean("sanitize", sanitize);
|
|
|
|
args.putBoolean("sanitize", sanitize);
|
|
|
|
|
|
|
|
args.putBoolean("pretty", pretty);
|
|
|
|
|
|
|
|
|
|
|
|
new SimpleTask<String>() {
|
|
|
|
new SimpleTask<String>() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -320,6 +329,7 @@ public class ActivityCode extends ActivityBase {
|
|
|
|
long id = args.getLong("id");
|
|
|
|
long id = args.getLong("id");
|
|
|
|
CharSequence selected = args.getCharSequence("selected");
|
|
|
|
CharSequence selected = args.getCharSequence("selected");
|
|
|
|
boolean sanitize = args.getBoolean("sanitize");
|
|
|
|
boolean sanitize = args.getBoolean("sanitize");
|
|
|
|
|
|
|
|
boolean pretty = args.getBoolean("pretty");
|
|
|
|
|
|
|
|
|
|
|
|
DB db = DB.getInstance(context);
|
|
|
|
DB db = DB.getInstance(context);
|
|
|
|
EntityMessage message = db.message().getMessage(id);
|
|
|
|
EntityMessage message = db.message().getMessage(id);
|
|
|
@ -354,8 +364,8 @@ public class ActivityCode extends ActivityBase {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
d.outputSettings()
|
|
|
|
d.outputSettings()
|
|
|
|
.prettyPrint(true)
|
|
|
|
.prettyPrint(pretty)
|
|
|
|
.outline(true)
|
|
|
|
.outline(pretty)
|
|
|
|
.indentAmount(1);
|
|
|
|
.indentAmount(1);
|
|
|
|
|
|
|
|
|
|
|
|
if (selected == null)
|
|
|
|
if (selected == null)
|
|
|
@ -421,6 +431,10 @@ public class ActivityCode extends ActivityBase {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onExecuted(Bundle args, ParseErrorList errors) {
|
|
|
|
protected void onExecuted(Bundle args, ParseErrorList errors) {
|
|
|
|
|
|
|
|
lines = true;
|
|
|
|
|
|
|
|
pretty = false;
|
|
|
|
|
|
|
|
load();
|
|
|
|
|
|
|
|
|
|
|
|
SpannableStringBuilderEx ssb = new SpannableStringBuilderEx();
|
|
|
|
SpannableStringBuilderEx ssb = new SpannableStringBuilderEx();
|
|
|
|
ssb.append("Errors: ")
|
|
|
|
ssb.append("Errors: ")
|
|
|
|
.append(Integer.toString(errors.size()))
|
|
|
|
.append(Integer.toString(errors.size()))
|
|
|
|