title: Last Item on Listview is cut off
body: <p>So in my Android app I have where the main activity has tabs and in each tab there is a fragment containing a listview. But for some reason the last item in the listview always gets cut off. I have looked around for solutions but I havent found any yet. Any suggestions?</p>
  
  <p><strong>Main Activity layout</strong></p>
  
  <pre><code>&lt;android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:id="@+id/rl"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"&gt;
  
          &lt;android.support.v7.widget.Toolbar
              android:id="@+id/toolbar"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize"
              android:background="?attr/colorPrimary"
              app:layout_scrollFlags="scroll|enterAlways"
              app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /&gt;
  
          &lt;android.support.design.widget.TabLayout
              android:id="@+id/tabs"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              app:tabMode="fixed"
              app:tabGravity="fill"/&gt;
  
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;android.support.v4.view.ViewPager
          android:id="@+id/viewpager"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          app:layout_behavior="@string/appbar_scrolling_view_behavior"  /&gt;
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p><strong>Fragment with ListView</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"&gt;
  
      &lt;ProgressBar
          android:id="@+id/progressBar"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerHorizontal="true"
          android:layout_centerVertical="true"
          style="@style/Widget.AppCompat.ProgressBar" /&gt;
  
      &lt;LinearLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:orientation="vertical"&gt;
  
          &lt;ListView
              android:id="@+id/list"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              style="@style/Widget.AppCompat.ProgressBar"&gt;&lt;/ListView&gt;
  
      &lt;/LinearLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>List Item Layout</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical" android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:padding="2dp"
      android:layout_margin="5dp"&gt;
  
      &lt;TextView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="New Text"
          android:id="@+id/title"
          android:textSize="20sp"
          android:textStyle="bold"
          android:typeface="normal"
          android:layout_alignParentTop="true"
          android:layout_alignParentLeft="true"
          android:layout_alignParentStart="true" /&gt;
  
      &lt;TextView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="New Text"
          android:id="@+id/author"
          android:textSize="15sp"
          android:typeface="normal"
          android:layout_below="@+id/publishdate"
          android:layout_alignParentLeft="true"
          android:layout_alignParentStart="true" /&gt;
      &lt;TextView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="New Text"
          android:id="@+id/publishdate"
          android:textSize="15sp"
          android:typeface="normal"
          android:layout_below="@+id/title"
          android:layout_alignParentLeft="true"
          android:layout_alignParentStart="true" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>List Adapter Class</strong></p>
  
  <pre><code>package com.czhou.dailyprincetoniannewspaper.adapters;
  
  import android.content.ClipData;
  import android.content.Context;
  import android.graphics.Paint;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ArrayAdapter;
  import android.widget.TextView;
  
  
  import com.czhou.dailyprincetoniannewspaper.NewspaperMetaObject;
  import com.czhou.dailyprincetoniannewspaper.R;
  
  import java.util.List;
  
  public class NewsListAdapter extends ArrayAdapter&lt;NewspaperMetaObject&gt; {
  
      static class ViewHolder {
          TextView author;
          TextView publishdate;
          TextView title;
      }
  
      private LayoutInflater inflater;
      List&lt;NewspaperMetaObject&gt; newsitems;
      public NewsListAdapter(Context context, List&lt;NewspaperMetaObject&gt; items) {
          super(context, R.layout.newslistitem, items);
          this.newsitems = items;
          inflater = (LayoutInflater) context
                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
  
               ViewHolder viewHolder;
  
          if (convertView == null) {
              convertView = inflater.inflate(R.layout.newslistitem, parent, false);
  
              viewHolder = new ViewHolder();
              viewHolder.title = (TextView) convertView.findViewById(R.id.title);
              viewHolder.author = (TextView) convertView.findViewById(R.id.author);
              viewHolder.publishdate = (TextView) convertView.findViewById(R.id.publishdate);
              convertView.setTag(viewHolder);
  
          } else {
              viewHolder = (ViewHolder) convertView.getTag();
          }
  
          viewHolder.title.setText(newsitems.get(position).getArticleTitle());
          viewHolder.title.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG);
          viewHolder.publishdate.setText(newsitems.get(position).getArticlePublishDate());
          viewHolder.author.setText(newsitems.get(position).getArticleAuthor());
          System.out.println(viewHolder.publishdate.getText());
  
          return convertView;
      }
  
  }
  </code></pre>
  
  <p><strong>Main Activity Class</strong></p>
  
  <pre><code>package com.czhou.dailyprincetoniannewspaper;
  
  import android.os.Bundle;
  import android.support.design.widget.CoordinatorLayout;
  import android.support.design.widget.TabLayout;
  import android.support.v4.app.Fragment;
  import android.support.v4.app.FragmentManager;
  import android.support.v4.app.FragmentPagerAdapter;
  import android.support.v4.view.ViewPager;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.Toolbar;
  import android.view.View;
  import android.widget.ProgressBar;
  import android.widget.RelativeLayout;
  
  import java.util.ArrayList;
  import java.util.List;
  /**
   * Created by czhou on 11/21/2015.
   */
  public class MainActivity extends AppCompatActivity {
  
      private Toolbar toolbar;
      private TabLayout tabLayout;
      private ViewPager viewPager;
      private ProgressBar mProgressBar;
      private CoordinatorLayout coordinatorLayout;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          toolbar = (Toolbar) findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
  
  
          viewPager = (ViewPager) findViewById(R.id.viewpager);
          setupViewPager(viewPager);
  
          tabLayout = (TabLayout) findViewById(R.id.tabs);
          tabLayout.setupWithViewPager(viewPager);
      }
  
      private void setupViewPager(ViewPager viewPager){
          ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());
          adapter.addFragment(new PUNewsFragment(), "News");
          adapter.addFragment(new PUSportsFragment(), "Sports");
  
          viewPager.setAdapter(adapter);
      }
  
      class ViewPagerAdapter extends FragmentPagerAdapter {
          private final List&lt;Fragment&gt; mFragmentList = new ArrayList&lt;&gt;();
          private final List&lt;String&gt; mFragmentTitleList = new ArrayList&lt;&gt;();
  
          public ViewPagerAdapter(FragmentManager manager) {
              super(manager);
          }
  
          @Override
          public Fragment getItem(int position) {
              return mFragmentList.get(position);
          }
  
          @Override
          public int getCount() {
              return mFragmentList.size();
          }
  
          public void addFragment(Fragment fragment, String title) {
              mFragmentList.add(fragment);
              mFragmentTitleList.add(title);
          }
  
          @Override
          public CharSequence getPageTitle(int position) {
              return mFragmentTitleList.get(position);
          }
      }
  }
  </code></pre>