android Programming Glossary: sb.setspan
Android - How to make all lines in an edittext underlined? http://stackoverflow.com/questions/10361755/android-how-to-make-all-lines-in-an-edittext-underlined SpannableStringBuilder sb new SpannableStringBuilder text sb.setSpan new UnderlineSpan 0 text.length Spannable.SPAN_EXCLUSIVE_EXCLUSIVE..
Contact Bubble EditText http://stackoverflow.com/questions/10812316/contact-bubble-edittext sb new SpannableStringBuilder sb.append some sample text sb.setSpan new BubbleSpan getApplicationContext 0 6 Spannable.SPAN_EXCLUSIVE_EXCLUSIVE.. bd.getIntrinsicHeight sb.append contactName sb.setSpan new ImageSpan bd sb.length contactName.length 1 sb.length 1..
new Selectable TextView in android 3 (API <=11) component http://stackoverflow.com/questions/18042308/new-selectable-textview-in-android-3-api-11-component start SelectableTextView.this.textSelectedEnd end sb.setSpan bgc start end Spannable.SPAN_INCLUSIVE_INCLUSIVE sb.setSpan.. bgc start end Spannable.SPAN_INCLUSIVE_INCLUSIVE sb.setSpan textColor start end Spannable.SPAN_INCLUSIVE_INCLUSIVE setText..
Android: Coloring part of a string using TextView.setText()? http://stackoverflow.com/questions/4897349/android-coloring-part-of-a-string-using-textview-settext android.graphics.Typeface.BOLD Span to make text bold sb.setSpan fcs 0 4 Spannable.SPAN_INCLUSIVE_INCLUSIVE Set the text color.. Set the text color for first 4 characters sb.setSpan bss 0 4 Spannable.SPAN_INCLUSIVE_INCLUSIVE make them also bold..
How to add animated emoticon in TextView or EditText in Android http://stackoverflow.com/questions/8632801/how-to-add-animated-emoticon-in-textview-or-edittext-in-android by animated gif String dummyText dummy sb.append dummyText sb.setSpan new AnimatedImageSpan new AnimatedGifDrawable getAssets .open..
Android - How to make all lines in an edittext underlined? http://stackoverflow.com/questions/10361755/android-how-to-make-all-lines-in-an-edittext-underlined EditText findViewById R.id.underlinespan_edittext SpannableStringBuilder sb new SpannableStringBuilder text sb.setSpan new UnderlineSpan 0 text.length Spannable.SPAN_EXCLUSIVE_EXCLUSIVE underlineSpanEditText.setText sb EditText htmlUnderlineEditText..
Contact Bubble EditText http://stackoverflow.com/questions/10812316/contact-bubble-edittext Editable e tv.getEditableText final SpannableStringBuilder sb new SpannableStringBuilder sb.append some sample text sb.setSpan new BubbleSpan getApplicationContext 0 6 Spannable.SPAN_EXCLUSIVE_EXCLUSIVE e.append sb However instead of the oval shape.. convertViewToDrawable tv bd.setBounds 0 0 bd.getIntrinsicWidth bd.getIntrinsicHeight sb.append contactName sb.setSpan new ImageSpan bd sb.length contactName.length 1 sb.length 1 Spannable.SPAN_EXCLUSIVE_EXCLUSIVE to_input.setText sb public..
new Selectable TextView in android 3 (API <=11) component http://stackoverflow.com/questions/18042308/new-selectable-textview-in-android-3-api-11-component 0 end curectStartEnd 1 SelectableTextView.this.textSelectedStart start SelectableTextView.this.textSelectedEnd end sb.setSpan bgc start end Spannable.SPAN_INCLUSIVE_INCLUSIVE sb.setSpan textColor start end Spannable.SPAN_INCLUSIVE_INCLUSIVE setText.. start SelectableTextView.this.textSelectedEnd end sb.setSpan bgc start end Spannable.SPAN_INCLUSIVE_INCLUSIVE sb.setSpan textColor start end Spannable.SPAN_INCLUSIVE_INCLUSIVE setText sb private int curectStartEnd String text int start int end..
Android: Coloring part of a string using TextView.setText()? http://stackoverflow.com/questions/4897349/android-coloring-part-of-a-string-using-textview-settext text color to some RGB value final StyleSpan bss new StyleSpan android.graphics.Typeface.BOLD Span to make text bold sb.setSpan fcs 0 4 Spannable.SPAN_INCLUSIVE_INCLUSIVE Set the text color for first 4 characters sb.setSpan bss 0 4 Spannable.SPAN_INCLUSIVE_INCLUSIVE..
How to add animated emoticon in TextView or EditText in Android http://stackoverflow.com/questions/8632801/how-to-add-animated-emoticon-in-textview-or-edittext-in-android sb new SpannableStringBuilder sb.append Text followed by animated gif String dummyText dummy sb.append dummyText sb.setSpan new AnimatedImageSpan new AnimatedGifDrawable getAssets .open agif.gif new AnimatedGifDrawable.UpdateListener @Override..
|