title: How to dynamically add suggestions (views) and be able to control the textView in it
body: <p>I have a fragment in my app that is a basic chatbot. For that chatbot, I want to be able to serve suggestions of replies the user can reply. </p>
  
  <p><a href="https://i.stack.imgur.com/xSlxQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xSlxQ.png" alt="enter image description here"></a></p>
  
  <p>I have layout of the reply I want in an xml file.</p>
  
  <pre><code>&lt;LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:orientation="vertical"&gt;
  
  &lt;com.google.android.material.card.MaterialCardView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginTop="4dp"
      android:layout_marginEnd="12dp"
      android:layout_marginStart="12dp"
      android:layout_gravity="end"
      android:padding="4dp"
      app:strokeColor="@color/suggestion_border"
      app:strokeWidth="2dp"
      app:cardElevation="0dp"
      app:cardCornerRadius="8dp"&gt;
  
      &lt;TextView
          android:id="@+id/chat_suggestion"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_margin="8dp"
          android:textSize="18dp"
          android:textColor="@color/chat_text_color"
          android:text="Suggestion"/&gt;
  &lt;/com.google.android.material.card.MaterialCardView&gt;
  </code></pre>
  
  <p></p>
  
  <p>While produces something like this</p>
  
  <p><a href="https://i.stack.imgur.com/ZcJGd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZcJGd.png" alt="enter image description here"></a></p>
  
  <p>and I have a incoming_msg.xml</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:orientation="horizontal"&gt;
  
  &lt;TextView
      android:id="@+id/chat_message"
      // irrelevent
      android:textSize="18sp" /&gt;
  
  &lt;TextView
      android:id="@+id/chat_time"
      // irrelevent
      android:text="12:90 PM"
      android:textColor="#b4b2b2"
      android:textSize="12sp" /&gt;
  
  &lt;ScrollView
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_below="@id/chat_time"&gt;
      &lt;LinearLayout
          android:id="@+id/suggestion_container"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="horizontal"&gt;
  
      &lt;/LinearLayout&gt;
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p></p>
  
  <p>And because the conversation fragment is a recycler view. I have a <code>onBindViewHolder</code></p>
  
  <pre><code>public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
          DateFormat df = DateFormat.getTimeInstance(DateFormat.SHORT);
  
          switch (holder.getItemViewType()) {
              case 1:
                  IncomingMsg iM = (IncomingMsg) holder;
                  iM.msg.setText(msg.get(position).getMessage());
                  iM.dt.setText(df.format(msg.get(position).getTime()));
  
  
                  if (!msg.get(position).getSuggest().isEmpty()) {
                      if (iM.s.getChildCount() != msg.get(position).getSuggest().size()) {
                          for (Suggestion tempSuggestion: msg.get(position).getSuggest()) {
                              if (tempSuggestion.isWithImage()) {
                                  // TODO
                              } else {
                                  iM.s.addView(getLayoutInflater().inflate(R.layout.outgoing_suggestion, iM.p));
                              }
                          }
                      }
                  }
                  break;
          }
      }
  </code></pre>
  
  <p>And at this point, I do not know how to continue, as I couldn't be able to scroll the suggestion list sideway and I couldn't control the text shown in the suggestion. </p>