Appbar layout not scroll when dyanmically set recyclerview position? - android

I want to scroll recyclerview with dyanmic position for that i have used below layout but when i am set dynamic position in recyclerview. it is scroll but not above appbar layout.
So how to scroll both recyclerview and appbarlayout when set dynamic position using .
Is it possible parralel scroll if i will set dyamic position.
new Handler().postDelayed(new Runnable() {
#Override
public void run() {
rclTrendDetail.smoothScrollToPosition (3);
}
}, 2000);
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:fbutton="http://schemas.android.com/tools"
>
<android.support.design.widget.CoordinatorLayout
android:id="#+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/relativeTop"
android:background="#color/colorWhite"
android:padding="0dp"
>
<android.support.design.widget.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorWhite"
>
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsingLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorWhite"
app:contentScrim="#color/colorTransparent"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorWhite"
android:orientation="vertical"
>
<RelativeLayout
android:id="#+id/relativeProfile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorWhite"
>
<RelativeLayout
android:id="#+id/relativeVideo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorWhite"
android:visibility="gone"
>
<com.malmstein.fenster.view.FensterVideoView
android:id="#+id/videoplayer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
/>
<LinearLayout
android:id="#+id/linearPlay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/round_button_progress_bar"
android:gravity="center"
android:orientation="vertical"
>
<ImageView
android:id="#+id/imgShadow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:layout_marginTop="15dp"
android:src="#drawable/ic_play"
/>
</LinearLayout>
<com.spoof.app.customcontrol.CustomButtonRegular
android:id="#+id/gobbleVdoTxt"
style="#style/MyCustomButton"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="25dp"
android:background="#drawable/round_button_progress_bar"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:textAllCaps="false"
android:textColor="#color/colorWhite"
android:textSize="12sp"
android:textStyle="normal"
android:visibility="gone"
/>
<RelativeLayout
android:id="#+id/relativeVideoTime"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="20dp"
android:visibility="gone"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_toLeftOf="#+id/btnOnSale"
android:background="#drawable/round_button_progress_bar"
>
<com.spoof.app.customcontrol.CustomTextViewRegular
android:id="#+id/txtUpdateTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:maxLines="1"
android:textAllCaps="false"
android:textColor="#color/colorWhite"
android:textSize="12sp"
android:textStyle="normal"
/>
<app.minimize.com.seek_bar_compat.SeekBarCompat
android:id="#+id/range_slider5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_toLeftOf="#+id/txtTotalTime"
android:layout_toRightOf="#+id/txtUpdateTime"
android:maxHeight="300sp"
app:progressBackgroundColor="#color/colorWhite"
app:progressColor="#color/colorWhite"
app:thumbColor="#color/colorWhite"
/>
<com.spoof.app.customcontrol.CustomTextViewRegular
android:id="#+id/txtTotalTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:maxLines="1"
android:textAllCaps="false"
android:textColor="#color/colorWhite"
android:textSize="12sp"
android:textStyle="normal"
/>
</RelativeLayout>
<com.spoof.app.customcontrol.CustomButtonRegular
android:id="#+id/btnOnSale"
style="#style/MyCustomButton"
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:background="#drawable/round_button_progress_bar"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:text="#string/on_sale"
android:textAllCaps="false"
android:textColor="#color/colorWhite"
android:textSize="13sp"
android:textStyle="normal"
android:visibility="gone"
/>
<LinearLayout
android:id="#+id/linearGift"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:background="#drawable/round_button_progress_bar"
android:gravity="center"
android:visibility="gone"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="8dp"
android:src="#drawable/ic_gift"
/>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/imgSpoofImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:scaleType="fitXY"
/>
<RelativeLayout
android:id="#+id/relativeImgCorner"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</RelativeLayout>
<com.spoof.app.customcontrol.CustomButtonRegular
android:id="#+id/gobbleImgTxt"
style="#style/MyCustomButton"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="25dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:alpha="0.5"
android:background="#drawable/round_button_progress_bar"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:textAllCaps="false"
android:textColor="#color/colorWhite"
android:textSize="12sp"
android:textStyle="normal"
android:visibility="gone"
/>
</RelativeLayout>
<com.spoof.app.customcontrol.CustomButtonRegular
android:id="#+id/btnOnSaleImage"
style="#style/MyCustomButton"
android:layout_width="80dp"
android:layout_height="30dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_margin="15dp"
android:background="#drawable/round_button_progress_bar"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:text="#string/on_sale"
android:textAllCaps="false"
android:textColor="#color/colorWhite"
android:textSize="12sp"
android:textStyle="normal"
android:visibility="gone"
/>
<LinearLayout
android:id="#+id/linearGiftImage"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_margin="15dp"
android:background="#drawable/round_button_progress_bar"
android:gravity="center"
android:visibility="gone"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="8dp"
android:src="#drawable/ic_gift"
/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<LinearLayout
android:id="#+id/linearTop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:orientation="vertical"
>
<com.spoof.app.customcontrol.CustomTextViewLight
android:id="#+id/txtComment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="80dp"
android:layout_marginTop="5dp"
android:gravity="left|center_vertical"
android:textAllCaps="false"
android:textColor="#color/colorCrownBlack"
android:textSize="28sp"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="80dp"
android:orientation="horizontal"
>
<ImageView
android:id="#+id/imgCrown"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:scaleType="fitXY"
/>
<com.spoof.app.customcontrol.CustomTextViewLight
android:id="#+id/txtTotalSpoof"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:textAllCaps="false"
android:textColor="#color/colorCrownBlack"
android:textSize="13sp"
/>
</LinearLayout>
<RelativeLayout
android:id="#+id/relativeMain"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<RelativeLayout
android:id="#+id/relativeImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<ImageView
android:id="#+id/imgProfileBG"
android:layout_width="55dp"
android:layout_height="73dp"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:scaleType="fitXY"
/>
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/imgProfile"
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="18dp"
app:civ_border_width="4dp"
/>
</RelativeLayout>
<com.spoof.app.customcontrol.CustomTextViewMedium
android:id="#+id/txtUserName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:layout_toRightOf="#+id/relativeImage"
android:maxLines="1"
android:textAllCaps="false"
android:textColor="#color/colorDarkGray"
android:textSize="18sp"
/>
<com.spoof.app.customcontrol.CustomTextViewRegular
android:id="#+id/txtTrendTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/txtUserName"
android:layout_marginLeft="10dp"
android:layout_toRightOf="#+id/relativeImage"
android:maxLines="1"
android:text=""
android:textAllCaps="false"
android:textColor="#color/colorLoginText"
android:textSize="12sp"
/>
<com.spoof.app.customcontrol.CustomButtonRegular
android:id="#+id/btnFollow"
style="#style/MyCustomButton"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="#drawable/round_button_light_gray"
android:text="#string/following"
android:textAllCaps="false"
android:textColor="#color/colorCrownBlack"
android:textSize="10sp"
android:textStyle="normal"
android:visibility="gone"
/>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="5dp"
android:scaleType="fitXY"
android:src="#drawable/ic_separador"
/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
android:id="#+id/rclTrendDetail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill_vertical"
android:scrollbars="vertical"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
>
</android.support.v7.widget.RecyclerView>
</android.support.design.widget.CoordinatorLayout>
<LinearLayout
android:id="#+id/linearShare"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_margin="5dp"
android:gravity="center"
android:layout_alignParentRight="true"
android:layout_below="#+id/relativeTop"
>
<ImageView
android:id="#+id/imgShare"
android:layout_width="30dp"
android:layout_height="32dp"
android:layout_gravity="center"
android:src="#drawable/ico_share"
/>
</LinearLayout>
<RelativeLayout
android:id="#+id/relativeHome"
android:layout_width="61dp"
android:layout_height="61dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="30dp"
android:visibility="visible"
>
<info.hoang8f.widget.FButton
android:id="#+id/imgHome"
fbutton:buttonColor="#color/colorDarkGray"
fbutton:cornerRadius="5dp"
fbutton:shadowColor="#color/colorTransparent"
fbutton:shadowEnabled="false"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerInParent="true"
android:visibility="gone"
app:shadowHeight="0dp"
/>
<ImageView
android:id="#+id/imgIconHome"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerInParent="true"
/>
<com.spoof.app.customcontrol.CustomTextViewMedium
android:id="#+id/txtTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"
android:textColor="#color/colorDarkGray"
android:textSize="16sp"
android:visibility="gone"
/>
</RelativeLayout>
</RelativeLayout>

