title: Evenly distribute textviews across linear layout horizontally and wrap content
body: <p>I want to programmatically add some textviews inside a linear layout. I want these textviews to evenly distribute across the width of the linear layout and i want the textviews to wrap their content.</p>
  
  <p>I create the textviews like that, but they dont wrap their content.</p>
  
  <pre><code>    LinearLayout linearLayout = new LinearLayout(mContext);
      LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
      params.gravity = Gravity.BOTTOM;
      linearLayout.setOrientation(LinearLayout.HORIZONTAL);
  
      params.setMargins(40, 0, 0, 0);
      linearLayout.setLayoutParams(params);
     // linearLayout.setGravity(Gravity.BOTTOM);
  
      linearLayout.setOrientation(LinearLayout.HORIZONTAL);
      for(String label: labels) {
          TextView textView = new TextView(mContext);
          textView.setText(label.trim());
          textView.setTextSize(13);
          textView.setBackgroundColor(Color.GREEN);
          textView.setTextColor(R.color.labels_color);
          LinearLayout.LayoutParams mlp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1f);
          mlp.setMargins(0,0,20,0);
  
          textView.setLayoutParams(mlp);
          linearLayout.addView(textView);
      }
      chartWrapper.addView(linearLayout);
  </code></pre>