How to disable scroll view for list view and increase its height of list view as cells increase?
I have an activity containing some textviews and buttons in scroll view . I have another list view in same layout which has default scroll view.
Now scroll view for that list view should be disabled and height go scroll view should increase dynamically as the rows or cells increase and parent scroll view should be applied for textviews, buttons, list views.
Here is my xml code:
<?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:background="#efe9ef"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
tools:context="com.bodaty.samyata.samyata1.com.bodaty.samyata.samyata2.deyaPay.SuccessPage">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginStart="25dp"
android:layout_marginTop="20dp"
android:fontFamily="@font/poppinsmedium"
android:text="ORDER DETAILS:"
android:textColor="#000000"
android:textSize="14sp" />
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="10dp"
android:orientation="vertical"
android:padding="@dimen/activity_horizontal_margin"
app:cardCornerRadius="4dp"
app:cardElevation="2dp"
tools:targetApi="n">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<TextView
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:gravity="start"
android:text="@string/sub_total"
android:textAlignment="textStart"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:layout_width="55dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="end"
android:text="@string/dolor"
android:fontFamily="@font/poppinsmedium"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:id="@+id/pq"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:gravity="end"
android:lines="1"
android:text="@string/price"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginTop="0dp"
android:orientation="horizontal">
<TextView
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:gravity="start"
android:text="@string/tax"
android:textAlignment="textStart"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:layout_width="53dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:gravity="end"
android:text="@string/dolor"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:id="@+id/taxtopay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginStart="10dp"
android:gravity="end"
android:lines="1"
android:text="@string/price"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
tools:targetApi="n" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="0dp"
android:orientation="horizontal"
android:visibility="gone"
android:id="@+id/dc">
<TextView
android:layout_width="170dp"
android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:gravity="start"
android:text="delivery charges :"
android:textAlignment="textStart"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="end"
android:text="@string/dolor"
android:textAlignment="textEnd"
android:textColor="#000000"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
tools:targetApi="n" />
<TextView
android:id="@+id/cost1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginStart="10dp"
android:gravity="end"
android:lines="1"
android:fontFamily="@font/poppinsmedium"
android:text="@string/price"
android:textAlignment="textEnd"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="8dp"
android:layout_marginStart="10dp"
android:background="#808080">
</View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<TextView
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="start"
android:fontFamily="@font/poppinsmedium"
android:text="@string/total_price"
android:textAlignment="textStart"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="end"
android:text="@string/dolor"
android:fontFamily="@font/poppinsmedium"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:id="@+id/amountpaid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginStart="10dp"
android:gravity="end"
android:lines="1"
android:text="@string/price"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
tools:targetApi="n" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="10dp"
android:orientation="vertical"
app:cardCornerRadius="4dp"
app:cardElevation="2dp"
tools:targetApi="n">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#ffffff"
android:padding="8dp"
android:weightSum="2">
<TextView
android:id="@+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:fontFamily="@font/poppinsmedium"
android:gravity="start"
android:layout_marginTop="8dp"
android:text="@string/delivery_details"
android:textAlignment="textStart"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
<View
android:layout_width="match_parent"
android:layout_height="0.4dp"
android:layout_marginTop="10dp"
android:background="#808080">
</View>
<TextView
android:id="@+id/dm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:text="@string/personal_shopper"
android:textColor="#58595d"
android:textSize="14sp"
android:layout_marginTop="4dp"
tools:targetApi="n"
tools:ignore="RtlHardcoded" />
<LinearLayout
android:id="@+id/tohide"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:text="@string/rating_selectedn"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n"
tools:ignore="RtlHardcoded" />
<TextView
android:id="@+id/psrate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="2dp"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:paddingEnd="5dp"
android:paddingStart="5dp"
android:text="@string/one"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:text="@string/at_time"
android:textColor="#58595d"
android:textSize="14sp"
tools:ignore="RtlHardcoded"
tools:targetApi="n" />
<TextView
android:id="@+id/pstime"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="20dp"
android:layout_marginStart="2dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:paddingEnd="5dp"
android:paddingStart="5dp"
android:text="@string/_0_00_pm"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:text="@string/delivery_charges"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n"
tools:ignore="RtlHardcoded" />
<TextView
android:id="@+id/cost"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="2dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:paddingEnd="5dp"
android:paddingStart="5dp"
android:text="@string/_100"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<TextView
android:id="@+id/deyapay"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginLeft="25dp"
android:layout_marginStart="25dp"
android:fontFamily="@font/questrial"
android:textColor="#000000"
android:textSize="20sp" />
<ListView
android:id="@+id/list"
android:background="#ffffff"
android:layout_width="match_parent"
android:layout_height="600dp"
android:layout_marginBottom="50dp"
android:layout_marginTop="16dp"
/>
</LinearLayout>
</ScrollView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:padding="@dimen/activity_horizontal_margin"
app:cardCornerRadius="4dp"
app:cardElevation="2dp"
tools:targetApi="n">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_margin="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:layout_marginStart="8dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Grand total"
android:textColor="#58b90c"
android:background="#ffffff"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
/>
<TextView
android:id="@+id/amountpaid1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="$00.00"
android:textColor="#000000"
android:background="#ffffff"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
/>
</LinearLayout>
<Button
android:id="@+id/homepage"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="8dp"
android:layout_marginTop="10dp"
android:layout_weight="1.2"
android:background="@drawable/buttonbackground"
android:fontFamily="@font/questrial"
android:gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:text="Continue"
android:textAlignment="center"
android:textColor="#ffffff"
android:textSize="16sp"
android:layout_alignParentBottom="true"
android:textStyle="bold"
tools:ignore="RtlCompat"
tools:targetApi="n">
</Button>
</LinearLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
Thanks in advance
android xml android-studio android-layout
add a comment |
I have an activity containing some textviews and buttons in scroll view . I have another list view in same layout which has default scroll view.
Now scroll view for that list view should be disabled and height go scroll view should increase dynamically as the rows or cells increase and parent scroll view should be applied for textviews, buttons, list views.
Here is my xml code:
<?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:background="#efe9ef"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
tools:context="com.bodaty.samyata.samyata1.com.bodaty.samyata.samyata2.deyaPay.SuccessPage">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginStart="25dp"
android:layout_marginTop="20dp"
android:fontFamily="@font/poppinsmedium"
android:text="ORDER DETAILS:"
android:textColor="#000000"
android:textSize="14sp" />
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="10dp"
android:orientation="vertical"
android:padding="@dimen/activity_horizontal_margin"
app:cardCornerRadius="4dp"
app:cardElevation="2dp"
tools:targetApi="n">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<TextView
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:gravity="start"
android:text="@string/sub_total"
android:textAlignment="textStart"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:layout_width="55dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="end"
android:text="@string/dolor"
android:fontFamily="@font/poppinsmedium"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:id="@+id/pq"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:gravity="end"
android:lines="1"
android:text="@string/price"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginTop="0dp"
android:orientation="horizontal">
<TextView
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:gravity="start"
android:text="@string/tax"
android:textAlignment="textStart"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:layout_width="53dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:gravity="end"
android:text="@string/dolor"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:id="@+id/taxtopay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginStart="10dp"
android:gravity="end"
android:lines="1"
android:text="@string/price"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
tools:targetApi="n" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="0dp"
android:orientation="horizontal"
android:visibility="gone"
android:id="@+id/dc">
<TextView
android:layout_width="170dp"
android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:gravity="start"
android:text="delivery charges :"
android:textAlignment="textStart"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="end"
android:text="@string/dolor"
android:textAlignment="textEnd"
android:textColor="#000000"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
tools:targetApi="n" />
<TextView
android:id="@+id/cost1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginStart="10dp"
android:gravity="end"
android:lines="1"
android:fontFamily="@font/poppinsmedium"
android:text="@string/price"
android:textAlignment="textEnd"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="8dp"
android:layout_marginStart="10dp"
android:background="#808080">
</View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<TextView
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="start"
android:fontFamily="@font/poppinsmedium"
android:text="@string/total_price"
android:textAlignment="textStart"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="end"
android:text="@string/dolor"
android:fontFamily="@font/poppinsmedium"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:id="@+id/amountpaid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginStart="10dp"
android:gravity="end"
android:lines="1"
android:text="@string/price"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
tools:targetApi="n" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="10dp"
android:orientation="vertical"
app:cardCornerRadius="4dp"
app:cardElevation="2dp"
tools:targetApi="n">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#ffffff"
android:padding="8dp"
android:weightSum="2">
<TextView
android:id="@+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:fontFamily="@font/poppinsmedium"
android:gravity="start"
android:layout_marginTop="8dp"
android:text="@string/delivery_details"
android:textAlignment="textStart"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
<View
android:layout_width="match_parent"
android:layout_height="0.4dp"
android:layout_marginTop="10dp"
android:background="#808080">
</View>
<TextView
android:id="@+id/dm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:text="@string/personal_shopper"
android:textColor="#58595d"
android:textSize="14sp"
android:layout_marginTop="4dp"
tools:targetApi="n"
tools:ignore="RtlHardcoded" />
<LinearLayout
android:id="@+id/tohide"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:text="@string/rating_selectedn"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n"
tools:ignore="RtlHardcoded" />
<TextView
android:id="@+id/psrate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="2dp"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:paddingEnd="5dp"
android:paddingStart="5dp"
android:text="@string/one"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:text="@string/at_time"
android:textColor="#58595d"
android:textSize="14sp"
tools:ignore="RtlHardcoded"
tools:targetApi="n" />
<TextView
android:id="@+id/pstime"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="20dp"
android:layout_marginStart="2dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:paddingEnd="5dp"
android:paddingStart="5dp"
android:text="@string/_0_00_pm"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:text="@string/delivery_charges"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n"
tools:ignore="RtlHardcoded" />
<TextView
android:id="@+id/cost"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="2dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:paddingEnd="5dp"
android:paddingStart="5dp"
android:text="@string/_100"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<TextView
android:id="@+id/deyapay"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginLeft="25dp"
android:layout_marginStart="25dp"
android:fontFamily="@font/questrial"
android:textColor="#000000"
android:textSize="20sp" />
<ListView
android:id="@+id/list"
android:background="#ffffff"
android:layout_width="match_parent"
android:layout_height="600dp"
android:layout_marginBottom="50dp"
android:layout_marginTop="16dp"
/>
</LinearLayout>
</ScrollView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:padding="@dimen/activity_horizontal_margin"
app:cardCornerRadius="4dp"
app:cardElevation="2dp"
tools:targetApi="n">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_margin="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:layout_marginStart="8dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Grand total"
android:textColor="#58b90c"
android:background="#ffffff"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
/>
<TextView
android:id="@+id/amountpaid1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="$00.00"
android:textColor="#000000"
android:background="#ffffff"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
/>
</LinearLayout>
<Button
android:id="@+id/homepage"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="8dp"
android:layout_marginTop="10dp"
android:layout_weight="1.2"
android:background="@drawable/buttonbackground"
android:fontFamily="@font/questrial"
android:gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:text="Continue"
android:textAlignment="center"
android:textColor="#ffffff"
android:textSize="16sp"
android:layout_alignParentBottom="true"
android:textStyle="bold"
tools:ignore="RtlCompat"
tools:targetApi="n">
</Button>
</LinearLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
Thanks in advance
android xml android-studio android-layout
add a comment |
I have an activity containing some textviews and buttons in scroll view . I have another list view in same layout which has default scroll view.
Now scroll view for that list view should be disabled and height go scroll view should increase dynamically as the rows or cells increase and parent scroll view should be applied for textviews, buttons, list views.
Here is my xml code:
<?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:background="#efe9ef"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
tools:context="com.bodaty.samyata.samyata1.com.bodaty.samyata.samyata2.deyaPay.SuccessPage">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginStart="25dp"
android:layout_marginTop="20dp"
android:fontFamily="@font/poppinsmedium"
android:text="ORDER DETAILS:"
android:textColor="#000000"
android:textSize="14sp" />
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="10dp"
android:orientation="vertical"
android:padding="@dimen/activity_horizontal_margin"
app:cardCornerRadius="4dp"
app:cardElevation="2dp"
tools:targetApi="n">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<TextView
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:gravity="start"
android:text="@string/sub_total"
android:textAlignment="textStart"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:layout_width="55dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="end"
android:text="@string/dolor"
android:fontFamily="@font/poppinsmedium"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:id="@+id/pq"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:gravity="end"
android:lines="1"
android:text="@string/price"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginTop="0dp"
android:orientation="horizontal">
<TextView
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:gravity="start"
android:text="@string/tax"
android:textAlignment="textStart"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:layout_width="53dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:gravity="end"
android:text="@string/dolor"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:id="@+id/taxtopay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginStart="10dp"
android:gravity="end"
android:lines="1"
android:text="@string/price"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
tools:targetApi="n" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="0dp"
android:orientation="horizontal"
android:visibility="gone"
android:id="@+id/dc">
<TextView
android:layout_width="170dp"
android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:gravity="start"
android:text="delivery charges :"
android:textAlignment="textStart"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="end"
android:text="@string/dolor"
android:textAlignment="textEnd"
android:textColor="#000000"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
tools:targetApi="n" />
<TextView
android:id="@+id/cost1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginStart="10dp"
android:gravity="end"
android:lines="1"
android:fontFamily="@font/poppinsmedium"
android:text="@string/price"
android:textAlignment="textEnd"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="8dp"
android:layout_marginStart="10dp"
android:background="#808080">
</View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<TextView
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="start"
android:fontFamily="@font/poppinsmedium"
android:text="@string/total_price"
android:textAlignment="textStart"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="end"
android:text="@string/dolor"
android:fontFamily="@font/poppinsmedium"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:id="@+id/amountpaid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginStart="10dp"
android:gravity="end"
android:lines="1"
android:text="@string/price"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
tools:targetApi="n" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="10dp"
android:orientation="vertical"
app:cardCornerRadius="4dp"
app:cardElevation="2dp"
tools:targetApi="n">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#ffffff"
android:padding="8dp"
android:weightSum="2">
<TextView
android:id="@+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:fontFamily="@font/poppinsmedium"
android:gravity="start"
android:layout_marginTop="8dp"
android:text="@string/delivery_details"
android:textAlignment="textStart"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
<View
android:layout_width="match_parent"
android:layout_height="0.4dp"
android:layout_marginTop="10dp"
android:background="#808080">
</View>
<TextView
android:id="@+id/dm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:text="@string/personal_shopper"
android:textColor="#58595d"
android:textSize="14sp"
android:layout_marginTop="4dp"
tools:targetApi="n"
tools:ignore="RtlHardcoded" />
<LinearLayout
android:id="@+id/tohide"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:text="@string/rating_selectedn"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n"
tools:ignore="RtlHardcoded" />
<TextView
android:id="@+id/psrate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="2dp"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:paddingEnd="5dp"
android:paddingStart="5dp"
android:text="@string/one"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:text="@string/at_time"
android:textColor="#58595d"
android:textSize="14sp"
tools:ignore="RtlHardcoded"
tools:targetApi="n" />
<TextView
android:id="@+id/pstime"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="20dp"
android:layout_marginStart="2dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:paddingEnd="5dp"
android:paddingStart="5dp"
android:text="@string/_0_00_pm"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:text="@string/delivery_charges"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n"
tools:ignore="RtlHardcoded" />
<TextView
android:id="@+id/cost"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="2dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:paddingEnd="5dp"
android:paddingStart="5dp"
android:text="@string/_100"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<TextView
android:id="@+id/deyapay"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginLeft="25dp"
android:layout_marginStart="25dp"
android:fontFamily="@font/questrial"
android:textColor="#000000"
android:textSize="20sp" />
<ListView
android:id="@+id/list"
android:background="#ffffff"
android:layout_width="match_parent"
android:layout_height="600dp"
android:layout_marginBottom="50dp"
android:layout_marginTop="16dp"
/>
</LinearLayout>
</ScrollView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:padding="@dimen/activity_horizontal_margin"
app:cardCornerRadius="4dp"
app:cardElevation="2dp"
tools:targetApi="n">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_margin="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:layout_marginStart="8dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Grand total"
android:textColor="#58b90c"
android:background="#ffffff"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
/>
<TextView
android:id="@+id/amountpaid1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="$00.00"
android:textColor="#000000"
android:background="#ffffff"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
/>
</LinearLayout>
<Button
android:id="@+id/homepage"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="8dp"
android:layout_marginTop="10dp"
android:layout_weight="1.2"
android:background="@drawable/buttonbackground"
android:fontFamily="@font/questrial"
android:gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:text="Continue"
android:textAlignment="center"
android:textColor="#ffffff"
android:textSize="16sp"
android:layout_alignParentBottom="true"
android:textStyle="bold"
tools:ignore="RtlCompat"
tools:targetApi="n">
</Button>
</LinearLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
Thanks in advance
android xml android-studio android-layout
I have an activity containing some textviews and buttons in scroll view . I have another list view in same layout which has default scroll view.
Now scroll view for that list view should be disabled and height go scroll view should increase dynamically as the rows or cells increase and parent scroll view should be applied for textviews, buttons, list views.
Here is my xml code:
<?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:background="#efe9ef"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
tools:context="com.bodaty.samyata.samyata1.com.bodaty.samyata.samyata2.deyaPay.SuccessPage">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginStart="25dp"
android:layout_marginTop="20dp"
android:fontFamily="@font/poppinsmedium"
android:text="ORDER DETAILS:"
android:textColor="#000000"
android:textSize="14sp" />
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="10dp"
android:orientation="vertical"
android:padding="@dimen/activity_horizontal_margin"
app:cardCornerRadius="4dp"
app:cardElevation="2dp"
tools:targetApi="n">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<TextView
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:gravity="start"
android:text="@string/sub_total"
android:textAlignment="textStart"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:layout_width="55dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="end"
android:text="@string/dolor"
android:fontFamily="@font/poppinsmedium"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:id="@+id/pq"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:gravity="end"
android:lines="1"
android:text="@string/price"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginTop="0dp"
android:orientation="horizontal">
<TextView
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:gravity="start"
android:text="@string/tax"
android:textAlignment="textStart"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:layout_width="53dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:gravity="end"
android:text="@string/dolor"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:id="@+id/taxtopay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginStart="10dp"
android:gravity="end"
android:lines="1"
android:text="@string/price"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
tools:targetApi="n" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="0dp"
android:orientation="horizontal"
android:visibility="gone"
android:id="@+id/dc">
<TextView
android:layout_width="170dp"
android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:gravity="start"
android:text="delivery charges :"
android:textAlignment="textStart"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="end"
android:text="@string/dolor"
android:textAlignment="textEnd"
android:textColor="#000000"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
tools:targetApi="n" />
<TextView
android:id="@+id/cost1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginStart="10dp"
android:gravity="end"
android:lines="1"
android:fontFamily="@font/poppinsmedium"
android:text="@string/price"
android:textAlignment="textEnd"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="8dp"
android:layout_marginStart="10dp"
android:background="#808080">
</View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<TextView
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="start"
android:fontFamily="@font/poppinsmedium"
android:text="@string/total_price"
android:textAlignment="textStart"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="end"
android:text="@string/dolor"
android:fontFamily="@font/poppinsmedium"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
tools:targetApi="n" />
<TextView
android:id="@+id/amountpaid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginStart="10dp"
android:gravity="end"
android:lines="1"
android:text="@string/price"
android:textAlignment="textEnd"
android:textColor="#000"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
tools:targetApi="n" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="10dp"
android:orientation="vertical"
app:cardCornerRadius="4dp"
app:cardElevation="2dp"
tools:targetApi="n">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#ffffff"
android:padding="8dp"
android:weightSum="2">
<TextView
android:id="@+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:fontFamily="@font/poppinsmedium"
android:gravity="start"
android:layout_marginTop="8dp"
android:text="@string/delivery_details"
android:textAlignment="textStart"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
<View
android:layout_width="match_parent"
android:layout_height="0.4dp"
android:layout_marginTop="10dp"
android:background="#808080">
</View>
<TextView
android:id="@+id/dm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:text="@string/personal_shopper"
android:textColor="#58595d"
android:textSize="14sp"
android:layout_marginTop="4dp"
tools:targetApi="n"
tools:ignore="RtlHardcoded" />
<LinearLayout
android:id="@+id/tohide"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:text="@string/rating_selectedn"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n"
tools:ignore="RtlHardcoded" />
<TextView
android:id="@+id/psrate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="2dp"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:paddingEnd="5dp"
android:paddingStart="5dp"
android:text="@string/one"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:text="@string/at_time"
android:textColor="#58595d"
android:textSize="14sp"
tools:ignore="RtlHardcoded"
tools:targetApi="n" />
<TextView
android:id="@+id/pstime"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="20dp"
android:layout_marginStart="2dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:paddingEnd="5dp"
android:paddingStart="5dp"
android:text="@string/_0_00_pm"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:fontFamily="@font/poppinsmedium"
android:text="@string/delivery_charges"
android:textColor="#58595d"
android:textSize="14sp"
tools:targetApi="n"
tools:ignore="RtlHardcoded" />
<TextView
android:id="@+id/cost"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="2dp"
android:layout_weight="1"
android:fontFamily="@font/poppinsmedium"
android:paddingEnd="5dp"
android:paddingStart="5dp"
android:text="@string/_100"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<TextView
android:id="@+id/deyapay"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginLeft="25dp"
android:layout_marginStart="25dp"
android:fontFamily="@font/questrial"
android:textColor="#000000"
android:textSize="20sp" />
<ListView
android:id="@+id/list"
android:background="#ffffff"
android:layout_width="match_parent"
android:layout_height="600dp"
android:layout_marginBottom="50dp"
android:layout_marginTop="16dp"
/>
</LinearLayout>
</ScrollView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:padding="@dimen/activity_horizontal_margin"
app:cardCornerRadius="4dp"
app:cardElevation="2dp"
tools:targetApi="n">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_margin="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:layout_marginStart="8dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Grand total"
android:textColor="#58b90c"
android:background="#ffffff"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
/>
<TextView
android:id="@+id/amountpaid1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="$00.00"
android:textColor="#000000"
android:background="#ffffff"
android:textSize="14sp"
android:fontFamily="@font/poppinsmedium"
/>
</LinearLayout>
<Button
android:id="@+id/homepage"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="8dp"
android:layout_marginTop="10dp"
android:layout_weight="1.2"
android:background="@drawable/buttonbackground"
android:fontFamily="@font/questrial"
android:gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:text="Continue"
android:textAlignment="center"
android:textColor="#ffffff"
android:textSize="16sp"
android:layout_alignParentBottom="true"
android:textStyle="bold"
tools:ignore="RtlCompat"
tools:targetApi="n">
</Button>
</LinearLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
Thanks in advance
android xml android-studio android-layout
android xml android-studio android-layout
edited Nov 14 '18 at 11:23
Utkarsh Srivastava
718
718
asked Nov 14 '18 at 9:29
lasya valivetilasya valiveti
629
629
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You shouldn't put a ListView
inside a ScrollView
because the ListView
class implements its own scrolling and it just doesn't receive gestures because they all are handled by the parent ScrollView
. I strongly recommend you to simplify your layout somehow. For example you can add views you want to be scrolled to the ListView
as headers or footers.
UPDATE:
Starting from API Level 21 (Lollipop) nested scroll containers are officially supported by Android SDK. There're a bunch of methods in View
and ViewGroup
classes which provide this functionality. To make nested scrolling work on the Lollipop you have to enable it for a child scroll view by adding android:nestedScrollingEnabled="true"
to its XML declaration or by explicitly calling setNestedScrollingEnabled(true)
.
If you want to make nested scrolling work on pre-Lollipop devices, which you probably do, you have to use corresponding utility classes from the Support library. First you have to replace you ScrollView
with NestedScrollView. The latter implements both NestedScrollingParent and NestedScrollingChild so it can be used as a parent or a child scroll container.
But ListView
doesn't support nested scrolling, therefore you need to subclass it and implement NestedScrollingChild
. Fortunately, the Support library provides NestedScrollingChildHelper class, so you just have to create an instance of this class and call its methods from the corresponding methods of your view class.
can you pls send xml code@Utkarsh Sr
– lasya valiveti
Nov 14 '18 at 10:47
just replace your <ScrollView> with <NestedScrollView> or add into the <ScrollView android:nestedScrollingEnabled="true">
– Utkarsh Srivastava
Nov 14 '18 at 10:59
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53296862%2fhow-to-disable-scroll-view-for-list-view-and-increase-its-height-of-list-view-as%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You shouldn't put a ListView
inside a ScrollView
because the ListView
class implements its own scrolling and it just doesn't receive gestures because they all are handled by the parent ScrollView
. I strongly recommend you to simplify your layout somehow. For example you can add views you want to be scrolled to the ListView
as headers or footers.
UPDATE:
Starting from API Level 21 (Lollipop) nested scroll containers are officially supported by Android SDK. There're a bunch of methods in View
and ViewGroup
classes which provide this functionality. To make nested scrolling work on the Lollipop you have to enable it for a child scroll view by adding android:nestedScrollingEnabled="true"
to its XML declaration or by explicitly calling setNestedScrollingEnabled(true)
.
If you want to make nested scrolling work on pre-Lollipop devices, which you probably do, you have to use corresponding utility classes from the Support library. First you have to replace you ScrollView
with NestedScrollView. The latter implements both NestedScrollingParent and NestedScrollingChild so it can be used as a parent or a child scroll container.
But ListView
doesn't support nested scrolling, therefore you need to subclass it and implement NestedScrollingChild
. Fortunately, the Support library provides NestedScrollingChildHelper class, so you just have to create an instance of this class and call its methods from the corresponding methods of your view class.
can you pls send xml code@Utkarsh Sr
– lasya valiveti
Nov 14 '18 at 10:47
just replace your <ScrollView> with <NestedScrollView> or add into the <ScrollView android:nestedScrollingEnabled="true">
– Utkarsh Srivastava
Nov 14 '18 at 10:59
add a comment |
You shouldn't put a ListView
inside a ScrollView
because the ListView
class implements its own scrolling and it just doesn't receive gestures because they all are handled by the parent ScrollView
. I strongly recommend you to simplify your layout somehow. For example you can add views you want to be scrolled to the ListView
as headers or footers.
UPDATE:
Starting from API Level 21 (Lollipop) nested scroll containers are officially supported by Android SDK. There're a bunch of methods in View
and ViewGroup
classes which provide this functionality. To make nested scrolling work on the Lollipop you have to enable it for a child scroll view by adding android:nestedScrollingEnabled="true"
to its XML declaration or by explicitly calling setNestedScrollingEnabled(true)
.
If you want to make nested scrolling work on pre-Lollipop devices, which you probably do, you have to use corresponding utility classes from the Support library. First you have to replace you ScrollView
with NestedScrollView. The latter implements both NestedScrollingParent and NestedScrollingChild so it can be used as a parent or a child scroll container.
But ListView
doesn't support nested scrolling, therefore you need to subclass it and implement NestedScrollingChild
. Fortunately, the Support library provides NestedScrollingChildHelper class, so you just have to create an instance of this class and call its methods from the corresponding methods of your view class.
can you pls send xml code@Utkarsh Sr
– lasya valiveti
Nov 14 '18 at 10:47
just replace your <ScrollView> with <NestedScrollView> or add into the <ScrollView android:nestedScrollingEnabled="true">
– Utkarsh Srivastava
Nov 14 '18 at 10:59
add a comment |
You shouldn't put a ListView
inside a ScrollView
because the ListView
class implements its own scrolling and it just doesn't receive gestures because they all are handled by the parent ScrollView
. I strongly recommend you to simplify your layout somehow. For example you can add views you want to be scrolled to the ListView
as headers or footers.
UPDATE:
Starting from API Level 21 (Lollipop) nested scroll containers are officially supported by Android SDK. There're a bunch of methods in View
and ViewGroup
classes which provide this functionality. To make nested scrolling work on the Lollipop you have to enable it for a child scroll view by adding android:nestedScrollingEnabled="true"
to its XML declaration or by explicitly calling setNestedScrollingEnabled(true)
.
If you want to make nested scrolling work on pre-Lollipop devices, which you probably do, you have to use corresponding utility classes from the Support library. First you have to replace you ScrollView
with NestedScrollView. The latter implements both NestedScrollingParent and NestedScrollingChild so it can be used as a parent or a child scroll container.
But ListView
doesn't support nested scrolling, therefore you need to subclass it and implement NestedScrollingChild
. Fortunately, the Support library provides NestedScrollingChildHelper class, so you just have to create an instance of this class and call its methods from the corresponding methods of your view class.
You shouldn't put a ListView
inside a ScrollView
because the ListView
class implements its own scrolling and it just doesn't receive gestures because they all are handled by the parent ScrollView
. I strongly recommend you to simplify your layout somehow. For example you can add views you want to be scrolled to the ListView
as headers or footers.
UPDATE:
Starting from API Level 21 (Lollipop) nested scroll containers are officially supported by Android SDK. There're a bunch of methods in View
and ViewGroup
classes which provide this functionality. To make nested scrolling work on the Lollipop you have to enable it for a child scroll view by adding android:nestedScrollingEnabled="true"
to its XML declaration or by explicitly calling setNestedScrollingEnabled(true)
.
If you want to make nested scrolling work on pre-Lollipop devices, which you probably do, you have to use corresponding utility classes from the Support library. First you have to replace you ScrollView
with NestedScrollView. The latter implements both NestedScrollingParent and NestedScrollingChild so it can be used as a parent or a child scroll container.
But ListView
doesn't support nested scrolling, therefore you need to subclass it and implement NestedScrollingChild
. Fortunately, the Support library provides NestedScrollingChildHelper class, so you just have to create an instance of this class and call its methods from the corresponding methods of your view class.
answered Nov 14 '18 at 9:33
Utkarsh SrivastavaUtkarsh Srivastava
718
718
can you pls send xml code@Utkarsh Sr
– lasya valiveti
Nov 14 '18 at 10:47
just replace your <ScrollView> with <NestedScrollView> or add into the <ScrollView android:nestedScrollingEnabled="true">
– Utkarsh Srivastava
Nov 14 '18 at 10:59
add a comment |
can you pls send xml code@Utkarsh Sr
– lasya valiveti
Nov 14 '18 at 10:47
just replace your <ScrollView> with <NestedScrollView> or add into the <ScrollView android:nestedScrollingEnabled="true">
– Utkarsh Srivastava
Nov 14 '18 at 10:59
can you pls send xml code@Utkarsh Sr
– lasya valiveti
Nov 14 '18 at 10:47
can you pls send xml code@Utkarsh Sr
– lasya valiveti
Nov 14 '18 at 10:47
just replace your <ScrollView> with <NestedScrollView> or add into the <ScrollView android:nestedScrollingEnabled="true">
– Utkarsh Srivastava
Nov 14 '18 at 10:59
just replace your <ScrollView> with <NestedScrollView> or add into the <ScrollView android:nestedScrollingEnabled="true">
– Utkarsh Srivastava
Nov 14 '18 at 10:59
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53296862%2fhow-to-disable-scroll-view-for-list-view-and-increase-its-height-of-list-view-as%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown