I can't scroll in the listView in NestedScrollView (fragment)
Attempted code:
setNestedScrollingEnabled(true);
<android.support.v4.widget.NestedScrollView android:fillViewport="true" /> and <View android:nestedScrollingEnabled = "true" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="50px">
<WebView
android:id="#+id/wb"
android:layout_width="match_parent"
android:layout_height="244dp"
android:visibility="gone" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="Recherche statistique des pays "
android:textColor="#5E5E5E"
android:textSize="24dp" />
<View
android:layout_width="40dp"
android:layout_height="6dp"
android:layout_gravity="center"
android:layout_marginLeft="8dp"
android:background="#drawable/bg_view">
</View>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_regular"
android:text="ÉVOLUTION DU CORONAVIRUS COVID-19 "
android:textColor="#5E5E5E"
android:textSize="18dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp">
<SearchView
android:id="#+id/cher"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:orientation="horizontal">
<TextView
android:id="#+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="#font/roboto_medium"
android:text="Statistiques"
android:textColor="#5E5E5E"
android:textSize="18dp" />
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_gravity="center"
android:layout_marginLeft="8dp"
android:background="#7a8b8b8b"></View>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="visible">
<ProgressBar
android:id="#+id/loadin"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_weight="250" />
<ListView
android:id="#+id/ListC"
android:layout_width="match_parent"
android:layout_height="500dp"
android:layout_gravity="center"
android:divider="#ffffff"></ListView>
</LinearLayout>
<LinearLayout
android:id="#+id/lst1"
android:layout_width="match_parent"
android:layout_height="446dp"
android:layout_marginTop="14dp"
android:orientation="horizontal"/>
<LinearLayout
android:id="#+id/lin1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal"
android:visibility="gone">
<android.support.v7.widget.CardView
android:layout_width="160dp"
android:layout_height="120dp"
android:layout_weight="1"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="Nombre total de cas"
android:textColor="#5E5E5E"
android:textSize="18dp" />
<TextView
android:id="#+id/tot1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:textColor="#FFFFFF"
android:textSize="29dp" />
<ProgressBar
android:id="#+id/l1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:indeterminate="true" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="160dp"
android:layout_height="120dp"
android:layout_marginLeft="18dp"
android:layout_weight="1"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="Nouveaux cas"
android:textColor="#5E5E5E"
android:textSize="18dp" />
<TextView
android:id="#+id/casN1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:textColor="#FFFFFF"
android:textSize="29dp" />
<ProgressBar
android:id="#+id/l2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:indeterminate="true" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout
android:id="#+id/lin2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:orientation="horizontal"
android:visibility="gone">
<android.support.v7.widget.CardView
android:layout_width="160dp"
android:layout_height="120dp"
android:layout_weight="1"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="Total des décès"
android:textColor="#5E5E5E"
android:textSize="18dp" />
<TextView
android:id="#+id/dead1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:textColor="#FFFFFF"
android:textSize="29dp" />
<ProgressBar
android:id="#+id/l3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:indeterminate="true" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="160dp"
android:layout_height="120dp"
android:layout_marginLeft="18dp"
android:layout_weight="1"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="Nouvelles morts"
android:textColor="#5E5E5E"
android:textSize="18dp" />
<TextView
android:id="#+id/Ndead1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:textColor="#FFFFFF"
android:textSize="29dp" />
<ProgressBar
android:id="#+id/l4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:indeterminate="true" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout
android:id="#+id/lin3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
android:orientation="horizontal"
android:visibility="gone">
<android.support.v7.widget.CardView
android:layout_width="160dp"
android:layout_height="120dp"
android:layout_weight="1"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="Total récupéré"
android:textColor="#5E5E5E"
android:textSize="18dp" />
<TextView
android:id="#+id/Totrec1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:textColor="#FFFFFF"
android:textSize="29dp" />
<ProgressBar
android:id="#+id/l5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:indeterminate="true" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="160dp"
android:layout_height="120dp"
android:layout_marginLeft="18dp"
android:layout_weight="1"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="Cas active"
android:textColor="#5E5E5E"
android:textSize="18dp" />
<TextView
android:id="#+id/act1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:textColor="#FFFFFF"
android:textSize="29dp" />
<ProgressBar
android:id="#+id/l6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:indeterminate="true" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout
android:id="#+id/lin4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
android:orientation="horizontal"
android:visibility="gone">
<android.support.v7.widget.CardView
android:layout_width="160dp"
android:layout_height="120dp"
android:layout_weight="1"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="Cas critique"
android:textColor="#5E5E5E"
android:textSize="18dp" />
<TextView
android:id="#+id/cri1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:textColor="#FFFFFF"
android:textSize="29dp" />
<ProgressBar
android:id="#+id/l7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:indeterminate="true" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="160dp"
android:layout_height="120dp"
android:layout_marginLeft="18dp"
android:layout_weight="1"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="Nombre total de cas / 1M habitants"
android:textColor="#5E5E5E"
android:textSize="18dp" />
<TextView
android:id="#+id/tot1m1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:textColor="#FFFFFF"
android:textSize="29dp" />
<ProgressBar
android:id="#+id/l8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:indeterminate="true" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
I know I shouldn't use ListView in NestedScrollView, but I have no other option for now
Hope someone can help !
Related
I have one fragment whose layout i want to show above keyboard when softkeyboard opens up. The layout is:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:background="#drawable/ic_bg_splash"
android:fitsSystemWindows="true">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="#+id/cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2">
<ImageButton
android:id="#+id/previous"
android:layout_width="37.5dp"
android:layout_height="37.5dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="22dp"
android:background="#drawable/left"
android:padding="7dp" />
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:paddingTop="12dp">
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardCornerRadius="7dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_marginTop="7dp"
android:layout_marginRight="12dp"
android:layout_marginBottom="7dp"
android:orientation="vertical">
<ImageView
android:id="#+id/subCat"
android:layout_width="157.5dp"
android:layout_height="157.5dp" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="50dp"
android:gravity="center"
android:orientation="vertical"
android:paddingTop="12dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/nunito"
android:paddingLeft="20dp"
android:text="#string/enter_answer"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="13sp" />
<LinearLayout
android:layout_width="262.5dp"
android:layout_height="52.5dp"
android:layout_marginTop="7dp"
android:background="#drawable/answer_bg"
android:orientation="horizontal">
<EditText
android:id="#+id/answer"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="8"
android:background="#null"
android:fontFamily="#font/nunito"
android:inputType="textNoSuggestions"
android:maxLines="1"
android:padding="7dp"
android:textColor="#android:color/white"
android:textSize="15sp" />
<ImageView
android:id="#+id/wrong_answer"
android:layout_width="27.5dp"
android:layout_height="28dp"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="10dp"
android:src="#drawable/red_cross"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="22dp"
android:layout_marginBottom="27dp"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="#+id/reset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/nunito"
android:text="#string/reset"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="14.3sp" />
<TextView
android:id="#+id/submit_ans"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="32dp"
android:background="#drawable/white_rounded"
android:fontFamily="#font/nunito_semibold"
android:paddingLeft="17dp"
android:paddingTop="7dp"
android:paddingRight="17dp"
android:paddingBottom="7dp"
android:text="#string/submit"
android:textAllCaps="true"
android:textColor="#color/lineColor"
android:textSize="14.3sp" />
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2">
<ImageButton
android:id="#+id/next"
android:layout_width="37.5dp"
android:layout_height="37.5dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="22dp"
android:background="#drawable/right" />
</RelativeLayout>
</LinearLayout>
<RelativeLayout
android:id="#+id/write_dark"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#70000000"
android:elevation="10dp"
android:visibility="gone">
<ImageView
android:id="#+id/write_success"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="10dp" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
I have tried by setting windowssoftinputmode to adjustResize in manifest and also using fitsystemwindows to true in the fragment parent layout but still it is not working and using scrollview as parent layout instead of relativelayout. So please suggest me any workaround for this issue.
Edit: Added below activity.xml layout:
Below is the host activity layout:
<?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:background="#drawable/language_bg"
android:orientation="vertical"
tools:context=".home.HomeActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/bottom_rounded">
<RelativeLayout
android:id="#+id/taskBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="10dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_gravity="center_vertical"
android:layout_weight="1.7"
android:paddingLeft="30dp"
android:paddingTop="5dp">
<ImageView
android:layout_width="143dp"
android:layout_height="56dp"
android:layout_gravity="left|center_vertical"
android:src="#drawable/hello_logo" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_weight="3"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:id="#+id/learn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:layout_width="33dp"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:src="#drawable/learn_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:text="#string/learn"
android:textColor="#color/lineColor"
android:textSize="11sp" />
<View
android:id="#+id/learn_bar"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="10dp"
android:background="#color/lineColor" />
</LinearLayout>
<LinearLayout
android:id="#+id/practice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:gravity="center_horizontal"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:layout_width="42dp"
android:layout_height="28dp"
android:src="#drawable/practice_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:text="#string/practice"
android:textColor="#color/lineColor"
android:textSize="11sp" />
<View
android:id="#+id/practice_bar"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="10dp"
android:background="#color/lineColor"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_gravity="center"
android:layout_marginRight="30dp"
android:layout_weight="1.3"
android:gravity="right"
android:orientation="horizontal">
<LinearLayout
android:id="#+id/unlock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="26.5dp"
android:layout_height="32dp"
android:src="#drawable/unlock_blue" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:text="#string/unlock"
android:textColor="#color/lineColor"
android:textSize="11dp" />
</LinearLayout>
<LinearLayout
android:id="#+id/language"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:gravity="center_horizontal|bottom"
android:orientation="vertical">
<ImageView
android:layout_width="33dp"
android:layout_height="30dp"
android:layout_marginTop="2dp"
android:src="#drawable/language" />
<TextView
android:id="#+id/language_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
android:text="#string/lang"
android:textAllCaps="true"
android:textColor="#color/lineColor"
android:textSize="11dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/appbar_practice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorPrimaryDark"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:paddingTop="12dp"
android:visibility="gone">
<LinearLayout
android:id="#+id/read_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="23.5dp"
android:layout_height="17.5dp"
android:background="#drawable/icon_read" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="7dp"
android:fontFamily="#font/nunito_semibold"
android:text="#string/read"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="13sp" />
</LinearLayout>
<View
android:id="#+id/read_bar"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="12dp"
android:background="#android:color/white" />
</LinearLayout>
<LinearLayout
android:id="#+id/speak_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="32dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="16.5dp"
android:layout_height="21.5dp"
android:background="#drawable/icon_speak" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="7dp"
android:fontFamily="#font/nunito_semibold"
android:text="#string/speak"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="13sp" />
</LinearLayout>
<View
android:id="#+id/speak_bar"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="12dp"
android:background="#android:color/white"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:id="#+id/listen_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="32dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="18.5dp"
android:layout_height="18.5dp"
android:background="#drawable/icon_listen" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="7dp"
android:fontFamily="#font/nunito_semibold"
android:text="#string/listen"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="13sp" />
</LinearLayout>
<View
android:id="#+id/listen_bar"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="12dp"
android:background="#android:color/white"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:id="#+id/write_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="32dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="17dp"
android:layout_height="19dp"
android:background="#drawable/icon_write" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="7dp"
android:fontFamily="#font/nunito_semibold"
android:text="#string/write"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="13sp" />
</LinearLayout>
<View
android:id="#+id/write_bar"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="12dp"
android:background="#android:color/white"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
<FrameLayout
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
Try to put your scrollView into relative Layout.
After commenting this from my activity onCreate() it started working:
this.getWindow().setFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN
)
I'm trying to create a layout that has a 4 categories on the page, and in each one 2 spinners with a title. However at the moment my layout is all over the place when i run an emulator. How can i fix this? i feel like i'm not understanding the concept of the layout properly since everything i add becomes rigid to the layout and i can't easily move things.
layout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".Page1Fragment">
<TextView
android:id="#+id/TextView0"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_marginTop="25dp"
android:background="#A0DD0A"
android:text="TITLE" />
<LinearLayout
android:id="#+id/LinearLayoutTop"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#FFFFFF"
android:orientation="horizontal">
<LinearLayout
android:id="#+id/LinearLayoutTopSub"
android:layout_width="match_parent"
android:layout_height="134dp"
android:layout_weight="1"
android:background="#FFFFFF"
android:orientation="horizontal">
<TextView
android:id="#+id/TextView1"
android:layout_width="81dp"
android:layout_height="20dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="#FFFFFF"
android:text="Weight" />
<Spinner
android:id="#+id/spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="0dp"
android:layout_marginTop="55dp"
android:layout_marginRight="25dp" />
<Spinner
android:id="#+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/spinner"
android:layout_marginLeft="0dp"
android:layout_marginTop="55dp"
android:layout_marginRight="25dp" />
</LinearLayout>
<LinearLayout
android:id="#+id/LinearLayoutTopSub2"
android:layout_width="match_parent"
android:layout_height="134dp"
android:layout_weight="1"
android:background="#FFFFFF"
android:orientation="horizontal">
<TextView
android:id="#+id/TextView2"
android:layout_width="150dp"
android:layout_height="20dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="#FFFFFF"
android:text="Computer" />
<Spinner
android:id="#+id/spinner2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="0dp"
android:layout_marginTop="55dp"
android:layout_marginRight="25dp" />
<Spinner
android:id="#+id/spinner3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/spinner2"
android:layout_marginLeft="0dp"
android:layout_marginTop="85dp"
android:layout_marginRight="30dp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:background="#FFFFFF">
<LinearLayout
android:id="#+id/LinearLayoutTopSub3"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_weight="1"
android:background="#FFFFFF"
android:orientation="horizontal">
<TextView
android:id="#+id/TextView4"
android:layout_width="150dp"
android:layout_height="20dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="#FFFFFF"
android:text="Distance" />
<Spinner
android:id="#+id/spinner4"
android:layout_width="75dp"
android:layout_height="wrap_content"
android:layout_marginLeft="0dp"
android:layout_marginTop="55dp"
android:layout_marginRight="25dp" />
<Spinner
android:id="#+id/spinner5"
android:layout_width="75dp"
android:layout_height="wrap_content"
android:layout_marginLeft="0dp"
android:layout_marginTop="55dp"
android:layout_marginRight="0dp" />
</LinearLayout>
<LinearLayout
android:id="#+id/LinearLayoutTopSub4"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_weight="1"
android:background="#FFFFFF"
android:orientation="horizontal">
<TextView
android:id="#+id/TextView5"
android:layout_width="150dp"
android:layout_height="20dp"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="#FFFFFF"
android:text="Other" />
<Spinner
android:id="#+id/spinner6"
android:layout_width="75dp"
android:layout_height="wrap_content"
android:layout_marginLeft="0dp"
android:layout_marginTop="55dp"
android:layout_marginRight="25dp" />
<Spinner
android:id="#+id/spinner7"
android:layout_width="75dp"
android:layout_height="wrap_content"
android:layout_marginLeft="0dp"
android:layout_marginTop="55dp"
android:layout_marginRight="0dp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
I have added new linear and removed weight. try this one.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".Page1Fragment">
<TextView
android:id="#+id/TextView0"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_marginTop="25dp"
android:background="#A0DD0A"
android:text="TITLE" />
<!-- adding new linear -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="#+id/LinearLayoutTop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:id="#+id/LinearLayoutTopSub"
android:layout_width="wrap_content"
android:layout_height="134dp"
android:background="#FFFFFF"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/TextView1"
android:layout_width="150dp"
android:layout_height="20dp"
android:layout_margin="10dp"
android:background="#FFFFFF"
android:text="Weight" />
<Spinner
android:id="#+id/spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Spinner
android:id="#+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/LinearLayoutTopSub3"
android:layout_width="wrap_content"
android:layout_height="134dp"
android:background="#FFFFFF"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/TextView3"
android:layout_width="150dp"
android:layout_height="20dp"
android:layout_margin="10dp"
android:background="#FFFFFF"
android:text="Computer" />
<Spinner
android:id="#+id/spinner3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Spinner
android:id="#+id/spinner4"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/LinearLayoutBot"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:id="#+id/LinearLayoutBotSub"
android:layout_width="wrap_content"
android:layout_height="134dp"
android:background="#FFFFFF"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/TextView4"
android:layout_width="150dp"
android:layout_height="20dp"
android:layout_margin="10dp"
android:background="#FFFFFF"
android:text="Distance" />
<Spinner
android:id="#+id/spinner9"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Spinner
android:id="#+id/spinner7"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/LinearLayoutTopSub2"
android:layout_width="wrap_content"
android:layout_height="134dp"
android:background="#FFFFFF"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/TextView2"
android:layout_width="150dp"
android:layout_height="20dp"
android:layout_margin="10dp"
android:background="#FFFFFF"
android:text="Others" />
<Spinner
android:id="#+id/spinner2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Spinner
android:id="#+id/spinner5"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
My scollview is not scrolling. I tried putting the scrollView inside a linear layout but still not working. I am trying the scroll view in landscape mode.Also bonus question, is there a layout that i can wrap my code into so that i can have my app be perfect on all screen sizes from small screen to big tablets.
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/bg"
android:fillViewport="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="110dp"
android:padding="10dp"
android:weightSum="2">
<LinearLayout
android:id="#+id/number"
android:layout_width="150dp"
android:layout_height="130dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:layout_marginTop="0dp"
android:background="#color/category_colors"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/numbers1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="NUMBERS"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout6"
android:layout_width="150dp"
android:layout_height="130dp"
android:layout_alignBottom="#+id/linearLayout9"
android:layout_marginBottom="0dp"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:background="#color/category_colors"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1"
tools:ignore="RtlCompat">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/family1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="FAMILY"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout7"
android:layout_width="150dp"
android:layout_height="130dp"
android:layout_alignBottom="#+id/number"
android:layout_marginBottom="0dp"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_toEndOf="#+id/number"
android:background="#color/category_home"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1"
android:layout_toRightOf="#+id/number">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/colors1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="COLORS"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout8"
android:layout_width="150dp"
android:layout_height="130dp"
android:layout_alignBottom="#+id/linearLayout7"
android:layout_marginBottom="0dp"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_toEndOf="#+id/linearLayout7"
android:layout_toRightOf="#+id/linearLayout7"
android:background="#color/category_home"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/nouns1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="VERBS"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout9"
android:layout_width="150dp"
android:layout_height="130dp"
android:layout_below="#+id/linearLayout7"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:layout_marginTop="10dp"
android:layout_toLeftOf="#+id/linearLayout8"
android:layout_toStartOf="#+id/linearLayout8"
android:background="#color/category_colors"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/verbs1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="NOUNS"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout10"
android:layout_width="150dp"
android:layout_height="130dp"
android:layout_alignBottom="#+id/linearLayout9"
android:layout_marginBottom="0dp"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_toEndOf="#+id/linearLayout9"
android:layout_toRightOf="#+id/linearLayout9"
android:background="#color/category_colors"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/phrases1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="PHRASES"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
Try this as per your layout use HorizontalScrollView
<HorizontalScrollView 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="#color/colorPrimary"
android:fillViewport="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="110dp"
android:padding="10dp"
android:weightSum="2">
<LinearLayout
android:id="#+id/number"
android:layout_width="150dp"
android:layout_height="130dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:layout_marginTop="0dp"
android:background="#color/cardview_shadow_end_color"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/kid" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="NUMBERS"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout6"
android:layout_width="150dp"
android:layout_height="130dp"
android:layout_alignBottom="#+id/linearLayout9"
android:layout_marginBottom="0dp"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:background="#color/colorRed"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1"
tools:ignore="RtlCompat">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/kid" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="FAMILY"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout7"
android:layout_width="150dp"
android:layout_height="130dp"
android:layout_alignBottom="#+id/number"
android:layout_marginBottom="0dp"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_toEndOf="#+id/number"
android:background="#color/colorRed"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1"
android:layout_toRightOf="#+id/number">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/kid" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="COLORS"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout8"
android:layout_width="150dp"
android:layout_height="130dp"
android:layout_alignBottom="#+id/linearLayout7"
android:layout_marginBottom="0dp"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_toEndOf="#+id/linearLayout7"
android:layout_toRightOf="#+id/linearLayout7"
android:background="#color/colorRed"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/kid" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="VERBS"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout9"
android:layout_width="150dp"
android:layout_height="130dp"
android:layout_below="#+id/linearLayout7"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:layout_marginTop="10dp"
android:layout_toLeftOf="#+id/linearLayout8"
android:layout_toStartOf="#+id/linearLayout8"
android:background="#color/cardview_shadow_end_color"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/kid" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="NOUNS"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout10"
android:layout_width="150dp"
android:layout_height="130dp"
android:layout_alignBottom="#+id/linearLayout9"
android:layout_marginBottom="0dp"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_toEndOf="#+id/linearLayout9"
android:layout_toRightOf="#+id/linearLayout9"
android:background="#color/colorRed"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/kid" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="PHRASES"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
</HorizontalScrollView>
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.
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