Skip to content

Commit 90657ba

Browse files
committed
fix: show text in markdownm format inside view
1 parent b96d81c commit 90657ba

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/src/main/java/com/tiagodanin/example/sqlnotes/pages/ViewNoteActivity.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import com.tiagodanin.example.sqlnotes.model.Note;
1212
import com.tiagodanin.example.sqlnotes.utils.DatabaseHelper;
1313

14+
import io.noties.markwon.Markwon;
15+
1416
public class ViewNoteActivity extends AppCompatActivity {
1517

1618
@Override
@@ -19,6 +21,8 @@ protected void onCreate(Bundle savedInstanceState) {
1921
setContentView(R.layout.activity_view_note);
2022
setTitle(getString(R.string.titlePageNote));
2123

24+
Markwon markdown = Markwon.create(this);
25+
2226
DatabaseHelper database = new DatabaseHelper(this);
2327

2428
Intent intent = getIntent();
@@ -34,6 +38,6 @@ protected void onCreate(Bundle savedInstanceState) {
3438
colorView.setBackgroundColor(note.getColor());
3539
createdText.setText(String.format(getString(R.string.createdAtLabel), note.getTextDataCreated()));
3640
updatedText.setText(String.format(getString(R.string.updatedAtLabel), note.getTextDateUpdated()));
37-
noteText.setText(note.getText());
41+
markdown.setMarkdown(noteText, note.getText());
3842
}
3943
}

0 commit comments

Comments
 (0)