Android ScrollView is laggy when using with multiple ImageViews (Rendering Problem) - android

I am trying to create a simple home page for my application. However, I have a performance issue on my home page when trying to scroll my page. Could you please tell me what I am doing wrong or what I can do better in order to have a smooth scroll? (My images sizes are around 100kb on average.) I have tried to minimize the sizes of my images, using a recycler view, decreasing the amount of the LinearLayouts that I used, using ConstraintLayout instead of LinearLayout but none of these worked for me. Thanks for your help!
Here is the screenshot of my home page:
My Home Page Screenshot Link
Here is my xml file:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F6F0E2"
tools:context=".HomeActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="#+id/nameTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:text="Bilgiler alınamadı"
android:textColor="#color/black"
android:textSize="17sp"
android:textStyle="italic" />
<!-- SİPARİŞ VE BİLGİLER -->
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:background="#ffffff"
android:orientation="vertical">
<!-- TİTLE -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:text="SİPARİŞ VE BİLGİLER"
android:textColor="#5c5c5c"
android:textSize="13sp"
android:textStyle="bold" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- CHECK-IN -->
<TableRow>
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_marginStart="15dp"
android:layout_marginTop="15dp"
android:padding="4dp"
android:src="#drawable/check" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="22dp"
android:text="Check-In"
android:textColor="#color/black"
android:textSize="12sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="2dp"
android:text="QR Kod Okut"
android:textColor="#949494"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#c0c0c0" />
<!-- MENÜ -->
<TableRow>
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_marginStart="15dp"
android:padding="4dp"
android:src="#drawable/menu" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="7dp"
android:text="Menü"
android:textColor="#color/black"
android:textSize="12sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="2dp"
android:text="Görmek için tıklayınız"
android:textColor="#949494"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#c0c0c0" />
<!-- SİPARİŞLER -->
<TableRow>
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_marginStart="15dp"
android:padding="4dp"
android:src="#drawable/siparisler" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="7dp"
android:text="Siparişler"
android:textColor="#color/black"
android:textSize="12sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="2dp"
android:text="Siparişlerinize göz atın"
android:textColor="#949494"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#c0c0c0" />
<!-- WC -->
<TableRow>
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_marginLeft="15dp"
android:padding="4dp"
android:src="#drawable/wc" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="7dp"
android:text="WC Bay - AQQQQ"
android:textColor="#color/black"
android:textSize="12dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="2dp"
android:text="WC Bayan - AQQQQQ"
android:textColor="#color/black"
android:textSize="12dp" />
</LinearLayout>
</TableRow>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#c0c0c0" />
<!-- RESTORAN -->
<TableRow android:layout_marginBottom="10dp">
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_marginLeft="15dp"
android:padding="4dp"
android:src="#drawable/rest" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="7dp"
android:text="Restoran - AQQQQ"
android:textColor="#color/black"
android:textSize="12sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="2dp"
android:text="Sıra Al - Ort: 31 dk"
android:textColor="#949494"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
</TableLayout>
</androidx.cardview.widget.CardView>
<!-- ÇAĞRI VE YARDIM -->
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:background="#ffffff">
<!-- TİTLE -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:text="ÇAĞRI VE YARDIM"
android:textColor="#5c5c5c"
android:textSize="13sp"
android:textStyle="bold" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- GARSON ÇAĞIR -->
<TableRow>
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_marginStart="15dp"
android:layout_marginTop="15dp"
android:padding="4dp"
android:src="#drawable/waiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="22dp"
android:text="Garson Çağır"
android:textColor="#color/black"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#c0c0c0" />
<!-- HESAP İSTE -->
<TableRow>
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_marginStart="15dp"
android:padding="4dp"
android:src="#drawable/wallet" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="7dp"
android:text="Hesap İste"
android:textColor="#color/black"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#c0c0c0" />
<!-- HALKLA İLİŞKİLER -->
<TableRow>
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_marginStart="15dp"
android:padding="4dp"
android:src="#drawable/hr" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="7dp"
android:text="Halkla İlişkiler"
android:textColor="#color/black"
android:textSize="12sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="2dp"
android:text="Yardım İste"
android:textColor="#949494"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#c0c0c0" />
</TableLayout>
</androidx.cardview.widget.CardView>
<!-- ÇAĞRI VE YARDIM -->
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:background="#ffffff">
<!-- TİTLE -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:text="ÇAĞRI VE YARDIM"
android:textColor="#5c5c5c"
android:textSize="13sp"
android:textStyle="bold" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- GARSON ÇAĞIR -->
<TableRow>
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_marginStart="15dp"
android:layout_marginTop="15dp"
android:padding="4dp"
android:src="#drawable/waiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="22dp"
android:text="Garson Çağır"
android:textColor="#color/black"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#c0c0c0" />
<!-- HESAP İSTE -->
<TableRow>
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_marginStart="15dp"
android:padding="4dp"
android:src="#drawable/wallet" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="7dp"
android:text="Hesap İste"
android:textColor="#color/black"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#c0c0c0" />
<!-- HALKLA İLİŞKİLER -->
<TableRow>
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_marginStart="15dp"
android:padding="4dp"
android:src="#drawable/hr" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="7dp"
android:text="Halkla İlişkiler"
android:textColor="#color/black"
android:textSize="12sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="2dp"
android:text="Yardım İste"
android:textColor="#949494"
android:textSize="12sp" />
</LinearLayout>
</TableRow>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#c0c0c0" />
</TableLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</ScrollView>

