title: AutoRisezeTextView doesn't auto resize in the first time
body: <ul>
  <li>I am trying to use AutoResizeTextView on a simple activity, but it fails on the first go. If the button is touched to auto resize there is no problem. But, the thing is, i need it to be resized when the activity is first created.</li>
  <li>Here is the list of things i have tried: Created AutoRiseTextView in xml as a CustomView. Called "show_the_text" method twice on the start. Called the method twice with different texts. Moved container decleration to inside of onCreate. Used RelativeLayout insted of FrameLayout. Created a temporary TextView inside of FrameLayout with text in it.</li>
  <li>I run the application on API23 emulator and API21 phone but result is the same.</li>
  <li>I have to say that i am a begginer in programming. Any ideas are welcome.</li>
  <li>And this is the source code of AutoResizeTextView i used: <a href="https://github.com/AndroidDeveloperLB/AutoFitTextView" rel="nofollow">https://github.com/AndroidDeveloperLB/AutoFitTextView</a></li>
  </ul>
  
  <p><a href="http://i.stack.imgur.com/HdqUz.png" rel="nofollow">Application Screenshots</a></p>
  
  <pre><code>    package com.kr.hakan.myapplication;
  
      import android.graphics.Color;
      import android.support.v7.app.AppCompatActivity;
      import android.os.Bundle;
      import android.text.TextUtils;
      import android.util.TypedValue;
      import android.view.Gravity;
      import android.view.View;
      import android.view.ViewGroup;
      import android.widget.FrameLayout;
      import android.widget.TextView;
  
      public class MainActivity extends AppCompatActivity {
  
          @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_main);
  
              //auto resizing fails on the first run
              show_auto_resized_text();
  
              //but when we use user touch it works
              TextView button=(TextView) findViewById(R.id.text_button);
              button.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
                      show_auto_resized_text();
                  }
              });
          }
          public void show_auto_resized_text(){
              FrameLayout text_container=(FrameLayout) findViewById(R.id.container);
              text_container.removeAllViews();
              int width= text_container.getWidth()-40;
              int height= text_container.getHeight()-40;
              AutoResizeTextView textView=new AutoResizeTextView(MainActivity.this);
              textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL);
              textView.setMaxLines(10);
              textView.setTextColor(Color.WHITE);
                      textView.setTextSize(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, height, getResources().getDisplayMetrics()));
              textView.setEllipsize(TextUtils.TruncateAt.END);
              textView.setLayoutParams(new ViewGroup.LayoutParams(width, height));
              final String DOUBLE_BYTE_SPACE = "\u3000";
              String fixString = "";
              if (android.os.Build.VERSION.SDK_INT &gt;= android.os.Build.VERSION_CODES.HONEYCOMB_MR1
              &amp;&amp; android.os.Build.VERSION.SDK_INT &lt;= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
                  fixString = DOUBLE_BYTE_SPACE;
              }
              textView.setText(fixString + "THIS IS MY TEXT TO BE AUTO RESIZED" + fixString);
              text_container.addView(textView);
          }
      }
  </code></pre>
  
  <p>and the xml file</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:paddingBottom="@dimen/activity_vertical_margin"
          android:paddingLeft="@dimen/activity_horizontal_margin"
          android:paddingRight="@dimen/activity_horizontal_margin"
          android:paddingTop="@dimen/activity_vertical_margin"
          tools:context="com.kr.hakan.myapplication.MainActivity"&gt;
  
          &lt;FrameLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_alignParentTop="true"
              android:layout_above="@+id/text_button"
              android:background="#ff5b14"
              android:layout_margin="20dp"
              android:id="@+id/container"&gt;&lt;/FrameLayout&gt;
  
          &lt;TextView
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:text="Auto Resize The Text"
              android:id="@+id/text_button"
              android:layout_alignParentBottom="true"
              android:background="#000000"
              android:textSize="30sp"
              android:textColor="#ffffff"
              android:gravity="center" /&gt;
      &lt;/RelativeLayout&gt;
  </code></pre>