@Override public void updateEditorText(String newEditorText, @Nullable INote note) { // THIS METHOD SHOULD BE CALLED WHEN THE USER EDITS A NOTE // THE NOTE ID IS PROVIDED HERE. // RETURN THE NOTE ID AS A PARAMETER WITH THE CALLBACK METHOD // onSubmitClicked(text, type, noteId) TO NOTIFY APP TO MODIFY // EXISTING NOTE. // TODO: MICAH delegate method awesomeTextViewHandler.setText(note.getNoteText()); noteText.setTag(note); }
@Override public void onViewCreated(View view, Bundle savedInstanceState) { // during super.onViewCreated()--Sanitizer is instantiated super.onViewCreated(view, savedInstanceState); confirmHostFragmentHasNecessaryCallbacks(); ButterKnife.inject(this, view); setupSpinner(); setOnClicks(); awesomeTextViewHandler = new AwesomeTextHandler(); awesomeTextViewHandler .addViewSpanRenderer(SCRIPTURE_PATTERN, new ScriptureSpanRenderer()) .setView(noteText); }
@Override public void onInjectScriptureFromPicker(IScripture scripture) { int book = scripture.getBook(); int chapter = scripture.getChapter(); int[] verses = scripture.getVerses(); String startTag = "@" + SCRIPTURE_START_TAG; startTag = startTag.replace("I<", String.valueOf(book) + " " + String.valueOf(chapter) + " "); StringBuilder tagBuilder = new StringBuilder(startTag); for (int i = 0; i < verses.length; i++) { tagBuilder.append(String.valueOf(verses[i]) + " "); } tagBuilder.append("<").append(getNiceName(scripture)).append(SCRIPTURE_END_TAG); awesomeTextViewHandler.setText(noteText.getText() + tagBuilder.toString()); }