Try using Recyclerview instead of Scrollview. This way you will use much less resources.
So coding this way, each row in your table will be an element in Recyclerview.

Related

How to make whole layout scrollable with scrollable listview inside it?

I want to make my whole layout scrollable I have try several ways, but that did't work. Below is my XML code. Actually, the issue I was facing is when I don't make my whole layout scrollable, my listview shows 4 to 5 items. When I try to make my whole parent layout scrollable, my list view only shows one item and another item I can only see by scrolling. means its leave empty space.
<?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"
android:background="#drawable/bg_gradient"
android:orientation="vertical"
android:padding="25dp">
<LinearLayout
android:id="#+id/mainContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="start"
android:orientation="vertical"
android:visibility="visible">
<LinearLayout
android:id="#+id/addressContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/address_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Jaipur, IN"
android:textColor="#color/colorWhite"
android:textSize="24dp" />
<TextView
android:id="#+id/updated_at_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="20 April 2012, 20:08 PM"
android:textColor="#color/colorWhite"
android:textSize="14dp" />
</LinearLayout>
<LinearLayout
android:id="#+id/overviewContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="vertical">
<TextView
android:id="#+id/status_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Clear Sky"
android:textColor="#color/colorWhite"
android:textSize="18dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal">
<TextView
android:id="#+id/temp_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="sans-serif-thin"
android:text="30"
android:textColor="#color/colorWhite"
android:textSize="90dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-thin"
android:text="°C"
android:textColor="#color/colorWhite"
android:textSize="90dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Min Temp: "
android:textColor="#color/colorWhite" />
<TextView
android:id="#+id/temp_min_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="30"
android:textColor="#color/colorWhite" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-thin"
android:text="°C"
android:textColor="#color/colorWhite" />
</LinearLayout>
<Space
android:layout_width="50dp"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Max Temp: "
android:textColor="#color/colorWhite" />
<TextView
android:id="#+id/temp_max_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="35"
android:textColor="#color/colorWhite" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-thin"
android:text="°C"
android:textColor="#color/colorWhite" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<Space
android:layout_width="match_parent"
android:layout_height="20dp" />
<LinearLayout
android:id="#+id/detailsContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#3CF1EBF1"
android:gravity="center"
android:orientation="vertical"
android:padding="8dp">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:src="#drawable/sunrise"
app:tint="#FFFFFF" />
<Space
android:layout_width="wrap_content"
android:layout_height="5dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sunrise"
android:textColor="#color/colorWhite"
android:textSize="12dp" />
<TextView
android:id="#+id/sunrise_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="06:40 AM"
android:textColor="#color/colorWhite"
android:textSize="14dp" />
</LinearLayout>
<Space
android:layout_width="10dp"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#3CF1EBF1"
android:gravity="center"
android:orientation="vertical"
android:padding="8dp">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:src="#drawable/sunset"
app:tint="#FFFFFF" />
<Space
android:layout_width="wrap_content"
android:layout_height="5dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sunset"
android:textColor="#color/colorWhite"
android:textSize="12dp" />
<TextView
android:id="#+id/sunset_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="06:40 AM"
android:textColor="#color/colorWhite"
android:textSize="14dp" />
</LinearLayout>
<Space
android:layout_width="10dp"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#3CF1EBF1"
android:gravity="center"
android:orientation="vertical"
android:padding="8dp">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:src="#drawable/wind"
app:tint="#FFFFFF" />
<Space
android:layout_width="wrap_content"
android:layout_height="5dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Wind"
android:textColor="#color/colorWhite"
android:textSize="12dp" />
<TextView
android:id="#+id/wind_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="06:40 AM"
android:textColor="#color/colorWhite"
android:textSize="14dp" />
</LinearLayout>
</LinearLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#3CF1EBF1"
android:gravity="center"
android:orientation="vertical"
android:padding="8dp">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:src="#drawable/pressure"
app:tint="#FFFFFF" />
<Space
android:layout_width="wrap_content"
android:layout_height="5dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pressure"
android:textColor="#color/colorWhite"
android:textSize="12dp" />
<TextView
android:id="#+id/pressure_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="06:40 AM"
android:textColor="#color/colorWhite"
android:textSize="14dp" />
</LinearLayout>
<Space
android:layout_width="10dp"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#3CF1EBF1"
android:gravity="center"
android:orientation="vertical"
android:padding="8dp">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:src="#drawable/humidity"
app:tint="#FFFFFF" />
<Space
android:layout_width="wrap_content"
android:layout_height="5dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Humidity"
android:textColor="#color/colorWhite"
android:textSize="12dp" />
<TextView
android:id="#+id/humidity_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="06:40 AM"
android:textColor="#color/colorWhite"
android:textSize="14dp" />
</LinearLayout>
<Space
android:layout_width="10dp"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#3CF1EBF1"
android:gravity="center"
android:orientation="vertical"
android:padding="8dp">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:src="#drawable/info"
app:tint="#FFFFFF" />
<Space
android:layout_width="wrap_content"
android:layout_height="5dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Data By"
android:textColor="#color/colorWhite"
android:textSize="12dp" />
<TextView
android:id="#+id/about_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="WeatherMap"
android:textColor="#color/colorWhite"
android:textSize="14dp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<Space
android:layout_width="wrap_content"
android:layout_height="10dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Weather Forecast of Next 5 Days"
android:textColor="#color/colorWhite"
android:textSize="14sp"
android:layout_gravity="center"/>
<Space
android:layout_width="wrap_content"
android:layout_height="10dp" />
<ListView
android:id="#+id/forecast_listView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#3CF1EBF1"
android:scrollbars="none"
/>
</LinearLayout>
</RelativeLayout>
Try wrapping the whole thing with a NestedScrollView like what Ali Eid suggested. That will do the trick.

