My ListView no longer scrolls. Everything else works just fine but it just doesn't scroll now. It used to work. I think the only thing I added was a floating action button and now it does not scroll. I also made it programmatically determine to display the list view or not. Anyone know why it isn't scrolling?
Here is the layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
android:focusable="true"
android:focusableInTouchMode="true"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:src="@drawable/ic_search_black_24dp"/>
<EditText
android:id="@+id/etSearchZip"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:layout_marginTop="10dp"
android:imeOptions="actionSearch"
android:inputType="number"/>
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/no_leads_found"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:textSize="20sp"
android:padding="15dp"
android:text="@string/lead_name"
android:textStyle="bold"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/tvDatePosted"
android:text="@string/posted"
android:textSize="20sp"
android:padding="15dp"
android:textStyle="bold"
/>
</LinearLayout>
<TextView
android:id="@+id/tvNoLeadsFound"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/no_leads_found"
android:gravity="center"
android:visibility="gone"/>
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="16sp"
android:id="@+id/browseAgentsLV" />
</LinearLayout>
And here is the relevant java for the fragment (it's called in onCreateView):
ListAdapter listAdapter = new RowAdapter(getActivity(), leadMapList);
listView.setAdapter(listAdapter);
listView.setOnItemClickListener(new
AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String agentPicked = "You selected " + String.valueOf(parent.getItemAtPosition(position));
Toast.makeText(getActivity(), agentPicked, Toast.LENGTH_SHORT).show();
}
});
noLeadsFound.setVisibility(view.GONE);
listView.setVisibility(view.VISIBLE);