/** * @see #setMarkdown(TextView, SpannableConfiguration, String) * @since 1.0.0 */ public static void setMarkdown(@NonNull TextView view, @NonNull String markdown) { setMarkdown(view, SpannableConfiguration.create(view.getContext()), markdown); }
@Override public void setMarkdown(@Nullable SpannableConfiguration configuration, @Nullable String markdown) { this.markdown = markdown; if (configuration == null) { if (this.configuration == null) { if (provider != null) { this.configuration = provider.provide(textView.getContext()); } else { this.configuration = SpannableConfiguration.create(textView.getContext()); } } configuration = this.configuration; } Markwon.setMarkdown(textView, configuration, markdown); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_faq); ButterKnife.bind(this, this); try (InputStream inputStream = getResources().openRawResource(R.raw.faq)) { String markdown = IOUtils.toString(inputStream, StandardCharsets.UTF_8); Markwon.setMarkdown(faqText, markdown); } catch (IOException e) { Timber.e(e); } } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_changelog); ButterKnife.bind(this, this); try (InputStream inputStream = getResources().openRawResource(R.raw.changelog)) { String markdown = IOUtils.toString(inputStream, StandardCharsets.UTF_8); Markwon.setMarkdown(changelogText, markdown); } catch (IOException e) { Timber.e(e); } } }