I don't think that's possible, but if you always want to collapse the appbar, regardless of the position that you choose, you could simply call this after every request for the scroll:
appBarLayout.setExpanded(true/false)
This will cause the app bar to collapse.
Further reading:
AppBarLayout.setExpanded(boolean)
Out of scope:
You should split your XML files into more layouts and use <include> tag, this will greatly improve readability of those files.

Related

Scroll view is not scrolling smoothly when tab layout and viewpager is placed inside scroll view?

I am facing the issue in scroll view is not scrolling smoothly when the tab navigation is placed inside the scroll view .
The below code is the xml file in which the tab navigation is placed inside the scroll view. I don't know the reason why this issue is occurring.Please help me how to solve this.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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/activity_interview_scam"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.zcodia.scamlookup.Activities.ScamDetailsActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="180dp"
android:foregroundGravity="center"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:id="#+id/profile_image"
android:background="#mipmap/bg_splash_cut"
android:src="#drawable/icon1"
/>
<TextView
android:text=""
android:textSize="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginBottom="8dp"
android:id="#+id/subCategoryTitle"
android:layout_above="#+id/textView11"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:textColor="#000000"/>
<TextView
android:text="Item ID:"
android:textSize="15dp"
android:textColor="#000000"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView11"
android:layout_alignBottom="#+id/profile_image"
android:layout_marginLeft="15dp"
android:layout_marginBottom="13dp" />
<TextView
android:text=""
android:textSize="15dp"
android:textColor="#000000"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/scamId"
android:layout_alignBottom="#+id/profile_image"
android:layout_marginLeft="75dp"
android:layout_marginBottom="13dp" />
<TextView
android:text="#string/arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="19dp"
android:layout_marginLeft="10dp"
android:id="#+id/arrow_id"
android:textColor="#FFFFFF"
android:textSize="20dp"/>
</RelativeLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#FAFAFA"
android:focusableInTouchMode="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/linearLayout4"
android:layout_below="#+id/profile_image"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/relative_layout_1"
android:background="#FFFFFF">
<TextView
android:layout_width="wrap_content"
android:layout_height="40dp"
android:text="No Of Cases Reported"
android:layout_marginLeft="15dp"
android:textSize="14dp"
android:id="#+id/report_cases_id"
android:gravity="center"/>
<TextView
android:textSize="14dp"
android:textColor="#EF5350"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/scam_report_count"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginRight="10dp"
android:layout_marginTop="12dp"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FAFAFA">
<TextView
android:layout_width="wrap_content"
android:layout_height="40dp"
android:text="Report Loss"
android:textSize="14dp"
android:paddingLeft="15dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:id="#+id/report_loss_id"
android:gravity="center"
/>
<TextView
android:textSize="14dp"
android:textColor="#EF5350"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/loos_id"
android:layout_marginRight="10dp"
android:paddingTop="12dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="40dp"
android:text="Possible Scammer Location"
android:textSize="14dp"
android:paddingLeft="15dp"
android:gravity="center"
android:id="#+id/possible_scammer_location_id" />
<TextView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:textSize="14dp"
android:textColor="#EF5350"
android:paddingTop="12dp"
android:layout_marginRight="10dp"
android:id="#+id/scam_location"
android:ellipsize="end"/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#FAFAFA"
android:orientation="horizontal"
>
<TextView
android:layout_width="0dp"
android:layout_height="40dp"
android:text="Target Medium"
android:textSize="14dp"
android:paddingTop="10dp"
android:layout_weight="1"
android:layout_marginLeft="10dp"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_marginRight="0dp"
android:id="#+id/scam_medium_linear">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/scam_medium_icon"
android:textSize="20dp"
android:layout_gravity="center"
android:layout_alignParentRight="true"
android:layout_marginRight="10dp"
android:layout_marginTop="3dp"
android:textColor="#EF5350"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/scam_medium_text"
android:textColor="#EF5350"
android:layout_marginTop="10dp"
android:layout_marginLeft="0dp"
android:layout_alignParentRight="true"
android:textSize="14dp"
android:gravity="center"
android:layout_marginRight="10dp"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="30dp"
android:text="Tactic"
android:layout_marginLeft="15dp"
android:textSize="14dp"
android:gravity="center"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/tactic_linear_layout"
android:background="#drawable/margin_color"
android:orientation="horizontal"
android:layout_marginLeft="20dp"
android:layout_marginTop="0dp"
android:paddingBottom="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/add_new_tactics"
android:orientation="vertical">
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/rectangele_width"
>
<android.support.design.widget.TabLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/tab_layout"
app:tabMode="fixed"
app:tabTextColor="#ccc"
app:tabPaddingStart="12dp"
app:tabSelectedTextColor="#D32F2F"
app:tabIndicatorColor="#D32F2F"
app:tabGravity="fill"
></android.support.design.widget.TabLayout>
</android.support.design.widget.AppBarLayout>
</LinearLayout>
<android.support.v4.view.ViewPager
android:layout_width="match_parent"
android:layout_height="420dp"
android:id="#+id/viewPager2"
android:background="#FAFAFA">
</android.support.v4.view.ViewPager>
</LinearLayout>
</ScrollView>
</LinearLayout>
Replace android.support.v4.widget.NestedScrollView instead of scroll view. It works for me try this....