How to show scrollbar on ScrollView?

I have the following xml file -
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#color/white"
android:orientation="vertical">
<ImageView
android:id="#+id/fragment_terms_and_conditions_back_image"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:src="#drawable/arrow_left" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:text="#string/fragment_terms_and_conditions_terms_and_conditions"
android:textColor="#color/black"
android:textSize="20sp" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="#dimen/main_app_top_margin_15dp"
android:layout_marginEnd="24dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="#string/terms_and_conditions_fragment_overview"
android:textColor="#color/color_light_gray"
android:textSize="16sp" />
<TextView
android:layout_width="match_parent"
android:textSize="15sp"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/main_app_top_margin_15dp"
android:text="#string/terms_and_conditions_fragment_overview_content"
android:textColor="#color/black" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="15dp"
android:background="#color/color_list_divider_color" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/main_app_top_margin_15dp"
android:fontFamily="#font/roboto_bold"
android:text="#string/terms_and_conditions_fragment_terms_prohibited_use"
android:textColor="#color/color_light_gray"
android:textSize="16sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/main_app_top_margin_15dp"
android:text="#string/terms_and_conditions_fragment_terms_prohibited_use_content"
android:textColor="#color/black" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="15dp"
android:background="#color/color_list_divider_color" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="#string/terms_and_conditions_fragment_terms_post_sales_support"
android:textColor="#color/color_light_gray"
android:textSize="16sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/main_app_top_margin_15dp"
android:text="#string/terms_and_conditions_fragment_terms_post_sales_support_content"
android:textColor="#color/black" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="15dp"
android:background="#color/color_list_divider_color" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="#string/terms_and_conditions_fragment_terms_illegal_distribution"
android:textColor="#color/color_light_gray"
android:textSize="16sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/main_app_top_margin_15dp"
android:layout_marginBottom="30dp"
android:text="#string/terms_and_conditions_fragment_terms_illegal_distribution_content"
android:textColor="#color/black" />
</LinearLayout>
</ScrollView>
</LinearLayout>
but the Scrollview does not show the scrollbar like the following picture -
I tried to add android:fadeScrollbars="false" and android:scrollbarFadeDuration="0" and nothing works
I tried also to put the fadescrollbars to true and add some durations to the fade and it does not have any effect
what am I missing?

