title: Adding multiple smiles in TextView using ImageSpan
body: <p>I am trying to add multiple smiles in textview using this code.<br>
  This is my TextView.</p>
  
  <pre><code>&lt;TextView
          android:id="@+id/textViewId"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:bufferType="spannable" /&gt;
  </code></pre>
  
  <p>And this is add smiley function.</p>
  
  <pre><code>public void addSmily() {
          int resource  = R.drawable.smily ;
  
          Spannable spannable = Spannable.Factory.getInstance().newSpannable(" ");
  
          Drawable d = ContextCompat.getDrawable(this, resource);
          d.setBounds(0, 0, 40, 40);
          ImageSpan smilySpan = new ImageSpan(d, ImageSpan.ALIGN_BASELINE);
  
          spannable.setSpan(smilySpan, spannable.length()-1, spannable.length(), 0);
  
          sendText.append(spannable);
  }
  </code></pre>
  
  <p>Smiles are adding perfectly but the problem is when I add lots of smiles did not fit in a single line then the first line of smiles become invisible and they start from the 2nd line.</p>
  
  <p><a href="https://i.stack.imgur.com/AOk6o.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AOk6o.gif" alt="App Privew"></a>
  This is what happening. Plz, someone help me.</p>