Scrolling is not worked in GridView in android

I am doing an android application. In my application I wanted to scroll GridView and some other items in my layout at the same time. But when I add ScrollView to the parent layout, the GridView scrolling is not worked, it shows only first row of items. I tried ScrollView , NestedScrollView etc but did't get positive result.I don't know how to fix it, if anyone know it please help me.
xml file
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="activities.Home">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="#style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_marginTop="50dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/Rlayout_menus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="15dp">
<LinearLayout
android:id="#+id/layoutmenu1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<!--Offers-->
<LinearLayout
android:id="#+id/menu_offers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:background="#drawable/roundblue"
android:scaleType="center"
android:src="#drawable/offer" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Offers"
android:textColor="#color/black" />
</LinearLayout>
<!--Menu-->
<LinearLayout
android:id="#+id/menu_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="13dp"
android:layout_toRightOf="#+id/menu_offers"
android:orientation="vertical">
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:background="#drawable/roundblue"
android:scaleType="center"
android:src="#drawable/menu" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Menu"
android:textColor="#color/black" />
</LinearLayout>
<!--Exchange-->
<LinearLayout
android:id="#+id/menu_exchange"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="13dp"
android:layout_toRightOf="#+id/menu_menu"
android:orientation="vertical">
<ImageView
android:id="#+id/img_exchange"
android:layout_width="55dp"
android:layout_height="55dp"
android:background="#drawable/roundblue"
android:scaleType="center"
android:src="#drawable/exchange" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Exchange"
android:textColor="#color/black" />
</LinearLayout>
<!--Health-->
<LinearLayout
android:id="#+id/menu_health"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="13dp"
android:layout_toRightOf="#+id/menu_exchange"
android:orientation="vertical">
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:background="#drawable/roundblue"
android:scaleType="center"
android:src="#drawable/health" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Health"
android:textColor="#color/black" />
</LinearLayout>
<!--Less-->
<LinearLayout
android:id="#+id/menu_less"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="13dp"
android:layout_toRightOf="#+id/menu_health"
android:orientation="vertical">
<ImageView
android:id="#+id/img_less_more"
android:layout_width="55dp"
android:layout_height="55dp"
android:background="#drawable/roundblue"
android:scaleType="center"
android:src="#drawable/less" />
<TextView
android:id="#+id/txt_less_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Less"
android:textColor="#color/black" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/layoutmenu2"
android:layout_below="#+id/layoutmenu1"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<!--Bank-->
<LinearLayout
android:id="#+id/menu_bank"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/menu_offers"
android:layout_marginTop="10dp"
android:orientation="vertical">
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:background="#drawable/roundblue"
android:scaleType="center"
android:src="#drawable/bank" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Bank"
android:textColor="#color/black" />
</LinearLayout>
<!--SOS-->
<LinearLayout
android:id="#+id/menu_sos"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/menu_menu"
android:layout_marginLeft="13dp"
android:layout_marginTop="10dp"
android:layout_toRightOf="#+id/menu_bank"
android:orientation="vertical">
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:background="#drawable/roundblue"
android:scaleType="center"
android:src="#drawable/sos" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="SOS"
android:textColor="#color/black" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<View
android:id="#+id/view"
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_below="#id/Rlayout_menus"
android:background="#F0F0F0" />
<RelativeLayout
android:id="#+id/layout_subCat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/view">
<TextView
android:id="#+id/txt_category"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:text="Search by Catagory"
android:textColor="#color/black"
android:textStyle="bold" />
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbarThumbHorizontal="#null"
android:scrollbars="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<Button
android:id="#+id/btn_electronics"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="28dp"
android:background="#drawable/rect_m"
android:drawableLeft="#drawable/electronics"
android:paddingRight="10dp"
android:text="Electronics"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textStyle="bold" />
<Button
android:id="#+id/btn_food"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="28dp"
android:background="#drawable/rect_g"
android:drawableLeft="#drawable/food"
android:drawablePadding="5dp"
android:paddingLeft="5dp"
android:text="Food"
android:textAlignment="textStart"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textStyle="bold"
/>
<Button
android:id="#+id/btn_cosmetics"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="28dp"
android:background="#drawable/rect_b"
android:drawableLeft="#drawable/cosmetics"
android:drawablePadding="5dp"
android:paddingLeft="5dp"
android:paddingRight="10dp"
android:text="Cosmetics"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textStyle="bold"
/>
<Button
android:id="#+id/btn_nonfood"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="10dp"
android:layout_marginTop="28dp"
android:background="#drawable/elctronics_btn"
android:backgroundTint="#e2ef0e15"
android:text="Non Food"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textStyle="bold"
/>
</LinearLayout>
</HorizontalScrollView>
</RelativeLayout>
<View
android:id="#+id/view2"
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_below="#id/layout_subCat"
android:layout_marginTop="15dp"
android:background="#F0F0F0" />
<RelativeLayout
android:id="#+id/layout_company"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/view2"
android:background="#E7E7E7">
<TextView
android:id="#+id/txt_company"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="5dp"
android:text="Search by Company"
android:textColor="#color/black"
android:textStyle="bold" />
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbarThumbHorizontal="#null"
android:scrollbars="horizontal">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="#+id/company1"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginLeft="15dp"
android:layout_marginTop="25dp"
android:background="#FFF"
android:gravity="center">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="#drawable/company_logo" />
</LinearLayout>
<LinearLayout
android:id="#+id/company2"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginTop="25dp"
android:layout_toRightOf="#+id/company1"
android:gravity="center">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="#drawable/company_logo" />
</LinearLayout>
<LinearLayout
android:id="#+id/company3"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginTop="25dp"
android:layout_toRightOf="#+id/company2"
android:gravity="center">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="#drawable/company_logo" />
</LinearLayout>
<LinearLayout
android:id="#+id/company4"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginTop="25dp"
android:layout_toRightOf="#+id/company3"
android:gravity="center"
>
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="#drawable/company_logo" />
</LinearLayout>
<LinearLayout
android:id="#+id/company5"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginTop="25dp"
android:layout_toRightOf="#+id/company4"
android:gravity="center"
>
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="#drawable/company_logo" />
</LinearLayout>
<LinearLayout
android:id="#+id/company6"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginTop="25dp"
android:layout_toRightOf="#+id/company5"
android:gravity="center"
>
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="#drawable/company_logo" />
</LinearLayout>
<LinearLayout
android:id="#+id/company7"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginTop="25dp"
android:layout_toRightOf="#+id/company6"
android:gravity="center"
>
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="#drawable/company_logo" />
</LinearLayout>
</RelativeLayout>
</HorizontalScrollView>
</RelativeLayout>
<GridView
android:id="#+id/home_grid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center"
android:layout_weight="1"
android:horizontalSpacing="10dp"
android:numColumns="2" />
</LinearLayout>
</ScrollView>
<ViewStub
android:layout_marginTop="240dp"
android:id="#+id/layout_stub"
android:inflatedId="#+id/message_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</android.support.design.widget.CoordinatorLayout>
Simply enable your GridView Property
android:nestedScrollingEnabled="true" It will work.
have you looked at this answer How to put GridView inside ScrollView ?
if you want to scroll Gridview anyway, use it in your parent layout(Linearlayout with weightSum) outside the scrollview's child layout