TextView is overlapping in LinearLayout

I am facing 2 issues
1.My text view is overlapping. ID is textView7 and name is OrderStatus
2.I am trying to add the divider using the view it is also not working
NOTE:divider is working i have added the android:layout_below property
MyActivity.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.lenovo.jdstudio.UpdateOrderStatusActivity">
<android.support.v7.widget.Toolbar
android:id="#+id/updateOrderToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorPrimary"
android:orientation="vertical"
android:theme="#style/ThemeOverlay.AppCompat.Dark" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="#+id/Fname_LinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/dimen_10dp"
android:layout_marginTop="#dimen/dimen_10dp"
android:orientation="horizontal">
<TextView
android:id="#+id/textView2"
android:layout_width="105dp"
android:layout_height="wrap_content"
android:text="First Name "
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="#+id/Update_FName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/dimen_25dp"
android:freezesText="true"
android:gravity="center_horizontal"
android:text="Aakash"
android:textColor="#color/color_3"
android:textSize="16sp"
android:textStyle="normal|italic" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#android:color/darker_gray"
android:layout_marginTop="#dimen/dimen_5dp"
android:layout_below="#id/Fname_LinearLayout"/>
<LinearLayout
android:id="#+id/Lname_LinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/Fname_LinearLayout"
android:layout_marginLeft="#dimen/dimen_10dp"
android:layout_marginTop="#dimen/dimen_15dp"
android:orientation="horizontal">
<TextView
android:id="#+id/textView3"
android:layout_width="105dp"
android:layout_height="wrap_content"
android:text="Last Name :"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="#+id/Update_LName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/dimen_25dp"
android:text="Bidlan"
android:textColor="#color/color_3"
android:textSize="16sp"
android:textStyle="italic" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="#dimen/dimen_5dp"
android:layout_below="#id/Lname_LinearLayout"
android:background="#android:color/darker_gray" />
<LinearLayout
android:id="#+id/orderStatus_LinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/Lname_LinearLayout"
android:layout_marginLeft="#dimen/dimen_10dp"
android:layout_marginTop="#dimen/dimen_15dp"
android:orientation="horizontal"
android:layout_marginBottom="#dimen/dimen_2dp">
<TextView
android:id="#+id/textView7"
android:layout_width="105dp"
android:layout_height="wrap_content"
android:text="Order Status"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<Spinner
android:id="#+id/orderStatusSpinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/dimen_25dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="#dimen/dimen_5dp"
android:layout_below="#id/orderStatus_LinearLayout"
android:background="#android:color/darker_gray" />
<LinearLayout
android:id="#+id/email_LinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/orderStatus_LinearLayout"
android:layout_marginLeft="#dimen/dimen_10dp"
android:layout_marginTop="#dimen/dimen_15dp"
android:orientation="horizontal">
<TextView
android:id="#+id/textView4"
android:layout_width="105dp"
android:layout_height="wrap_content"
android:text="Email"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="#+id/UpdateOrderEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/dimen_25dp"
android:text="123#gmail.com"
android:textColor="#color/color_3"
android:textSize="16sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#android:color/darker_gray"
android:layout_marginTop="#dimen/dimen_5dp"
android:layout_below="#id/email_LinearLayout"/>
<LinearLayout
android:id="#+id/phoneno_LinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/email_LinearLayout"
android:layout_marginLeft="#dimen/dimen_10dp"
android:layout_marginTop="#dimen/dimen_15dp"
android:orientation="horizontal">
<TextView
android:id="#+id/textView5"
android:layout_width="105dp"
android:layout_height="wrap_content"
android:text="Phone No."
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="#+id/update_phoneNumber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/dimen_25dp"
android:text="1234567890"
android:textColor="#color/color_3"
android:textSize="16sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#android:color/darker_gray"
android:layout_marginTop="#dimen/dimen_5dp"
android:layout_below="#id/phoneno_LinearLayout"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/phoneno_LinearLayout"
android:layout_marginLeft="#dimen/dimen_10dp"
android:layout_marginTop="#dimen/dimen_15dp">
<TextView
android:id="#+id/textView6"
android:layout_width="105dp"
android:layout_height="wrap_content"
android:text="Photo Description"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="#+id/Update_photoDesc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/dimen_25dp"
android:text="id passport"
android:textColor="#color/color_3"
android:textSize="16sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#android:color/darker_gray" />
<Button
android:id="#+id/UpdateOrderSatatus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="7dp"
android:text="Update Order" />
<Button
android:id="#+id/deleteOrder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/UpdateOrderSatatus"
android:layout_alignParentStart="true"
android:layout_marginBottom="88dp"
android:text="Delete Order" />
<ProgressBar
android:id="#+id/updateOrderProgress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
</RelativeLayout>
</LinearLayout>
I tried giving bottom padding first and then bottom margin. it doesn't work.
Thanks for reading the Question.
waiting for the favorable reply...
I have made some changes in this XML file Please try this :-
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<android.support.v7.widget.Toolbar
android:id="#+id/updateOrderToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorPrimary"
android:orientation="vertical"
android:theme="#style/ThemeOverlay.AppCompat.Dark" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="#+id/Fname_LinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="4dp"
android:orientation="horizontal">
<TextView
android:id="#+id/textView2"
android:layout_width="105dp"
android:layout_height="wrap_content"
android:text="First Name"
android:layout_gravity="center"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="#+id/Update_FName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="25dp"
android:freezesText="true"
android:gravity="center_horizontal"
android:text="Aakash"
android:textColor="#000"
android:textSize="16sp"
android:textStyle="normal|italic" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#android:color/darker_gray" />
<LinearLayout
android:id="#+id/Lname_LinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/Fname_LinearLayout"
android:layout_marginLeft="10dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="4dp"
android:orientation="horizontal">
<TextView
android:id="#+id/textView3"
android:layout_width="105dp"
android:layout_height="wrap_content"
android:text="Last Name"
android:textAllCaps="true"
android:layout_gravity="center"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="#+id/Update_LName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:text="Bidlan"
android:textColor="#000"
android:layout_gravity="center"
android:textSize="16sp"
android:textStyle="italic" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#android:color/darker_gray" />
<LinearLayout
android:id="#+id/orderStatus_LinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/Lname_LinearLayout"
android:layout_marginBottom="4dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="15dp"
android:orientation="horizontal">
<TextView
android:id="#+id/textView7"
android:layout_width="105dp"
android:layout_height="wrap_content"
android:text="Order Status"
android:layout_gravity="center"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<Spinner
android:id="#+id/orderStatusSpinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#android:color/darker_gray" />
<LinearLayout
android:id="#+id/email_LinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/orderStatus_LinearLayout"
android:layout_marginLeft="10dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="4dp"
android:orientation="horizontal">
<TextView
android:id="#+id/textView4"
android:layout_width="105dp"
android:layout_height="wrap_content"
android:text="Email"
android:textAllCaps="true"
android:layout_gravity="center"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="#+id/UpdateOrderEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:text="123#gmail.com"
android:textColor="#000"
android:textSize="16sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#android:color/darker_gray" />
<LinearLayout
android:id="#+id/phoneno_LinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/email_LinearLayout"
android:layout_marginLeft="10dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="4dp"
android:orientation="horizontal">
<TextView
android:id="#+id/textView5"
android:layout_width="105dp"
android:layout_height="wrap_content"
android:text="Phone No."
android:textAllCaps="true"
android:layout_gravity="center"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="#+id/update_phoneNumber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:text="1234567890"
android:textColor="#000"
android:textSize="16sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#android:color/darker_gray" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/phoneno_LinearLayout"
android:layout_marginLeft="10dp"
android:layout_marginTop="15dp">
<TextView
android:id="#+id/textView6"
android:layout_width="105dp"
android:layout_height="wrap_content"
android:text="Photo Description"
android:layout_gravity="center"
android:textAllCaps="true"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="#+id/Update_photoDesc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:text="id passport"
android:layout_gravity="center"
android:textColor="#000"
android:textSize="16sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#android:color/darker_gray" />
<Button
android:id="#+id/UpdateOrderSatatus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="7dp"
android:text="Update Order" />
<Button
android:id="#+id/deleteOrder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/UpdateOrderSatatus"
android:layout_alignParentStart="true"
android:layout_marginBottom="88dp"
android:text="Delete Order" />
<ProgressBar
android:id="#+id/updateOrderProgress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
</LinearLayout>
</LinearLayout>
There are too many rows for one screen in a non-scrollable layout. You should add a ScrollView to avoid problems with shorter screens or split the views in several ViewGroups / screens (for example by using some collapsible containers or ViewPager).
If that is not possible you could set weights to the TextViews' height and use the auto size text
<TextView
android:layout_width="105dp"
android:layout_height="0dp"
android:layout_weight="1"
android:autoSizeTextType="uniform" />
Also consider using a layout that is more suitable for the design, such as GridLayout or ConstraintLayout to avoid hard coding the TextView width.

