/** * Encode HTML * * @param html * @param imageGetter * @return html */ public static CharSequence encode(final String html, final ImageGetter imageGetter) { if (TextUtils.isEmpty(html)) { return ""; } return Html.fromHtml(html, imageGetter, TAG_HANDLER); }
@Override public View getView(int position, View convertView, ViewGroup parent) { View row=super.getView(position, convertView, parent); TextView title=row.findViewById(android.R.id.text1); title.setText(Html.fromHtml(getItem(position).title)); return(row); } }
@Override public View getView(int position, View convertView, ViewGroup parent) { View row=super.getView(position, convertView, parent); TextView title=row.findViewById(android.R.id.text1); title.setText(Html.fromHtml(getItem(position).title)); return(row); } }
@Override public View getView(int position, View convertView, ViewGroup parent) { View row=super.getView(position, convertView, parent); TextView title=(TextView)row.findViewById(android.R.id.text1); title.setText(Html.fromHtml(getItem(position).title)); return(row); } }
@Override public View getView(int position, View convertView, ViewGroup parent) { View row=super.getView(position, convertView, parent); TextView title=(TextView)row.findViewById(android.R.id.text1); title.setText(Html.fromHtml(getItem(position).title)); return(row); } }
@Override public View getView(int position, View convertView, ViewGroup parent) { View row=super.getView(position, convertView, parent); TextView title=row.findViewById(android.R.id.text1); title.setText(Html.fromHtml(getItem(position).title)); return(row); } }
@Override public View getView(int position, View convertView, ViewGroup parent) { View row=super.getView(position, convertView, parent); TextView title=(TextView)row.findViewById(android.R.id.text1); title.setText(Html.fromHtml(getItem(position).title)); return(row); } }
@Override public View getView(int position, View convertView, ViewGroup parent) { View row=super.getView(position, convertView, parent); TextView title=(TextView)row.findViewById(android.R.id.text1); title.setText(Html.fromHtml(getItem(position).title)); return(row); } }
@Override public View getView(int position, View convertView, ViewGroup parent) { View row=super.getView(position, convertView, parent); TextView title=(TextView)row.findViewById(android.R.id.text1); title.setText(Html.fromHtml(getItem(position).title)); return(row); } }
@Override protected void error(BaseDownloadTask task, Throwable e) { finalCounts++; updateDisplay(Html.fromHtml(String.format("[error] id[%d] %s %s", task.getId(), e, FileDownloadUtils.getStack(e.getStackTrace(), false)))); updateDisplay(String.format("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! %d", (Integer) task.getTag())); }
@Override public View getView(int position, View convertView, ViewGroup parent) { View row=super.getView(position, convertView, parent); TextView title=(TextView)row.findViewById(android.R.id.text1); title.setText(Html.fromHtml(getItem(position).getTitle())); return(row); } }
@Config(maxSdk = M) @Test public void testArraycopyLegacyShort() { //noinspection deprecation Html.fromHtml(HTML_SHORT, null, null); }
@Config(maxSdk = M) @Test public void testArraycopyLegacyLong() { //noinspection deprecation Html.fromHtml(HTML_LONG, null, null); }
/** * this test requires that {@link org.ccil.cowan.tagsoup.HTMLScanner} be instrumented. */ @TargetApi(N) @Config(minSdk = N) @Test public void testArraycopyLong() { Html.fromHtml(HTML_LONG, Html.FROM_HTML_MODE_LEGACY, null, null); }
@Test(expected = NullPointerException.class) public void shouldThrowNullPointerExceptionWhenNullStringEncountered() throws Exception { Html.fromHtml(null); }
@TargetApi(N) @Config(minSdk = N) @Test public void testArraycopyShort() { Html.fromHtml(HTML_SHORT, Html.FROM_HTML_MODE_LEGACY, null, null); }
@Test public void shouldBeAbleToGetTextFromTextViewAfterUsingSetTextWithHtmlDotFromHtml() throws Exception { TextView textView = new TextView(context); textView.setText(Html.fromHtml("<b>some</b> html text")); assertThat(textView.getText().toString()).isEqualTo("some html text"); }
@Test public void shouldBeAbleToGetTextFromEditTextAfterUsingSetTextWithHtmlDotFromHtml() throws Exception { EditText editText = new EditText(context); editText.setText(Html.fromHtml("<b>some</b> html text")); assertThat(editText.getText().toString()).isEqualTo("some html text"); }
@Test public void fromHtml_shouldJustReturnArgByDefault() { String text = "<b>foo</b>"; Spanned spanned = Html.fromHtml(text); assertThat(spanned.toString()).isEqualTo("foo"); }
@Subscribe(threadMode = ThreadMode.MAIN) public void onEventMainThread(TestFinishedEvent event) { Test test = event.test; String text = "<b>" + test.getDisplayName() + "</b><br/>" + // test.getPrimaryResultMicros() + " micro seconds<br/>" + // ((int) test.getPrimaryResultRate()) + "/s<br/>"; if (test.getOtherTestResults() != null) { text += test.getOtherTestResults(); } text += "<br/>----------------<br/>"; textViewResult.append(Html.fromHtml(text)); if (event.isLastEvent) { findViewById(R.id.buttonCancel).setVisibility(View.GONE); findViewById(R.id.textViewTestRunning).setVisibility(View.GONE); findViewById(R.id.buttonKillProcess).setVisibility(View.VISIBLE); } }