Rename xml files for edit / preview fragments

This commit is contained in:
stefan-niedermann 2020-01-19 11:13:09 +01:00
parent 71458afd8f
commit b9fb4cf243
5 changed files with 7 additions and 6 deletions

View file

@ -107,7 +107,7 @@ public class NoteEditFragment extends BaseNoteFragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.activity_edit, container, false);
return inflater.inflate(R.layout.fragment_note_edit, container, false);
}
@Override

View file

@ -38,7 +38,7 @@ public class NotePreviewFragment extends BaseNoteFragment {
private String changedText;
MarkdownProcessor markdownProcessor;
private MarkdownProcessor markdownProcessor;
@BindView(R.id.swiperefreshlayout)
SwipeRefreshLayout swipeRefreshLayout;
@ -65,14 +65,14 @@ public class NotePreviewFragment extends BaseNoteFragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.activity_single_note, container, false);
return inflater.inflate(R.layout.fragment_note_preview, container, false);
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
ButterKnife.bind(this, Objects.requireNonNull(getView()));
markdownProcessor = new MarkdownProcessor(getActivity());
markdownProcessor = new MarkdownProcessor(Objects.requireNonNull(getActivity()));
markdownProcessor.factory(TextFactory.create());
markdownProcessor.config(
MarkDownUtil.getMarkDownConfiguration(noteContent.getContext())
@ -110,7 +110,7 @@ public class NotePreviewFragment extends BaseNoteFragment {
noteContent.setText(markdownProcessor.parse(changedText));
saveNote(null);
} catch (IndexOutOfBoundsException e) {
Toast.makeText(getActivity(), "Checkbox could not be toggled.", Toast.LENGTH_SHORT).show();
Toast.makeText(getActivity(), R.string.checkbox_could_not_be_toggled, Toast.LENGTH_SHORT).show();
e.printStackTrace();
}
return line;
@ -167,7 +167,7 @@ public class NotePreviewFragment extends BaseNoteFragment {
}
});
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext());
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(Objects.requireNonNull(getActivity()).getApplicationContext());
noteContent.setTextSize(TypedValue.COMPLEX_UNIT_PX, getFontSizeFromPreferences(sp));
if (sp.getBoolean(getString(R.string.pref_key_font), false)) {
noteContent.setTypeface(Typeface.MONOSPACE);

View file

@ -140,6 +140,7 @@
<string name="simple_more">More</string>
<string name="simple_move">Move</string>
<string name="error_files_app_version_too_old">Is your files app version up to date?</string>
<string name="checkbox_could_not_be_toggled">Checkbox could not be toggled.</string>
<!-- Array: note modes -->
<string-array name="noteMode_entries">