title: View.Gone not removing space for linearlayout
body: <p>I am making my LinearLayout view View.Gone but still it takes the space and empty space is shown.
  Please help me.</p>
  
  <pre><code>&lt;LinearLayout
          android:id="@+id/tvshow_layout"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical"
          android:visibility="visible" &gt;
  
          &lt;RelativeLayout
              android:id="@+id/relativelayout"
              android:layout_width="match_parent"
              android:layout_height="36dp"
              android:paddingLeft="14dp"
              android:paddingRight="14dp" &gt;
  
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_centerVertical="true"
                  android:gravity="center_vertical"
                  android:shadowColor="@color/RGB_100_220_220_220"
                  android:shadowDx="1"
                  android:shadowDy="1"
                  android:shadowRadius="2"
                  android:singleLine="true"
                  android:text="@string/common_title_tvshows"
                  android:textColor="@color/RGB_100_5_5_5"
                  android:textSize="20dp"
                  android:textStyle="bold" /&gt;
  
              &lt;LinearLayout
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_alignParentRight="true"
                  android:layout_centerVertical="true"
                  android:gravity="center_vertical" &gt;
  
                  &lt;ImageView
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:background="@drawable/common_button_arrow_left"
                      android:clickable="true" /&gt;
  
                  &lt;View
                      android:layout_width="2dp"
                      android:layout_height="18dp"
                      android:layout_marginLeft="18dp"
                      android:layout_marginRight="18dp"
                      android:background="@drawable/btn_detail_next_devider" /&gt;
  
                  &lt;ImageView
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:background="@drawable/common_button_arrow_right"
                      android:clickable="true" /&gt;
              &lt;/LinearLayout&gt;
          &lt;/RelativeLayout&gt;
  
          &lt;RelativeLayout
              android:layout_width="match_parent"
              android:layout_height="147dp"
              android:layout_marginTop="10dp" &gt;
  
              &lt;com.sec.msc.android.yosemite.ui.detailview.HorizontalListAdapterView
                  android:id="@+id/nestedlistview_tv"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent" /&gt;
          &lt;/RelativeLayout&gt;
  
  
  
      &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Inside the getView method of listview which is having this linearlayout as the row,I am doing this</p>
  
  <pre><code>holder.movielayout = (LinearLayout) convertView.findViewById(R.id.tvshow_layout);
  holder.tvshowlayout.setVisibility(View.GONE);
  
   ViewHolder holder;
  
          if(convertView == null){
  
              convertView = Inflater.inflate(mLayout, parent, false);
              holder = new ViewHolder();
              holder.movielayout = (LinearLayout) convertView.findViewById(R.id.seasonalfavorites_movie_layout);
              holder.tvshowlayout = (LinearLayout) convertView.findViewById(R.id.seasonalfavorites_tvshow_layout);
              holder.nestedMovieList = (HorizontalListAdapterView)convertView.findViewById(R.id.nestedlistview_movie);
              holder.nestedTvList = (HorizontalListAdapterView)convertView.findViewById(R.id.nestedlistview_tv);
  
  
              convertView.setTag(holder);
  
          } else {
              holder = (ViewHolder) convertView.getTag();
          }
  
              String title = mPromotionList.get(position).getPromotionTitle();    
              holder.titleText.setText(title);
              movieItemList = (ArrayList&lt;SeasonalFavoritesListItem&gt;) mMovieMap.get(title);
              tvItemList = (ArrayList&lt;SeasonalFavoritesListItem&gt;) mTvShowMap.get(title);
              if(tvItemList.size()&gt;0){
                  holder.tvshowlayout.setVisibility(View.VISIBLE);
                  SeasonalFavoritesHorizentalListAdapter listAdaptrTv = new SeasonalFavoritesHorizentalListAdapter(mContext,tvItemList,1,holder.nestedTvList);
                  holder.nestedTvList.setAdapter(listAdaptrTv);
              }else{
                  holder.tvshowlayout.setVisibility(View.GONE);
              }
  
              if(movieItemList.size()&gt;0){
                  holder.movielayout.setVisibility(View.VISIBLE);
                  SeasonalFavoritesHorizentalListAdapter listAdaptr = new SeasonalFavoritesHorizentalListAdapter(mContext,movieItemList,0,holder.nestedMovieList);
                  holder.nestedMovieList.setAdapter(listAdaptr);
              }else{
                  holder.movielayout.setVisibility(View.GONE);
              }
  </code></pre>