Android WebView Rendering Issue after Android System Webview Update

I am facing Webview Rendering issue on Android devices after Android System WebView Update. Webview is rendering outside the screen. For more information, please check screenshot.
Does anyone have a same issue?
Any help will be appreciated.Thanks in advance.
Please see the xml file as asked:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="#+id/toolbar"
layout="#layout/toolbar" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/fragment_back_color">
<ScrollView
android:id="#+id/offerDetailScrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:layout_above="#+id/installTextView">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp">
<android.support.v7.widget.CardView
android:id="#+id/card_offer"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="#+id/topViewDealDisplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/white"
android:gravity="center"
android:orientation="vertical"
android:paddingBottom="10dp"
android:paddingTop="10dp">
<ImageView
android:id="#+id/dealImageView"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_centerInParent="true"
android:layout_margin="5dp"></ImageView>
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/dealNameTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="4dp"
android:text=""
android:textColor="#color/text_color"
android:textSize="18sp" />
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/offerTitleTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="4dp"
android:text="deal titile"
android:textColor="#color/lower_text_color"
android:textSize="18sp"
android:visibility="gone" />
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/offerTypeTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="2"
android:text=""
android:textColor="#color/lower_text_color"
android:textSize="14sp" />
</LinearLayout>
<FrameLayout
android:id="#+id/frameLayoutAmount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="20dp"
android:clickable="true"
android:focusable="true"
android:gravity="right">
<ImageView
android:id="#+id/iv_rupee_bg"
android:layout_width="70dp"
android:layout_height="30dp"
android:layout_marginRight="-15dp"
android:background="#drawable/deals_image_background" />
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/tv_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:paddingLeft="4dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff"
android:textSize="17sp" />
</FrameLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/cardview_descImage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/card_offer"
android:layout_marginTop="10dp"
android:paddingBottom="5dp"
android:paddingTop="5dp">
<ImageView
android:id="#+id/dealDescriptionImageView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#null"
android:visibility="visible" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/cardview_shortDesc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/cardview_descImage"
android:layout_marginTop="10dp"
android:padding="5dp">
<WebView
android:id="#+id/shortDescWebView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible" />
</android.support.v7.widget.CardView>
<com.spiceladdoo.views.LatoBoldTextView
android:id="#+id/related_offer_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/cardview_shortDesc"
android:layout_gravity="center"
android:layout_marginRight="10dp"
android:text="SIMILAR OFFERS"
android:textColor="#color/text_color"
android:textSize="13sp" />
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerViewoffers"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_below="#id/related_offer_text"
android:layout_marginTop="10dp"
android:scrollbars="none" />
<ProgressBar
android:id="#+id/shortDescriptionProgress"
style="?android:attr/android:progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="visible" />
</RelativeLayout>
</ScrollView>
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/installTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:layout_marginTop="5dp"
android:background="#color/newFreeBColor"
android:gravity="center"
android:paddingBottom="15dp"
android:paddingTop="15dp"
android:text="INSTALL"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#FFFFFF"
android:textSize="16sp"
android:textStyle="bold"
android:visibility="visible" />
<FrameLayout
android:id="#+id/hint"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/layoutInstallHint"
android:background="#99000000"></RelativeLayout>
<RelativeLayout
android:id="#+id/layoutInstallHint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:background="#99000000">
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/installTextHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginBottom="15dp"
android:layout_marginTop="5dp"
android:background="#color/spice_laddooblue"
android:paddingBottom="10dp"
android:paddingLeft="80dp"
android:paddingRight="80dp"
android:paddingTop="10dp"
android:text="INSTALL"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#FFFFFF"
android:textSize="15sp"
android:textStyle="bold"
android:visibility="visible" />
</RelativeLayout>
<com.spiceladdoo.views.LatoRegularTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/imageViewHintPinIcon"
android:layout_centerHorizontal="true"
android:text="Click on Button"
android:textColor="#color/white"
android:textSize="18sp" />
<ImageView
android:id="#+id/imageViewHintPinIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="50dp"
android:src="#drawable/hint_pin_down" />
</RelativeLayout>
</FrameLayout>
</RelativeLayout>
I think you have made mistake in giving webview's height you have given it as wrap_content instead try match_parent and give it try
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="#+id/toolbar"
layout="#layout/toolbar" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/fragment_back_color">
<ScrollView
android:id="#+id/offerDetailScrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:layout_above="#+id/installTextView">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp">
<android.support.v7.widget.CardView
android:id="#+id/card_offer"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="#+id/topViewDealDisplay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/white"
android:gravity="center"
android:orientation="vertical"
android:paddingBottom="10dp"
android:paddingTop="10dp">
<ImageView
android:id="#+id/dealImageView"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_centerInParent="true"
android:layout_margin="5dp"></ImageView>
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/dealNameTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="4dp"
android:text=""
android:textColor="#color/text_color"
android:textSize="18sp" />
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/offerTitleTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="4dp"
android:text="deal titile"
android:textColor="#color/lower_text_color"
android:textSize="18sp"
android:visibility="gone" />
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/offerTypeTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="2"
android:text=""
android:textColor="#color/lower_text_color"
android:textSize="14sp" />
</LinearLayout>
<FrameLayout
android:id="#+id/frameLayoutAmount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="20dp"
android:clickable="true"
android:focusable="true"
android:gravity="right">
<ImageView
android:id="#+id/iv_rupee_bg"
android:layout_width="70dp"
android:layout_height="30dp"
android:layout_marginRight="-15dp"
android:background="#drawable/deals_image_background" />
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/tv_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:paddingLeft="4dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff"
android:textSize="17sp" />
</FrameLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/cardview_descImage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/card_offer"
android:layout_marginTop="10dp"
android:paddingBottom="5dp"
android:paddingTop="5dp">
<ImageView
android:id="#+id/dealDescriptionImageView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#null"
android:visibility="visible" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/cardview_shortDesc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/cardview_descImage"
android:layout_marginTop="10dp"
android:padding="5dp">
<WebView
android:id="#+id/shortDescWebView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible" />
</android.support.v7.widget.CardView>
<com.spiceladdoo.views.LatoBoldTextView
android:id="#+id/related_offer_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/cardview_shortDesc"
android:layout_gravity="center"
android:layout_marginRight="10dp"
android:text="SIMILAR OFFERS"
android:textColor="#color/text_color"
android:textSize="13sp" />
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerViewoffers"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_below="#id/related_offer_text"
android:layout_marginTop="10dp"
android:scrollbars="none" />
<ProgressBar
android:id="#+id/shortDescriptionProgress"
style="?android:attr/android:progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="visible" />
</RelativeLayout>
</ScrollView>
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/installTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:layout_marginTop="5dp"
android:background="#color/newFreeBColor"
android:gravity="center"
android:paddingBottom="15dp"
android:paddingTop="15dp"
android:text="INSTALL"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#FFFFFF"
android:textSize="16sp"
android:textStyle="bold"
android:visibility="visible" />
<FrameLayout
android:id="#+id/hint"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/layoutInstallHint"
android:background="#99000000"></RelativeLayout>
<RelativeLayout
android:id="#+id/layoutInstallHint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:background="#99000000">
<com.spiceladdoo.views.LatoRegularTextView
android:id="#+id/installTextHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginBottom="15dp"
android:layout_marginTop="5dp"
android:background="#color/spice_laddooblue"
android:paddingBottom="10dp"
android:paddingLeft="80dp"
android:paddingRight="80dp"
android:paddingTop="10dp"
android:text="INSTALL"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#FFFFFF"
android:textSize="15sp"
android:textStyle="bold"
android:visibility="visible" />
</RelativeLayout>
<com.spiceladdoo.views.LatoRegularTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/imageViewHintPinIcon"
android:layout_centerHorizontal="true"
android:text="Click on Button"
android:textColor="#color/white"
android:textSize="18sp" />
<ImageView
android:id="#+id/imageViewHintPinIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="50dp"
android:src="#drawable/hint_pin_down" />
</RelativeLayout>
</FrameLayout>
</RelativeLayout>
or if this not work then you can put scrollview inside cardview and then webview in card view

