I have ParallaxScrollView which contain two ListViews and also TextViews it's working fine in all the devices but In Tablet(croma CRXT1125Q)the last item cut off in the first ListView, I have made the Tablet layout also but i didn't got any succeed. Please guyz help to solve it.
Help will be appreciate.
My xml looks like as below
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"
android:orientation="vertical">
<cutomView.ParallaxScrollView
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:scrollbars="none"
android:visibility="gone"
app:parallax_factor="1.9">
<RelativeLayout xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.CardView
android:id="#+id/cardAmount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorGreyBackground"
android:elevation="#dimen/viewmargin"
card_view:cardPreventCornerOverlap="false"
card_view:contentPaddingLeft="#dimen/negContentPadding"
card_view:contentPaddingRight="#dimen/negContentPadding"
card_view:contentPaddingTop="#dimen/negContentPadding">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical">
<RelativeLayout
android:id="#+id/relPackagePhoto"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imgPackage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY" />
<View
android:id="#+id/mTranspherentView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/trending_gradient_shape" />
<cutomView.TextViewAvenirMedium
android:id="#+id/txtPackageName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/mTranspherentView"
android:layout_centerHorizontal="true"
android:maxLines="2"
android:padding="#dimen/small_margine"
android:singleLine="false"
android:text=""
android:textColor="#color/white"
android:textSize="#dimen/small_font" />
<ProgressBar
android:id="#+id/mProgressBar"
style="?android:attr/progressBarStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="#dimen/margin_leftt"
android:layout_below="#+id/relPackagePhoto"
android:layout_centerVertical="true"
android:orientation="horizontal"
android:weightSum="3">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1">
<cutomView.TextViewAvenirMedium
android:id="#+id/txtOutstandingAmount"
style="#style/CustomBlackTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:gravity="center"
android:maxLines="2"
android:padding="#dimen/main_margin"
android:singleLine="false"
android:text="#string/total_due_amount"
android:textColor="#color/blue_text"
android:textSize="#dimen/normal_font" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1">
<cutomView.TextViewAvenirMedium
android:id="#+id/txtTotalAmount"
style="#style/CustomBlackTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:gravity="center"
android:padding="#dimen/main_margin"
android:text=""
android:textSize="#dimen/normal_font" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1">
<cutomView.TextViewAvenirMedium
android:id="#+id/txtPayNow"
style="#style/CustomBlackTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:background="#drawable/darkbluebutton"
android:gravity="center"
android:padding="#dimen/main_margin"
android:text="#string/pay_now"
android:textColor="#color/white"
android:textSize="#dimen/normal_font" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/cardAmount"
android:layout_marginTop="#dimen/margin_left"
card_view:cardCornerRadius="0dp"
card_view:cardElevation="2dp"
card_view:cardPreventCornerOverlap="false"
card_view:cardUseCompatPadding="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/main_margin"
android:layout_marginRight="#dimen/main_margin"
android:orientation="vertical">
<ListView
android:id="#+id/listPaidPayment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:cacheColorHint="#00000000"
android:divider="#null"
android:dividerHeight="#dimen/small_margine"
android:fastScrollEnabled="true"
android:listSelector="#android:color/transparent"
android:scrollbars="none"
android:smoothScrollbar="true" />
<View
android:id="#+id/viewSeperator"
android:layout_width="match_parent"
android:layout_height="#dimen/view_width"
android:layout_marginLeft="#dimen/margin_top_"
android:layout_marginRight="#dimen/main_margin"
android:layout_marginTop="#dimen/main_margin"
android:background="#color/darkGreyCardBg"
android:visibility="gone" />
</LinearLayout>
<cutomView.TextViewAvenirMedium
android:id="#+id/txtDueAmount"
style="#style/CustomBlackTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="#dimen/margin_left"
android:background="#color/footertext"
android:gravity="center"
android:padding="#dimen/main_margin"
android:text="#string/total_due_amount"
android:textColor="#color/white"
android:textSize="#dimen/normal_font" />
<ListView
android:id="#+id/listDuePayment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/main_margin"
android:layout_marginRight="#dimen/main_margin"
android:cacheColorHint="#00000000"
android:divider="#null"
android:dividerHeight="#dimen/small_margine"
android:fastScrollEnabled="true"
android:listSelector="#android:color/transparent"
android:scrollbars="none"
android:smoothScrollbar="true" />
</LinearLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
</cutomView.ParallaxScrollView>
</LinearLayout>
Related
I want to display some text in the middle of the screen, below header and above footer. Since this text is very long I nested it in ScrollView. I have tried a number of solutions: this, this, this, this, and a bunch more...
At first I had a problem of the two relative_layouts overlapping and text being cut of. The most accepted answer is to use layout_above and layout_below, but when I use layout_above, the text is never displayed.
This is what my xml looks like:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/linear_layout_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/gray"
android:baselineAligned="false"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="3">
<ImageView
android:id="#+id/profile_image"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_margin="10dp"
android:contentDescription="#string/profile_photo"
android:src="#drawable/default_profile"
tools:ignore="RtlHardcoded" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/scrollViewAndStuff"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_above="#+id/ln_layout_footer"
android:layout_below="#+id/linear_layout_header">
<ScrollView
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
tools:ignore="UselessParent">
<TextView
android:id="#+id/meetupDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="#string/text"/>-
</ScrollView>
</RelativeLayout>
<RelativeLayout
android:id="#+id/ln_layout_footer"
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:layout_height="match_parent"
android:gravity="bottom"
android:orientation="horizontal"
android:paddingTop="10dp">
<LinearLayout
android:id="#+id/ln_layout"
android:layout_width="fill_parent"
android:background="#color/gray"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="5dp"
android:paddingTop="5dp">
<TextView
android:id="#+id/red"
android:textColor="#color/white"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="#string/red" />
<TextView
android:id="#+id/blue"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="#color/white"
android:layout_weight="1"
android:gravity="center"
android:text="#string/blue" />
<TextView
android:id="#+id/green"
android:layout_width="match_parent"
android:textColor="#color/white"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="#string/green" />
</LinearLayout>
</RelativeLayout>
in your ln_layout_footer
set android:layout_height="wrap_content"
Edited
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/linear_layout_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/dark_gray_pressed"
android:baselineAligned="false"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="3">
<ImageView
android:id="#+id/profile_image"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_margin="10dp"
android:contentDescription="#string/action_settings"
android:src="#drawable/img_splash_logo"
tools:ignore="RtlHardcoded" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/scrollViewAndStuff"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/ln_layout_footer"
android:layout_below="#+id/linear_layout_header">
<ScrollView
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
tools:ignore="UselessParent">
<TextView
android:id="#+id/meetupDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="#string/txt_price" />-
</ScrollView>
</RelativeLayout>
<RelativeLayout
android:id="#+id/ln_layout_footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="bottom"
android:orientation="horizontal"
android:paddingTop="10dp">
<LinearLayout
android:id="#+id/ln_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#color/dark_gray"
android:orientation="horizontal"
android:paddingBottom="5dp"
android:paddingTop="5dp">
<TextView
android:id="#+id/red"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="#string/txt_quantity"
android:textColor="#color/white" />
<TextView
android:id="#+id/blue"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="#string/txt_material"
android:textColor="#color/white" />
<TextView
android:id="#+id/green"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="#string/msg_enter_user_name"
android:textColor="#color/white" />
</LinearLayout>
</RelativeLayout>
In you layout using two properties that why it doesn't work. So you can remove one properties here is your working code
<RelativeLayout
android:id="#+id/scrollViewAndStuff"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/linear_layout_header">
<ScrollView
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp">
<TextView
android:textColor="#000"
android:id="#+id/meetupDescription"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:text="#string/text" />-
</ScrollView>
</RelativeLayout>
you can use this android:layout_below="#+id/linear_layout_header or this android:layout_above="#+id/ln_layout_footer, one property at a time. or simply copy and past
<?xml version="1.0" encoding="utf-8"?>
<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/todoDetailsCoordinatorLayout"
android:background="#color/windowBackground"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="#+id/todoEditMainLl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/windowBackground"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:id="#+id/todoDetailsAppBar"
android:layout_width="match_parent"
android:layout_height="#dimen/toolbar_height"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/todoDetailsToolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:contentInsetStart="10dp"
app:popupTheme="#style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/todoDetailsBottomLl"
android:layout_below="#+id/todoDetailsAppBar"
android:orientation="vertical">
<android.support.v4.widget.NestedScrollView
android:id="#+id/todoDetailsScrollView"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="#+id/todoEditTopLl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/windowBackground"
android:orientation="vertical"
android:visibility="visible">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="#dimen/eight_dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="#dimen/activity_vertical_margin"
android:paddingRight="#dimen/activity_vertical_margin">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="#dimen/list_item_single_line_height"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:layout_width="#dimen/avatar_icon_touch_area_size"
android:layout_height="#dimen/avatar_icon_touch_area_size"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/todo_user"
android:visibility="visible" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="#dimen/list_item_content_left_padding"
android:gravity="center_vertical"
android:orientation="vertical">
<com.strait.solvenow.Utilities.WithoutPrimaryTextView
android:id="#+id/EditTodoTxtAssignToName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="" />
<com.strait.solvenow.Utilities.WithoutSecondaryTextView
android:id="#+id/EditTodoTxtAssignByName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:text=""
/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="#dimen/todo_details_height"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_width="#dimen/avatar_icon_touch_area_size"
android:layout_height="#dimen/avatar_icon_touch_area_size"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:src="#drawable/todo_due_date" />
</LinearLayout>
<com.strait.solvenow.Utilities.WithoutPrimaryTextView
android:id="#+id/EditToDoTxtDueDate"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="#dimen/list_item_content_left_padding"
android:background="#null"
android:gravity="left|center"
android:text="#string/Due_Date" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="#dimen/todo_details_height"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:layout_width="#dimen/avatar_icon_touch_area_size"
android:layout_height="#dimen/avatar_icon_touch_area_size"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="#+id/todoDetailsImgStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/user_place_holder" />
</LinearLayout>
<com.strait.solvenow.Utilities.WithoutPrimaryTextView
android:id="#+id/EditToDoTxtStatus"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="#dimen/list_item_content_left_padding"
android:background="#null"
android:gravity="left|center"
android:text="#string/Status" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="#dimen/todo_details_height"
android:gravity="center|left"
android:orientation="horizontal">
<LinearLayout
android:layout_width="#dimen/avatar_icon_touch_area_size"
android:layout_height="#dimen/avatar_icon_touch_area_size"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/todo_notification" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="#dimen/list_item_content_left_padding"
android:orientation="horizontal">
<com.strait.solvenow.Utilities.WithoutPrimaryTextView
android:id="#+id/todoDetailsTxtNotify"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="#string/Notifications" />
<android.support.v7.widget.SwitchCompat
android:id="#+id/todoEditTglNotification"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="#dimen/ten_dp"
android:layout_toRightOf="#+id/todoDetailsTxtNotify"
android:background="#android:color/transparent"
android:button="#null"
android:checked="false"
android:text=""
android:textColor="#color/textColorWithoutPrimary"
android:textOff=""
android:textOn="" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="#dimen/todo_details_height"
android:orientation="horizontal">
<LinearLayout
android:layout_width="#dimen/avatar_icon_touch_area_size"
android:layout_height="#dimen/avatar_icon_touch_area_size"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="#+id/todoEditImgAttachment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/todo_new_attach" />
</LinearLayout>
<com.strait.solvenow.Utilities.WithoutPrimaryTextView
android:id="#+id/chatEditTxtAttachment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="#dimen/list_item_content_left_padding"
android:gravity="center|left"
android:text="#string/Attachment" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="#dimen/todo_details_height"
android:layout_marginLeft="#dimen/list_item_content_left_padding"
android:gravity="center|left"
android:orientation="horizontal">
<com.strait.solvenow.Utilities.WithoutPrimaryTextView
android:id="#+id/chatEditTxtReminder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toRightOf="#+id/todoEditImgAttachment"
android:layout_weight="1"
android:gravity="center|left"
android:text="#string/Reminder"
android:visibility="visible" />
<com.strait.solvenow.Utilities.WithoutPrimaryTextView
android:id="#+id/chatEditTxtForward"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_toRightOf="#+id/todoEditImgAttachment"
android:layout_weight="1"
android:gravity="center|left"
android:text="#string/Forward" />
<com.strait.solvenow.Utilities.WithoutPrimaryTextView
android:id="#+id/chatEditTxtRejected"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toRightOf="#+id/todoEditImgAttachment"
android:layout_weight="1"
android:gravity="center|left"
android:text="#string/Reject" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<!-- <android.support.v4.widget.SwipeRefreshLayout
android:id="#+id/todoSwipeRefresh"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/chatWindowBottomRl">
-->
<android.support.v7.widget.RecyclerView
android:id="#+id/todoRv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="#dimen/five_dp"
android:paddingLeft="#dimen/activity_vertical_margin"
android:paddingRight="#dimen/activity_vertical_margin"
android:paddingTop="#dimen/ten_dp"
android:visibility="visible"></android.support.v7.widget.RecyclerView>
<!--</android.support.v4.widget.SwipeRefreshLayout>-->
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</LinearLayout>
<LinearLayout
android:id="#+id/todoDetailsBottomLl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<include
android:id="#+id/todoChatBottomVerticalLine"
layout="#layout/divider_view_line"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center"
android:background="#color/windowBackground"
android:paddingLeft="#dimen/activity_vertical_margin"
android:paddingRight="#dimen/activity_vertical_margin"
android:visibility="visible">
<ImageView
android:id="#+id/todoChatImgAttachment"
android:layout_width="#dimen/avatar_icon_touch_area_size"
android:layout_height="#dimen/avatar_icon_touch_area_size"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:padding="#dimen/icon_padding"
android:src="#drawable/chat_attachment"
android:visibility="visible" />
<com.strait.solvenow.Utilities.WithoutEditTextView
android:id="#+id/todoChatEdtTextMsg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/five_dp"
android:layout_toLeftOf="#+id/todoChatImgSend"
android:layout_toRightOf="#+id/todoChatImgAttachment"
android:background="#drawable/chat_window_text_msg_bg"
android:hint=""
android:maxLines="4"
android:minHeight="35dp"
android:paddingLeft="#dimen/ten_dp"
android:text=""
android:textSize="16sp"
android:visibility="visible" />
<ImageView
android:id="#+id/todoChatImgSend"
android:layout_width="#dimen/avatar_icon_touch_area_size"
android:layout_height="#dimen/avatar_icon_touch_area_size"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:gravity="center"
android:padding="#dimen/icon_padding"
android:src="#drawable/send"
android:visibility="visible" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
I have using recycle view inside nested Scroll view but Recycle view not scroll down in nested scroll view.recycle view scroll down when keyboard open and new item add in recycle view.here is above my code.
First of all this is bad layout technique you have implement
According to android standard there are no more than two Scrolling views inside one layout
Make a proper layout for same
You should disable scrolling of recyclerview :
recycler.setNestedScrollingEnabled(false);
You should also set height of recyclerview to wrap_content
android:layout_height="wrap_content"
How to put RecyclerView inside NestedScrollView?
I have a scrollview which was scrolling fine, until I added elements inside and it stopped scrolling. I tried many things, including changing the height to fill_parent or wrap_content, but somehow I cannot find which value is blocking the scroll. Anyone can help? Here is my layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/bg_layout"
android:fitsSystemWindows="false"
android:background="#drawable/detail_background"
tools:context="com.kalianey.oxapp.views.fragments.ProfileFragment">
<com.kalianey.oxapp.utils.UIParallaxScroll //extends ScrollView
android:id="#+id/scroller"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
app:headerView="#+id/layout_top">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="1"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight="0.4"
android:id="#+id/cover_container">
<com.kalianey.oxapp.utils.UICircularImage
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/image_view"
android:layout_width="125dp"
android:layout_height="125dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:layout_marginBottom="5dp"
app:line_color="#android:color/white"
app:line_color_press="#color/theme_color"
app:line_width="1dp"
app:padding="0dp" />
<TextView
android:id="#+id/title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="center"
android:paddingLeft="16dp"
android:paddingTop="10dp"
android:paddingRight="16dp"
android:text="#string/detail_title_placeholder"
android:textSize="#dimen/textsize_xlarge"
android:layout_below="#+id/image_view"
android:textColor="#android:color/white"/>
<TextView
android:id="#+id/sumary"
android:layout_below="#+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:fontFamily="sans-serif-light"
android:gravity="center"
android:paddingBottom="16dp"
android:text="#string/sumary_placeholder"
android:textColor="#color/white_transparent"
android:textSize="#dimen/textsize_medium_small" />
<LinearLayout
android:id="#+id/statistics"
android:layout_below="#+id/sumary"
android:background="#color/gray_transparent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="5dp"
android:orientation="vertical"
android:background="#drawable/border_right" >
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageButtonFriend"
android:layout_gravity="center_horizontal"
android:src="#drawable/user"
android:background="#android:color/transparent"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:layout_weight="1"
android:background="#color/gray_transparent"
android:orientation="vertical" >
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageButtonFavorite"
android:layout_gravity="center_horizontal"
android:src="#drawable/star"
android:background="#android:color/transparent"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:id="#+id/informations_container"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight="0.6"
android:orientation="vertical"
android:background="#android:color/white"
android:layout_below="#+id/cover_container"
android:gravity="center"
android:padding="10dp">
<com.kalianey.oxapp.utils.UITabs
android:id="#+id/toggle"
android:layout_gravity="center"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="#+id/informations_container">
<RadioButton
android:id="#+id/toggle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="5dp"
android:checked="true"
android:text="#string/description_tab_1"
style="#style/UITabs" />
<RadioButton
android:id="#+id/toggle2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="5dp"
android:text="#string/description_tab_2"
android:layout_gravity="bottom"
style="#style/UITabs" />
</com.kalianey.oxapp.utils.UITabs>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/profile_photo_text"
android:text="#string/profile_photo_text"
android:layout_gravity="left"
android:layout_marginBottom="10dp"
android:layout_marginLeft="#dimen/activity_horizontal_margin"
android:layout_marginRight="#dimen/activity_horizontal_margin"
android:layout_marginTop="20dp" />
<TextView
android:id="#+id/noPhotos"
android:layout_below="#+id/profile_photo_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:fontFamily="sans-serif-light"
android:gravity="center"
android:text="#string/noPhotos"
android:textColor="#color/gray_light"
android:textSize="#dimen/textsize_medium_small"
android:textStyle="italic"
android:height="70dp"
android:visibility="gone"/>
<android.support.v7.widget.RecyclerView
android:id="#+id/grid_view"
android:layout_width="match_parent"
android:layout_height="250dp"
app:layoutManager="StaggeredGridLayoutManager"
android:layout_marginLeft="#dimen/activity_horizontal_margin"
android:layout_marginRight="#dimen/activity_horizontal_margin"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/profile_friend_text"
android:text="#string/profile_friend_text"
android:layout_gravity="left"
android:layout_marginTop="20dp"
android:layout_marginLeft="#dimen/activity_horizontal_margin"
android:layout_marginRight="#dimen/activity_horizontal_margin"/>
<TextView
android:id="#+id/noFriends"
android:layout_below="#+id/profile_friend_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:fontFamily="sans-serif-light"
android:gravity="center"
android:text="#string/noFriends"
android:textColor="#color/gray_light"
android:textSize="#dimen/textsize_medium_small"
android:textStyle="italic"
android:minHeight="50dp"
android:visibility="gone"/>
<org.lucasr.twowayview.TwoWayView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/friends_list"
style="#style/TwoWayView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawSelectorOnTop="false"
tools:context=".MainActivity"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:layout_marginLeft="#dimen/activity_horizontal_margin"
android:layout_marginRight="#dimen/activity_horizontal_margin"/>
<se.emilsjolander.stickylistheaders.StickyListHeadersListView
android:id="#+id/questions_list"
android:layout_width="match_parent"
android:layout_height="500dp"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
</com.kalianey.oxapp.utils.UIParallaxScroll>
<!-- "ActionBar" -->
</RelativeLayout>
Take a look at the below xml code which will help you to to build screen with scrolling even though it contains recycler view.
<android.support.design.widget.CoordinatorLayout
android:id="#+id/container"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="24dp">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25dp"
android:gravity="center_horizontal"
android:textStyle="bold"
android:text=" " />
<android.support.v7.widget.RecyclerView
android:id="#+id/rcy1"
android:layout_width="match_parent"
android:layout_height="250dp"
android:numColumns="4"
android:scrollbars="vertical"
android:adjustViewBounds="true"
android:gravity="center_horizontal"
android:horizontalSpacing="1dp"
android:padding="1dp"
android:background="#color/white"
android:stretchMode="columnWidth"
android:verticalSpacing="1dp"/>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="#+id/rcy2"
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_marginTop="10dp"
android:numColumns="3"
android:scrollbars="vertical"
android:adjustViewBounds="true"
android:gravity="center_horizontal"
android:horizontalSpacing="1dp"
android:padding="1dp"
android:background="#color/white"
android:stretchMode="columnWidth"
android:verticalSpacing="1dp"/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
You can use elements that you wanted in this.Also you may change the base CoordinatorLayout to LinearLayout or RelativeLayout.Also don't forget to add the below supports in dependencies section in your build.gradle file.
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:cardview-v7:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
I am using Expandable GridView which doesn't scroll the whole content if grid items are changed dynamically.
Below is the xml code for main gridview
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="135dp">
<android.support.v4.view.ViewPager
android:id="#+id/pager1"
android:layout_width="match_parent"
android:layout_height="135dp"
android:layout_above="#+id/titles"
android:overScrollMode="never">
</android.support.v4.view.ViewPager>
<com.viewpagerindicator.CirclePageIndicator
android:id="#+id/titles"
style="#style/CustomCirclePageIndicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:padding="5dp" />
</RelativeLayout>
<fone.adipoli.shopping.ExpandableHeightGridView
android:id="#+id/gridView_shopping"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="center"
android:horizontalSpacing="0dp"
android:listSelector="#android:color/transparent"
android:numColumns="2"
android:stretchMode="columnWidth"
android:verticalSpacing="0dp" />
</LinearLayout>
Xml for each Grid item
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/white"
android:orientation="vertical">
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="#+id/cardrow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
card_view:cardCornerRadius="3dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="center">
<ImageView
android:id="#+id/img_grid_row1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
/>
</LinearLayout>
<TextView
android:id="#+id/grid_row1_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text=""
/>
<TextView
android:id="#+id/grid_row1_model"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text=""
android:textAppearance="?android:attr/textAppearanceSmall"
android:visibility="gone" />
<TextView
android:id="#+id/grid_row1_price_offr"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text=""
android:textAppearance="?android:attr/textAppearanceSmall"
/>
<TextView
android:id="#+id/grid_row1_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text=""
android:textSize="10sp"
/>
<TextView
android:id="#+id/grid_row1_product"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text=""
android:textSize="10sp"
android:visibility="gone"
/>
<TextView
android:id="#+id/buy_grid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="2dp"
android:text="BUY"
android:padding="10dp"
android:gravity="center"
android:textColor="#color/white"
android:background="#color/blue"
android:textAppearance="? android:attr/textAppearanceSmall"/>
</LinearLayout>
</android.support.v7.widget.CardView>
I tried adding a view in the bottom after GridView ,but it doesn't work out.
Any help would be really thankfull.
Use android.support.v4.widget.NestedScrollView
or
ScrollView
Put your whole Grid items in NestedScrollView, or ScrollView seems to solve your problem.
I have an activity in which I am using the fragment. In fragment I have custom toolbar, a list and a EditTextView. When Keyboard visible in this Activity, it pushes up layout. How can I prevent the toolbar to be at its original position.
Following code is written in my fragment:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/layout_alert_main_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/bg_hexa">
<TextView
android:id="#+id/channel_title"
android:paddingLeft="10dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:background="#color/black"
android:textColor="#color/white"
android:textSize="16sp"
android:visibility="gone"
android:layout_below="#id/layout_alert_top"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RelativeLayout
android:id="#+id/layout_alert_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible"
android:background="#color/app_blue"
android:orientation="horizontal">
<RelativeLayout
android:id="#+id/layout_channel_back_view"
android:layout_width="50dp"
android:layout_height="50dp"
android:clickable="true"
android:focusable="true">
<ImageView
android:id="#+id/title_bar_left_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/ic_menu_white_32"/>
</RelativeLayout>
<TextView
android:id="#+id/tv_screen_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="#string/channel_title"
android:layout_centerInParent="true"
android:textSize="24sp"
android:textColor="#color/white_text"/>
<RelativeLayout
android:id="#+id/channels_sliding_menu"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:clickable="true"
android:focusable="true">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/ic_tab_channels_white"/>
</RelativeLayout>
</RelativeLayout>
<android.support.v4.widget.DrawerLayout
android:id="#+id/drawer_layout"
android:layout_below="#+id/channel_title"
android:isScrollContainer="false"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/layout_list_alerts"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent">
<TextView
android:id="#+id/zero_conversation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textColor="#color/dark_gray_text"
android:layout_centerInParent="true"
android:text="Empty"
android:visibility="gone"/>
<RelativeLayout
android:id="#+id/layout_type_message"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:background="#color/gray">
<EditText
android:id="#+id/et_type_message"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toLeftOf="#+id/layout_send_message"
android:background="#drawable/square_round_corners"
android:hint="Type your message.."
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:padding="5dp"
android:singleLine="true"
android:textColor="#color/black"
android:textColorHint="#color/black"
android:textSize="16sp"/>
<Button
android:id="#+id/layout_send_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_alignParentRight="true"
android:padding="5dp"
android:textSize="16sp"
android:textStyle="bold"
android:background="#color/transparent"
android:textColor="#color/dark_gray_text"
android:layout_centerInParent="true"
android:text="Send"/>
</RelativeLayout>
<ListView
android:id="#+id/conversation_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#id/layout_type_message"
android:divider="#null"
android:listSelector="#color/transparent"
android:stackFromBottom="true"
android:transcriptMode="normal"
/>
</RelativeLayout>
<FrameLayout
android:id="#+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false" >
</FrameLayout>
<ListView
android:id="#+id/channels_list"
android:background="#color/gray"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="#null"
android:layout_gravity="right"
android:choiceMode="singleChoice" />
</android.support.v4.widget.DrawerLayout>
</RelativeLayout>
Hello, Try to apply this attribute in Activity Tag in Manifest file and let me know if you
can get your desired output or not. Okay.
android:windowSoftInputMode="stateAlwaysHidden|adjustResize"
> XML file` :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/layout_alert_main_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFF">
<RelativeLayout
android:id="#+id/layout_alert_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#000000"
android:orientation="horizontal"
android:visibility="visible">
<RelativeLayout
android:id="#+id/layout_channel_back_view"
android:layout_width="50dp"
android:layout_height="50dp"
android:clickable="true"
android:focusable="true">
<ImageView
android:id="#+id/title_bar_left_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#FFFFFF" />
</RelativeLayout>
<TextView
android:id="#+id/tv_screen_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:text="Title"
android:textColor="#FFFFFF"
android:textSize="24sp" />
<RelativeLayout
android:id="#+id/channels_sliding_menu"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:clickable="true"
android:focusable="true">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/ic_logo" />
</RelativeLayout>
</RelativeLayout>
<android.support.v4.widget.DrawerLayout
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:isScrollContainer="false">
<RelativeLayout
android:id="#+id/layout_list_alerts"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="#+id/zero_conversation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="Empty"
android:textColor="#000000"
android:textSize="16sp"
android:visibility="gone" />
<RelativeLayout
android:id="#+id/layout_type_message"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:background="#000000"
android:orientation="horizontal">
<EditText
android:id="#+id/et_type_message"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:layout_toLeftOf="#+id/layout_send_message"
android:background="#FFFFFF"
android:hint="Type your message.."
android:padding="5dp"
android:singleLine="true"
android:textColor="#000000"
android:textColorHint="#000000"
android:textSize="16sp" />
<Button
android:id="#+id/layout_send_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerInParent="true"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:background="#000000"
android:padding="5dp"
android:text="Send"
android:textColor="#FFFFFF"
android:textSize="16sp"
android:textStyle="bold" />
</RelativeLayout>
<ListView
android:id="#+id/conversation_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#id/layout_type_message"
android:divider="#null"
android:stackFromBottom="true"
android:transcriptMode="normal" />
</RelativeLayout>
<FrameLayout
android:id="#+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false"></FrameLayout>
<ListView
android:id="#+id/channels_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="right"
android:background="#000000"
android:choiceMode="singleChoice"
android:divider="#null"
tools:listtem="#layout/demo_layout" />
</android.support.v4.widget.DrawerLayout>
</RelativeLayout>
Use Scroll view in Ur Layout or Use the code in the manifest.xml.
<activity android:windowSoftInputMode="adjustPan">
Read this :
http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft
and use adjustPan