I have use swipe resfresh with recyclerivew. but I see one problem. I can't scroll my recyclerivew up. I can scroll recyclerview down normally but every time I try to scroll up it will not scroll it up it is work the function swift refresh how ever I am not scrol up to the top yet.
Here is my xml
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_marginBottom="-5dp"
android:id="#+id/swiperefresh"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/buslayout"
android:focusableInTouchMode="true"
>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="50dp"
android:layout_gravity="center"
android:gravity="center"
android:text="Loading..."
android:id="#+id/info"
android:visibility="visible"/>
<android.support.v7.widget.RecyclerView
android:id="#+id/business_recycle"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v4.widget.SwipeRefreshLayout>
Try this:
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_marginBottom="-5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="50dp"
android:layout_gravity="center"
android:gravity="center"
android:text="Loading..."
android:id="#+id/info"
android:visibility="visible"/>
<android.support.v4.widget.SwipeRefreshLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/swiperefresh"
android:focusableInTouchMode="true"
>
<android.support.v7.widget.RecyclerView
android:id="#+id/business_recycle"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.v4.widget.SwipeRefreshLayout>
</FrameLayout>
Related
I have a RecyclerView with a NestedScrollView and the recycler view scrolling is very very slow. Why is this happening, and how can I fix this?
After googleing and searching in Stack Overflow, i got this solution:
mMyRecyclerView.setNestedScrollingEnabled(false);
But it does not improve the scroll speed in my case, please help.
This is my xml code
<FrameLayout 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"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="fragment.HomeFrg">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent">
<!-- TODO: Update blank fragment layout -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/ns1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="#+id/card_background_new_design"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
app:cardElevation="5dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1">
<TextView
android:id="#+id/bestdeal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:padding="5dp"
android:paddingEnd="10dp"
android:paddingStart="10dp"
android:text="DEALS"
android:visibility="gone"
android:textColor="#color/colorPrimary"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:id="#+id/viewall"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:gravity="end"
android:padding="5dp"
android:text="View All"
android:textColor="#color/colorPrimary"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="#+id/recycler_view_page2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="10dp"
android:clipToPadding="false"
android:layout_marginBottom="5dp"/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<WebView
android:id="#+id/activity_main_webview"
android:layout_width="match_parent"
android:visibility="gone"
android:layout_height="150dp" />
<TextView
android:id="#+id/homefrgMsg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="#string/nonetwork"
android:textSize="30sp"
android:visibility="visible"
android:textStyle="normal|bold" />
<ProgressBar
style="?android:attr/progressBarStyleLarge"
android:layout_width="42dp"
android:layout_gravity="center"
android:layout_height="42dp"
android:visibility="visible"
android:id="#+id/progressBar_home_frg" />
</FrameLayout>
</FrameLayout>
This is my app on google play store, for your reference.
try to use this when you call your Linear layout manager
recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false){
#Override
public boolean canScrollVertically() {
return false;
}
});
I am not sure but try RecyclerView height match_parent to wrap_content
some what new to android development. Currently, this is the code that I have for my layout:
<FrameLayout 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:fitsSystemWindows="true"
android:theme="#android:style/Theme.NoTitleBar"
tools:context="com.alibaba.weex.com.alibaba.app.WXPageActivity">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<FrameLayout
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:scrollIndicators="right"
android:scrollbars="vertical">
</FrameLayout>
<ProgressBar
android:id="#+id/progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone" />
<TextView
android:id="#+id/index_tip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignWithParentIfMissing="true"
android:layout_below="#+id/index_progressBar"
android:layout_centerHorizontal="true"
android:layout_margin="10dp"
android:text="loading...."
android:visibility="gone" />
</FrameLayout>
Can someone help me figure out how to get the vertical scroll bar to show? I've tried changing the all the framelayouts to relativelayouts, and then changing the second framelayout to a ScrollView, but the app crashes once I open it.
Thanks!
I think your layout should be like this .
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:scrollbars="vertical"
>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<FrameLayout
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
>
</FrameLayout>
<ProgressBar
android:id="#+id/progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone" />
<TextView
android:id="#+id/index_tip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignWithParentIfMissing="true"
android:layout_below="#+id/index_progressBar"
android:layout_centerHorizontal="true"
android:layout_margin="10dp"
android:text="loading...."
android:visibility="gone" />
</FrameLayout>
</ScrollView>
You can't change scollview in the second framelayout because the scollview can only have one child .
I have a layout file as given below. I have one scroll view inside that one listview and one linear layout. When i install the app in mobile only listview is visible properly but all other layouts are invisible. I have two other textview which are not visible. How to solve this problem?
<LinearLayout 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:orientation="vertical"
tools:context="com.example.app.Fragments.LFragment">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView
android:id="#+id/l_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="#null"
android:scrollbars="none"
android:animationCache="false"
android:scrollingCache="false"
android:smoothScrollbar="true">
</ListView>
<android.support.v7.widget.CardView
android:id="#+id/assmt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:padding="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorAccent"
android:gravity="center"
android:padding="10dp"
android:text="Assessment"
android:textColor="#color/colorBlack"
android:textSize="16sp"/>
<TextView
android:id="#+id/assmt_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="10dp"
android:text="sample"
android:textColor="#color/colorBlack"
android:textSize="16sp"/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>
</LinearLayout>
The Parent View(ScrollView) have a separate scroll option and ListView have a separate scroll so when you try to use scroll listView that scroll option only working this case parent scroll not working.
Please try to use NestedScrollView.
NestedScrollView is just like ScrollView, but it supports acting as both a nested scrolling parent and child on both new and old versions of Android. Nested scrolling is enabled by default.
https://developer.android.com/reference/android/support/v4/widget/NestedScrollView.html
Example : https://inducesmile.com/android-tips/android-recyclerview-inside-nestedscrollview-example/
Put the ScrollView as a parent like this:
<ScrollView 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"
tools:context="com.example.app.Fragments.LFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView
android:id="#+id/l_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="#null"
android:scrollbars="none"
android:animationCache="false"
android:scrollingCache="false"
android:smoothScrollbar="true">
</ListView>
<android.support.v7.widget.CardView
android:id="#+id/assmt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:padding="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorAccent"
android:gravity="center"
android:padding="10dp"
android:text="Assessment"
android:textColor="#color/colorBlack"
android:textSize="16sp"/>
<TextView
android:id="#+id/assmt_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="10dp"
android:text="sample"
android:textColor="#color/colorBlack"
android:textSize="16sp"/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</LinearLayout>
</ScrollView>
Use android:layout_weight property for views inside LinearLayout.
<?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:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1"
android:orientation="vertical">
<ListView
android:id="#+id/l_list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".8"
android:divider="#null"
android:scrollbars="none"
android:animationCache="false"
android:scrollingCache="false"
android:smoothScrollbar="true">
</ListView>
<android.support.v7.widget.CardView
android:id="#+id/assmt"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".2"
android:layout_margin="10dp"
android:padding="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorAccent"
android:gravity="center"
android:padding="10dp"
android:text="Assessment"
android:textSize="16sp"/>
<TextView
android:id="#+id/assmt_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="10dp"
android:text="sample"
android:textSize="16sp"/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>
I have a nestedScrollview inside a CoordinatorLayout.
Now, there are 5-6 views inside nestedScrollview and there visibilty will change depending on the data available via network.
The issue is that scrollview always takes the same height (total of all 5-6 views) and leaves a blank space at bottom when i hide visibility of any view. Could any one please tell me how I can readjust the height of the scrollview so there is no blank space at bottom of the scrollview.
<android.support.design.widget.CoordinatorLayout
android:id="#+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:id="#+id/MyAppbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#android:color/white"
android:fitsSystemWindows="true">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapse_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:collapsedTitleGravity="center_horizontal"
app:expandedTitleGravity="center_horizontal"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<!--Some content here-->
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="#+id/nested_scroll_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
<include
android:id="#+id/profile_extra_details"
layout="#layout/profile_extra_details_layout" />
<LinearLayout
android:id="#+id/see_project_listing_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
<include layout="#layout/divider" />
<ViewSwitcher
android:id="#+id/work_switcher"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include
android:id="#+id/see_project_listing"
layout="#layout/photos_with_heading" />
<TextView
android:id="#+id/txt_no_work_found"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:text="There are no Design Boards"
/>
</ViewSwitcher>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
This is the NestedScrollview. Below is the profile_extra_details_layout. This the layout whose visibility is controlled based on data availability from network and also the type of user whose profile is being seen.
<?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="wrap_content"
android:orientation="vertical">
<include layout="#layout/divider" />
<TextView
android:id="#+id/user_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/activity_horizontal_margin"
android:layout_marginRight="#dimen/activity_horizontal_margin"
android:visibility="gone" />
<LinearLayout
android:id="#+id/location_buget_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:orientation="horizontal"
android:visibility="visible">
<LinearLayout
android:id="#+id/ll_budget_yearEstb"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:id="#+id/img_budget_yearEstb"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_horizontal"
android:src="#drawable/id_proejct_budget" />
<TextView
android:id="#+id/txt_budget_yearEstb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_location"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_horizontal"
android:padding="5dp"
android:src="#drawable/id_project_city" />
<TextView
android:id="#+id/location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:padding="5dp"
android:text="Mumbai,India"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/individual_firm_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:visibility="gone">
<ImageView
android:layout_width="#dimen/image_size_beside_text"
android:layout_height="#dimen/image_size_beside_text"
android:src="#drawable/id_expert_firm_ind" />
<TextView
android:id="#+id/individual_firm_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Firm/Individual" />
</LinearLayout>
<LinearLayout
android:id="#+id/awards_ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:visibility="gone">
<ImageView
android:layout_width="#dimen/image_size_beside_text"
android:layout_height="#dimen/image_size_beside_text"
android:src="#drawable/id_expert_awards" />
<TextView
android:id="#+id/awards_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
</LinearLayout>
<LinearLayout
android:id="#+id/web_add_ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:visibility="gone">
<ImageView
android:layout_width="#dimen/image_size_beside_text"
android:layout_height="#dimen/image_size_beside_text"
android:src="#drawable/id_seller_web" />
<TextView
android:id="#+id/web_add_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Abc.xyz" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_location_ho"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:visibility="gone">
<ImageView
android:layout_width="#dimen/image_size_beside_text"
android:layout_height="#dimen/image_size_beside_text"
android:src="#drawable/id_project_city" />
<TextView
android:id="#+id/location_ho_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Abc.xyz" />
</LinearLayout>
</LinearLayout>
Please let me know if I need to elaborate more anywhere.
This would help you:
when you hide your view use View.GONE , i think you are using View.INVISIBLE
Try to change nestedscrollview height to match_parent and the child linear layout height to wrap_content. After that according to you data change visibility of child layout of linear layout at run time.
I use SlidingUpPanelLayout in my project and i have a problem with it.
My SlidingUpPanelLayout has 2 children.
1) ListView for showing list of data - this is content
2) LinearLayout with his children (textvien, edittext, button) - this is slide up panel
When SlidingUpPanelLayout is showing i try to click on my button, and my SlidingUpPanelLayout immediately close, and i can't click on my button and edittext.
How can i get rid of this?
how can i setup click/show up panel on some View?
thanks!
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.sothree.slidinguppanel.SlidingUpPanelLayout
android:id="#+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ListView
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:divider="#drawable/shape_divider_comments"
android:dividerHeight="1dp"
android:id="#+id/lvReviews"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</ListView>
<LinearLayout
android:id="#+id/rlSlidingContent"
android:gravity="center|top"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ScrollView
android:visibility="visible"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
style="#style/StyleEditText"
android:id="#+id/etPersonName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="#string/your_name_hint"
android:inputType="textPersonName" >
</EditText>
<Button
style="#style/StyleButton"
android:visibility="visible"
android:id="#+id/btnAddComment"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Add" />
</LinearLayout>
</ScrollView>
</LinearLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
</RelativeLayout>
Check out the method setDragView it represents the "handle" of the drawer.
Also, check the overdraw of your views, you could simplify your layout,
for example:
<com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="#+id/lvReviews"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="#drawable/shape_divider_comments"
android:dividerHeight="1dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:visibility="gone" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:visibility="visible">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
android:id="#+id/etPersonName"
style="#style/StyleEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="#string/your_name_hint"
android:inputType="textPersonName">
</EditText>
<Button
android:id="#+id/btnAddComment"
style="#style/StyleButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Add"
android:visibility="visible" />
</LinearLayout>
</ScrollView>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
renders the same with far less overdraw