split relative layout into two equal parts using linear layouts

I have a relative layout which contains two linear layouts. I want these two linear layouts to be placed in either halves of the relative layout containing them i.e. one to be positioned at top half and other at bottom half. Can anyone here help me with this. Here is the xml:
<RelativeLayout
android:id="#+id/updatedetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:orientation="vertical"
android:background="#drawable/oneeventbkg" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/Top_half_layout">
<ImageView
android:id="#+id/update_sn_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginTop="2dp" />
<TextView
android:id="#+id/update_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_margin="5dp"
android:textColor="#android:color/white"
android:textSize="14sp" />
<ImageView
android:id="#+id/update_message_pic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#id/update_sn_icon"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp" />
<TextView
android:id="#+id/update_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#id/update_message_pic"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:maxHeight="400dp"
android:scrollbars="vertical"
android:textColor="#android:color/white"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/bottom_half_layout">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="10dp"
android:id="#+id/toggle_after"
android:visibility="invisible">
<TextView
android:id="#+id/toggle_like_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="10dp"
android:text="1000"
android:background="#android:color/transparent"
android:textColor="#android:color/white"
android:textSize="14sp" />
<ImageButton
android:id="#+id/toggle_like_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#android:color/transparent"
android:src="#drawable/xml_like_button_selctor" />
<TextView
android:id="#+id/toggle_comment_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="7dp"
android:text="100"
android:background="#android:color/transparent"
android:textColor="#android:color/white"
android:textSize="14sp" />
<ImageButton
android:id="#+id/toggle_comment_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#android:color/transparent"
android:src="#drawable/xml_comment_button_selector" />
</LinearLayout>
<ListView
android:id="#+id/likes_list"
android:layout_width="wrap_content"
android:layout_height="200dp"
android:layout_below="#id/toggle_after"
android:padding="20dp"
/>
<ListView
android:id="#+id/comments_list"
android:layout_width="wrap_content"
android:layout_height="200dp"
android:layout_below="#id/toggle_after"
android:padding="20dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="#id/comments_list"
android:layout_marginBottom="10dp"
android:id="#+id/toggle_content"
android:layout_alignParentBottom="true">
<TextView
android:id="#+id/like_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="10dp"
android:text="1000"
android:background="#android:color/transparent"
android:textColor="#android:color/white"
android:textSize="14sp" />
<ImageButton
android:id="#+id/like_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#android:color/transparent"
android:src="#drawable/xml_like_button_selctor" />
<TextView
android:id="#+id/comment_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="7dp"
android:text="100"
android:background="#android:color/transparent"
android:textColor="#android:color/white"
android:textSize="14sp" />
<ImageButton
android:id="#+id/comment_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#android:color/transparent"
android:src="#drawable/xml_comment_button_selector" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
Try this..
<LinearLayout
android:id="#+id/updatedetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:orientation="vertical"
android:background="#drawable/oneeventbkg" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="#+id/Top_half_layout">
// Your Codes
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="#+id/bottom_half_layout">
// Your Codes
</LinearLayout>
</LinearLayout>
EDIT
<LinearLayout
android:id="#+id/updatedetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:orientation="vertical"
android:background="#drawable/oneeventbkg" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="#+id/Top_half_layout">
// Your Codes
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="#+id/bottom_half_layout">
// Your Codes
</RelativeLayout>
</LinearLayout>
// Try this way,hope this will help you to solve your problem...
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/updatedetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:background="#drawable/oneeventbkg" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="#+id/Top_half_layout"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/update_sn_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="10dp"
android:layout_marginTop="2dp" />
<TextView
android:id="#+id/update_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:textColor="#android:color/white"
android:layout_gravity="right"
android:textSize="14sp" />
</LinearLayout>
<ImageView
android:id="#+id/update_message_pic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp" />
<TextView
android:id="#+id/update_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:maxHeight="400dp"
android:scrollbars="vertical"
android:textColor="#android:color/white"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="#+id/bottom_half_layout"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="10dp"
android:id="#+id/toggle_after"
android:visibility="invisible">
<TextView
android:id="#+id/toggle_like_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="10dp"
android:text="1000"
android:background="#android:color/transparent"
android:textColor="#android:color/white"
android:textSize="14sp" />
<ImageButton
android:id="#+id/toggle_like_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#android:color/transparent"
android:src="#drawable/xml_like_button_selctor" />
<TextView
android:id="#+id/toggle_comment_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="7dp"
android:text="100"
android:background="#android:color/transparent"
android:textColor="#android:color/white"
android:textSize="14sp" />
<ImageButton
android:id="#+id/toggle_comment_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#android:color/transparent"
android:src="#drawable/xml_comment_button_selector" />
</LinearLayout>
<ListView
android:id="#+id/likes_list"
android:layout_width="wrap_content"
android:layout_height="200dp"
android:padding="20dp" />
<ListView
android:id="#+id/comments_list"
android:layout_width="wrap_content"
android:layout_height="200dp"
android:padding="20dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="10dp"
android:id="#+id/toggle_content">
<TextView
android:id="#+id/like_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="10dp"
android:text="1000"
android:background="#android:color/transparent"
android:textColor="#android:color/white"
android:textSize="14sp" />
<ImageButton
android:id="#+id/like_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#android:color/transparent"
android:src="#drawable/xml_like_button_selctor" />
<TextView
android:id="#+id/comment_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="7dp"
android:text="100"
android:background="#android:color/transparent"
android:textColor="#android:color/white"
android:textSize="14sp" />
<ImageButton
android:id="#+id/comment_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#android:color/transparent"
android:src="#drawable/xml_comment_button_selector" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>

