Refactoring

This commit is contained in:
M66B
2020-11-12 15:08:34 +01:00
parent 42f7cd6444
commit f748c3717c
4 changed files with 13 additions and 12 deletions

View File

@@ -1441,7 +1441,7 @@ public class FragmentCompose extends FragmentBase {
onMenuAnswer();
return true;
case R.id.menu_clear:
StyleHelper.apply(R.id.menu_clear, null, etBody);
StyleHelper.apply(R.id.menu_clear, getViewLifecycleOwner(), null, etBody);
return true;
case R.id.menu_legend:
onMenuLegend();
@@ -1718,7 +1718,7 @@ public class FragmentCompose extends FragmentBase {
private boolean onActionStyle(int action, View anchor) {
Log.i("Style action=" + action);
return StyleHelper.apply(action, anchor, etBody);
return StyleHelper.apply(action, getViewLifecycleOwner(), anchor, etBody);
}
private void onActionRecordAudio() {
@@ -3063,7 +3063,7 @@ public class FragmentCompose extends FragmentBase {
int start = args.getInt("start");
int end = args.getInt("end");
etBody.setSelection(start, end);
StyleHelper.apply(R.id.menu_link, null, etBody, link);
StyleHelper.apply(R.id.menu_link, getViewLifecycleOwner(), null, etBody, link);
}
private void onActionDiscardConfirmed() {
@@ -5253,17 +5253,17 @@ public class FragmentCompose extends FragmentBase {
return true;
case KeyEvent.KEYCODE_B:
if (etBody.hasSelection())
return StyleHelper.apply(R.id.menu_bold, null, etBody);
return StyleHelper.apply(R.id.menu_bold, getViewLifecycleOwner(), null, etBody);
else
return false;
case KeyEvent.KEYCODE_I:
if (etBody.hasSelection())
return StyleHelper.apply(R.id.menu_italic, null, etBody);
return StyleHelper.apply(R.id.menu_italic, getViewLifecycleOwner(), null, etBody);
else
return false;
case KeyEvent.KEYCODE_U:
if (etBody.hasSelection())
return StyleHelper.apply(R.id.menu_underline, null, etBody);
return StyleHelper.apply(R.id.menu_underline, getViewLifecycleOwner(), null, etBody);
else
return false;
}