title: Changing visibility of a view from GONE to VISIBLE causes lag and slow
body: <p>I'm getting stuck at this problem.</p>
  
  <p>I have an activity like attached image.
  by default, in the toolbar, display only layout1, then when user click on layout1, layout2 appear/gone. I'm using layout1.setOnClickListener, and set visibility for layout2 ( layout2.visibility = View.Visible). It works, but it's very lag and slow. And in my case, I dont want to use invisible property because of UI looking.</p>
  
  <p>I'm searching solution on the internet and I think when I change layout of a view, it will redraw other view. In this case, redrawing my listView may take a lot of time.
  Can you give me some solutions? Thankyou very much.</p>
  
  <p>[Update]
  Here is my xml file</p>
  
  <pre><code>&lt;RelativeLayout
      android:id="@+id/parentLayout"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"&gt;
      &lt;android.support.v7.widget.Toolbar
          android:id="@+id/tool_bar"
          android:paddingTop="5dp"
          android:paddingBottom="5dp"
          android:layout_height="wrap_content"
          android:layout_width="match_parent"
          android:elevation="@dimen/notice_list_toolbar_elevation"
          android:layout_alignParentStart = "true"
          android:layout_alignParentTop = "true"
          android:theme="@style/ToolbarTheme"
          android:paddingRight="10dp"
          android:animateLayoutChanges="true"
          android:minHeight="?attr/actionBarSize"
          android:background="?attr/colorPrimary"
          android:focusable="true"
          android:focusableInTouchMode="true" &gt;
  
          &lt;LinearLayout
              android:id="@+id/text_search_layout"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"&gt;
  
              &lt;!--layout 1--&gt;
              &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:orientation="horizontal"&gt;
  
                  &lt;EditText
                      android:id="@+id/keyword_txt"
                      android:layout_width="0dp"
                      android:layout_height="35dp"
                      android:layout_weight="3"
                      android:background="@drawable/custom_textbox"
                      android:drawableLeft="@drawable/ic_search"
                      android:hint="検索"
                      android:textColor="@android:color/black" /&gt;
              &lt;/LinearLayout&gt;
  
              &lt;!--layout 2--&gt;
              &lt;LinearLayout
                  android:id="@+id/date_search_layout"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:animateLayoutChanges="true"
                  android:orientation="horizontal"&gt;
  
                  &lt;LinearLayout
                      android:id="@+id/date_search_display"
                      android:layout_width="0dp"
                      android:layout_height="35dp"
                      android:layout_weight="3"
                      android:background="@android:color/white"
                      android:gravity="center"
                      android:orientation="horizontal"&gt;
  
                      &lt;TextView
                          android:layout_width="wrap_content"
                          android:layout_height="match_parent"
                          android:clickable="false"
                          android:focusable="false"
                          android:text="売日"
                          android:textAlignment="textStart"
                          android:textColor="@android:color/darker_gray"
                          android:textSize="18sp" /&gt;
  
                      &lt;TextView
                          android:id="@+id/auction_date"
                          android:layout_width="0dp"
                          android:layout_height="match_parent"
                          android:layout_weight="2"
                          android:clickable="false"
                          android:focusable="false"
                          android:text="@string/not_setting_date"
                          android:textAlignment="textEnd"
                          android:textColor="@android:color/darker_gray"
                          android:textSize="18sp" /&gt;
  
                  &lt;/LinearLayout&gt;
  
                  &lt;Button
                      android:id="@+id/search_btn"
                      android:layout_width="0dp"
                      android:layout_height="match_parent"
                      android:layout_marginEnd="5dp"
                      android:layout_marginStart="10dp"
                      android:layout_weight="1"
                      android:background="@android:color/holo_blue_light"
                      android:text="検索"
                      android:textColor="@android:color/white"
                      android:textSize="14sp" /&gt;
              &lt;/LinearLayout&gt;
  
  
          &lt;/LinearLayout&gt;
  
      &lt;/android.support.v7.widget.Toolbar&gt;
  
      &lt;com.astuetz.PagerSlidingTabStrip
          android:id="@+id/tab_strip"
          android:layout_below = "@+id/tool_bar"
          android:layout_width="match_parent"
          android:layout_height="@dimen/notice_list_tab_height"
          android:background="?attr/colorPrimary"
          android:textColor="#ffffff"
          android:textSize="@dimen/notice_list_tab_text_size"
          app:pstsDividerColor="@android:color/transparent"
          app:pstsIndicatorColor="@android:color/white"
          app:pstsIndicatorHeight="@dimen/notice_list_tab_indicator_height"
          app:pstsShouldExpand="true"
          app:pstsUnderlineColor="@android:color/transparent"
          android:visibility="visible"/&gt;
  
      &lt;android.support.v4.view.ViewPager
          android:id="@+id/pager"
          android:layout_below = "@+id/tab_strip"
          android:layout_height="wrap_content"
          android:focusable="false"
          android:nestedScrollingEnabled="false"
          android:layout_width="match_parent"
          android:visibility="visible"/&gt;
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>And here is my kotlin code(same as Java)</p>
  
  <pre><code>layout1.setOnClickListener{
          if(layout2.visibility == View.GONE){
              layout2.visibility = View.VISIBLE
              layout2.visibility = View.VISIBLE
          }else{
              layout2.visibility = View.GONE
          }
  
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/tU59z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tU59z.png" alt="enter image description here"></a></p>