Button not widening

I cannot widen buttons on my Android project. I'm only having an issue with one of them.
This is what I'm getting
And this is what I want
Only the buttons. Here is my XML for the corresponding issue.
<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:background="#4ECDC4"
tools:context=".MainActivity" >
<RelativeLayout
android:id="#+id/rlSignInForm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/rlSignInTitle"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="36dp" >
<LinearLayout
android:id="#+id/llSignInBody"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#FFFFFF"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical"
android:visibility="visible"
android:weightSum="2" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:layout_weight="1" >
<ImageView
android:id="#+id/ivEmailIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/email_icon"
android:contentDescription="#null"
android:layout_alignBottom="#+id/etSignInEmail"
android:layout_marginBottom="2dp"/>
<EditText
android:id="#+id/etSignInEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:background="#null"
android:layout_toRightOf="#+id/ivEmailIcon"
android:layout_marginLeft="10dp"
android:gravity="bottom"
android:hint="#string/email"
android:inputType="textEmailAddress"
android:textColor="#android:color/black"
android:textSize="18sp" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#drawable/sign_in_divider" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:layout_weight="1" >
<ImageView
android:id="#+id/ivPasswordIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/password_icon"
android:contentDescription="#null"
android:layout_alignBottom="#+id/etSignInPassword"
android:layout_marginBottom="3dp"/>
<EditText
android:id="#+id/etSignInPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:background="#null"
android:layout_toRightOf="#+id/ivPasswordIcon"
android:layout_marginLeft="10dp"
android:gravity="bottom"
android:hint="#string/password"
android:inputType="textPassword"
android:textColor="#android:color/black"
android:textSize="18sp" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/llSignUpBody"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#FFFFFF"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical"
android:visibility="visible"
android:weightSum="3" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:layout_weight="1" >
<ImageView
android:id="#+id/ivUserNameIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/username_icon"
android:contentDescription="#null"
android:layout_alignBottom="#+id/etSignUpName"/>
<EditText
android:id="#+id/etSignUpName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="#+id/ivUserNameIcon"
android:background="#null"
android:gravity="bottom"
android:hint="#string/username"
android:singleLine="true"
android:textColor="#android:color/black"
android:textSize="18sp" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#drawable/sign_in_divider" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:layout_weight="1" >
<ImageView
android:id="#+id/ivEmailIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/email_icon"
android:contentDescription="#null"
android:layout_alignBottom="#+id/etSignUpEmail"
android:layout_marginBottom="2dp"/>
<EditText
android:id="#+id/etSignUpEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="#+id/ivEmailIcon"
android:background="#null"
android:gravity="bottom"
android:hint="#string/email"
android:inputType="textEmailAddress"
android:textColor="#android:color/black"
android:textSize="18sp" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#drawable/sign_in_divider" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:layout_weight="1" >
<ImageView
android:id="#+id/ivPasswordIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/password_icon"
android:contentDescription="#null"
android:layout_alignBottom="#+id/etSignUpPassword"
android:layout_marginBottom="3dp"/>
<EditText
android:id="#+id/etSignUpPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="#+id/ivPasswordIcon"
android:background="#null"
android:gravity="bottom"
android:hint="#string/password"
android:inputType="textPassword"
android:textColor="#android:color/black"
android:textSize="18sp" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/llForgotPasswordBody"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#FFFFFF"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical"
android:weightSum="2"
android:visibility="gone" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_margin="20dp"
android:layout_weight="1" >
<ImageView
android:id="#+id/ivEmailIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/email_icon"
android:contentDescription="#null"
android:layout_alignBottom="#+id/etForgotPasswordEmail"
android:layout_marginBottom="2dp"/>
<EditText
android:id="#+id/etForgotPasswordEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:background="#null"
android:layout_toRightOf="#+id/ivEmailIcon"
android:layout_marginLeft="10dp"
android:gravity="bottom"
android:hint="#string/email"
android:inputType="textEmailAddress"
android:textColor="#android:color/black"
android:textSize="18sp" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
<Button
android:id="#+id/btnForgotPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/rlSignInForm"
android:layout_below="#+id/rlSignInForm"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:background="#null"
android:text="#string/forgot_password"
android:textColor="#FFFFFF"
android:textSize="14sp" />
<Button
android:id="#+id/btnSendPassword"
android:layout_width="175dp"
android:layout_height="55dp"
android:layout_below="#+id/rlSignInTitle"
android:layout_centerHorizontal="true"
android:layout_marginTop="180dp"
android:background="#drawable/rounded_rect_positive_selector"
android:gravity="center"
android:text="#string/SEND_PASSWORD"
android:textColor="#android:color/white"
android:textStyle="bold"
android:width="175dp"
android:height="55dp"
android:visibility="gone" />
<Button
android:id="#+id/btnActive"
android:layout_width="175dp"
android:layout_height="55dp"
android:layout_alignLeft="#+id/btnInactive"
android:layout_alignRight="#+id/rlSignInForm"
android:layout_below="#+id/rlSignInTitle"
android:layout_marginTop="280dp"
android:background="#AD5BDB"
android:gravity="center"
android:text="#string/SIGN_IN"
android:textColor="#android:color/white"
android:textSize="22sp"
android:textStyle="bold"
android:visibility="visible" />
<Button
android:id="#+id/btnInactive"
style="#style/AppTheme"
android:layout_width="175dp"
android:layout_height="55dp"
android:layout_alignLeft="#+id/rlSignInForm"
android:layout_alignRight="#+id/rlSignInForm"
android:layout_below="#+id/btnActive"
android:layout_marginTop="14dp"
android:background="#AD58DB"
android:gravity="center"
android:text="#string/SIGN_UP"
android:textColor="#android:color/white"
android:textSize="22sp"
android:textStyle="bold"
android:visibility="visible" />
<RelativeLayout
android:id="#+id/rlNoInternetNotification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/rlSignInTitle"
android:visibility="gone" >
<include layout="#layout/no_internet_notification" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlPushNotification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/rlSignInTitle"
android:visibility="gone" >
<include layout="#layout/push_notification" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlSignInTitle"
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="30dp"
android:background="#4ECDC4" >
<com.cloverstudio.spika.view.MyriadProTextView
android:id="#+id/tvSignInTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="#string/SIGN_IN"
android:textColor="#android:color/white"
android:textSize="26sp" />
</RelativeLayout>
</RelativeLayout>
The smaller button is btnSendPassword and the other button is btnActive. I've tried playing with the widths but nothing changed. I'm fairly new so any explaination why this is happening would be good, so then I know whats wrong if it happens again.Any help would be wonderful.
You should align your btnSendPassword button with rlSignInForm for both left and right...then you will achieve your requirement. Replace the following XML snippet of btnSendPassword with your existing XML snippet of btnSendPassword...you will get all the problem solved.
<Button
android:id="#+id/btnSendPassword"
android:layout_width="175dp"
android:layout_height="55dp"
android:layout_below="#+id/rlSignInTitle"
android:layout_alignLeft="#+id/rlSignInForm"
android:layout_alignRight="#+id/rlSignInForm"
android:layout_marginTop="180dp"
android:background="#drawable/rounded_rect_positive_selector"
android:gravity="center"
android:text="#string/SEND_PASSWORD"
android:textColor="#android:color/white"
android:textStyle="bold"
android:visibility="gone" />
Set android:layout_width="match_parent". This should solve your problem.

Categories

Resources