|
|
@ -213,8 +213,6 @@ public class StyleHelper {
|
|
|
|
popupMenu.getMenu().findItem(R.id.menu_style_indentation_increase).setEnabled(maxLevel == null);
|
|
|
|
popupMenu.getMenu().findItem(R.id.menu_style_indentation_increase).setEnabled(maxLevel == null);
|
|
|
|
popupMenu.getMenu().findItem(R.id.menu_style_indentation_decrease).setEnabled(indents.length > 0);
|
|
|
|
popupMenu.getMenu().findItem(R.id.menu_style_indentation_decrease).setEnabled(indents.length > 0);
|
|
|
|
|
|
|
|
|
|
|
|
popupMenu.getMenu().findItem(R.id.menu_style_parenthesis).setEnabled(BuildConfig.DEBUG);
|
|
|
|
|
|
|
|
popupMenu.getMenu().findItem(R.id.menu_style_quotes).setEnabled(BuildConfig.DEBUG);
|
|
|
|
|
|
|
|
popupMenu.getMenu().findItem(R.id.menu_style_code).setEnabled(BuildConfig.DEBUG);
|
|
|
|
popupMenu.getMenu().findItem(R.id.menu_style_code).setEnabled(BuildConfig.DEBUG);
|
|
|
|
|
|
|
|
|
|
|
|
popupMenu.insertIcons(context);
|
|
|
|
popupMenu.insertIcons(context);
|
|
|
@ -250,10 +248,6 @@ public class StyleHelper {
|
|
|
|
return setMark(item);
|
|
|
|
return setMark(item);
|
|
|
|
} else if (groupId == R.id.group_style_strikethrough) {
|
|
|
|
} else if (groupId == R.id.group_style_strikethrough) {
|
|
|
|
return setStrikeThrough(item);
|
|
|
|
return setStrikeThrough(item);
|
|
|
|
} else if (groupId == R.id.group_style_parenthesis) {
|
|
|
|
|
|
|
|
return surround(item, "(", ")");
|
|
|
|
|
|
|
|
} else if (groupId == R.id.group_style_quotes) {
|
|
|
|
|
|
|
|
return surround(item, "\"", "\"");
|
|
|
|
|
|
|
|
} else if (groupId == R.id.group_style_code) {
|
|
|
|
} else if (groupId == R.id.group_style_code) {
|
|
|
|
return setCode(item);
|
|
|
|
return setCode(item);
|
|
|
|
} else if (groupId == R.id.group_style_clear) {
|
|
|
|
} else if (groupId == R.id.group_style_clear) {
|
|
|
@ -495,13 +489,6 @@ public class StyleHelper {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private boolean surround(MenuItem item, String before, String after) {
|
|
|
|
|
|
|
|
Log.breadcrumb("style", "action", "parenthesis");
|
|
|
|
|
|
|
|
edit.insert(end, after);
|
|
|
|
|
|
|
|
edit.insert(start, before);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean setCode(MenuItem item) {
|
|
|
|
private boolean setCode(MenuItem item) {
|
|
|
|
Log.breadcrumb("style", "action", "code");
|
|
|
|
Log.breadcrumb("style", "action", "code");
|
|
|
|
_setSize(HtmlHelper.FONT_SMALL);
|
|
|
|
_setSize(HtmlHelper.FONT_SMALL);
|
|
|
|