Layout cut by keyboard after adding search widget



I added the search widget to my app recently. Now when I land on MainActivity, the view is cut right where the keyboard would pop up. The content scrolls within that smaller box. When I hit the search widget in the action bar, the keyboard pops up and fills the blank space. When I collapse the keyboard, my view is complete and there is no blank space. Check this photo to see what I mean. this photo


Here are my layouts


activity_main.xml



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://ift.tt/nIICcg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@null" />

</LinearLayout>


feed_item.xml (inflates listview)



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://ift.tt/nIICcg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/feed_bg"
android:orientation="vertical" >

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"

android:layout_marginLeft="@dimen/feed_item_margin"
android:layout_marginRight="@dimen/feed_item_margin"
android:layout_marginTop="@dimen/feed_item_margin"
android:background="@drawable/bg_parent_rounded_corner"
android:orientation="vertical"
android:paddingBottom="@dimen/feed_item_padding_top_bottom"
android:paddingTop="@dimen/feed_item_padding_top_bottom" >

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="@dimen/feed_item_padding_left_right"
android:paddingRight="@dimen/feed_item_padding_left_right" >

<com.android.volley.toolbox.NetworkImageView
android:id="@+id/vendorPic"
android:layout_width="@dimen/feed_item_vendor_pic_width"
android:layout_height="@dimen/feed_item_vendor_pic_height"
android:scaleType="fitCenter" >
</com.android.volley.toolbox.NetworkImageView>

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="@dimen/feed_item_profile_info_padd" >

<TextView
android:id="@+id/timestamp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="@color/timestamp"
android:textSize="@dimen/feed_item_timestamp" />
</LinearLayout>
</LinearLayout>

<TextView
android:id="@+id/txtHeadlineMsg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingLeft="@dimen/feed_item_status_pad_left_right"
android:paddingRight="@dimen/feed_item_status_pad_left_right"
android:paddingTop="@dimen/feed_item_status_pad_top" />



<com.example.myapp.FeedImageView
android:id="@+id/feedImage1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:scaleType="fitXY"
android:visibility="visible" />
</LinearLayout>

</LinearLayout>


Here's my searchable config xml.



<?xml version="1.0" encoding="utf-8"?>
<searchable xmlns:android="http://ift.tt/nIICcg"
android:label="@string/app_name"
android:hint="@string/search_hint" >
</searchable>


Let me know if you need more to go on, thanks!!


P.S. min sdk is 12.


No comments:

Post a Comment