Scrollview doesnt work when scrolled on webview on android version lower than 16

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fbutton="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="#+id/progressBarLL"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="#color/app_background_color"
android:gravity="center"
android:visibility="visible">
<ProgressBar
android:id="#+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<ScrollView
android:id="#+id/scrollableContent"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="4dp">
<LinearLayout
android:id="#+id/navigationControlLinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="4">
<ImageView
android:id="#+id/previousPageImageView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="#drawable/previous_page_darken" />
<TextView
android:id="#+id/dealsPageNumberStatus"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:gravity="center"
android:text="1/50"
android:textSize="#dimen/text_size_medium" />
<ImageView
android:id="#+id/nextPageImageView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="#drawable/next_page_darken" />
</LinearLayout>
<LinearLayout
android:id="#+id/dealsFragmentLinearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="#dimen/margin_large"
android:layout_marginLeft="#dimen/margin_normal"
android:layout_marginRight="#dimen/margin_normal"
android:layout_marginTop="4dp"
android:background="#drawable/background_with_shadow"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="6"
android:orientation="horizontal"
android:paddingTop="0dp">
<ImageView
android:id="#+id/dealsFragmentImage"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="2"
android:background="#android:color/transparent"
android:minHeight="#dimen/min_image_height"
android:padding="5dp"
android:src="#drawable/test_logo" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4.00"
android:orientation="vertical"
android:padding="#dimen/padding_normal">
<TextView
android:id="#+id/dealsFragmentTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:text="This text is intentionally made larger to go beyound 2 lines"
android:textSize="#dimen/text_size_medium"
android:padding="#dimen/padding_normal" />
<TextView
android:id="#+id/dealsTimeSubmitted"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="2"
android:text="about an hour ago "
android:textColor="#color/light_grey"
android:textSize="#dimen/text_size_small"
android:padding="#dimen/padding_normal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:orientation="horizontal"
android:padding="#dimen/padding_normal">
<TextView
android:id="#+id/dealsCurrentPrice"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="left|center"
android:padding="4dp"
android:text="Rs. 135"
android:textColor="#color/deals_blue"
android:textSize="#dimen/text_size_large"
android:textStyle="bold" />
<TextView
android:id="#+id/dealsOffPercent"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="left|center"
android:padding="4dp"
android:text="(90% off)"
android:textColor="#color/deals_blue"
android:textSize="#dimen/text_size_medium" />
<TextView
android:id="#+id/dealsOriginalPrice"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="left|center"
android:padding="4dp"
android:text="1235698"
android:singleLine="true"
android:textColor="#color/light_grey"
android:textSize="#dimen/text_size_small" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="left|center"
android:paddingLeft="4dp"
android:text="#string/submitted_by"
android:textColor="#color/light_text"
android:textSize="#dimen/text_size_small" />
<TextView
android:id="#+id/dealsFragmentSubmittedBy"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="left|center"
android:text=" aniket007"
android:textColor="#color/deals_blue"
android:textSize="#dimen/text_size_small" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="left|center"
android:text=" in "
android:textColor="#color/light_text"
android:textSize="#dimen/text_size_small" />
<TextView
android:id="#+id/dealsCategory"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:ellipsize="end"
android:gravity="left|center"
android:maxLines="1"
android:paddingRight="4dp"
android:text="Mobiles and Mobile Accessories"
android:textColor="#color/deals_blue"
android:textSize="#dimen/text_size_small" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="10dp"
android:background="#color/item_separator"
android:layout_marginLeft="#dimen/margin_normal"
android:layout_marginRight="#dimen/margin_normal" />
<WebView
android:id="#+id/dealDetail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:contentDescription="#string/top_deals"
android:textSize="#dimen/text_size_medium" />
<include
layout="#layout/list_item_deal_footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
<!--<LinearLayout
android:id="#+id/dealsFragmentCommentLinearLayout"
android:layout_width="match_parent"
android:layout_height="30dp"
android:background="#color/deals_footer"
android:orientation="horizontal">
<View
android:layout_width="1dip"
android:layout_height="fill_parent"
android:background="#color/flat_grey" />
<ImageView
android:id="#+id/dealsFragmentLikeImage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="5dp"
android:layout_weight="1"
android:src="#drawable/comment_icon" />
<View
android:layout_width="1dip"
android:layout_height="fill_parent"
android:background="#color/flat_grey" />
<ImageView
android:id="#+id/dealsFragmentDislikeImage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="5dp"
android:layout_weight="1"
android:src="#drawable/comment_icon" />
<View
android:layout_width="1dip"
android:layout_height="fill_parent"
android:background="#color/flat_grey" />
<ImageView
android:id="#+id/dealsFragmentShareImage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:src="#drawable/popularity_icon" />
<View
android:layout_width="1dip"
android:layout_height="fill_parent"
android:background="#color/flat_grey" />
</LinearLayout>
<info.hoang8f.widget.FButton
android:id="#+id/viewCommentsButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="10dp"
android:minHeight="#dimen/fb_button_min_height"
android:text="#string/viewComments"
android:textColor="#android:color/white"
android:textSize="#dimen/text_size_medium"
fbutton:buttonColor="#color/fbutton_default_color"
fbutton:cornerRadius="5dp"
fbutton:shadowColor="#color/fbutton_default_shadow_color"
fbutton:shadowEnabled="true"
fbutton:shadowHeight="2dp" />-->
<info.hoang8f.widget.FButton
android:id="#+id/buyNowButtonPlaceHolder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:minHeight="#dimen/fb_button_min_height"
android:text="#string/buy_now"
android:textColor="#android:color/white"
android:textSize="#dimen/text_size_medium"
android:visibility="invisible"
fbutton:buttonColor="#color/fbutton_default_color"
fbutton:cornerRadius="5dp"
fbutton:shadowColor="#color/fbutton_default_shadow_color"
fbutton:shadowEnabled="true"
fbutton:shadowHeight="2dp" />
</LinearLayout>
</ScrollView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#ccffffff">
<info.hoang8f.widget.FButton
android:id="#+id/buyNowButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_margin="10dp"
android:minHeight="#dimen/fb_button_min_height"
android:minWidth="#dimen/buy_now_button_width"
android:text="#string/buy_now"
android:textColor="#android:color/white"
android:textSize="#dimen/text_size_medium"
fbutton:buttonColor="#color/fbutton_default_color"
fbutton:cornerRadius="5dp"
fbutton:shadowColor="#color/fbutton_default_shadow_color"
fbutton:shadowEnabled="true"
fbutton:shadowHeight="2dp" />
</RelativeLayout>
</RelativeLayout>
I am using WebView inside ScrollView and it does work correctly on android versions higher than 16. But on lower version page do not get scrolled when scrolled on webview. Page does get scrolled from right side of page. Links too do not open when clicked on left side but does open from right side.
found few solutions like android:hardwareAccelerated="true", but not working.

split relative layout into two equal parts using linear layouts

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

Categories

Resources