Refactoring

This commit is contained in:
M66B
2022-10-07 17:19:30 +02:00
parent 77dbd3dbc7
commit ae960092bd
5 changed files with 56 additions and 45 deletions

View File

@@ -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_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.insertIcons(context);
@@ -250,10 +248,6 @@ public class StyleHelper {
return setMark(item);
} else if (groupId == R.id.group_style_strikethrough) {
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) {
return setCode(item);
} else if (groupId == R.id.group_style_clear) {
@@ -495,13 +489,6 @@ public class StyleHelper {
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) {
Log.breadcrumb("style", "action", "code");
_setSize(HtmlHelper.FONT_SMALL);