1. Are you ready for the Galaxy S20? Here is everything we know so far!

Code for Android ExpandableListView

Discussion in 'Android Development' started by Pooveshin, Jan 19, 2016.

  1. Pooveshin

    Pooveshin Newbie
    Thread Starter

    I am creating an android application, I have already done the layouts and have drawn the conclusion that it has become to cluttered on screen, I want to implement an ExpandableListView around the layout. Any help would be much appreciated in helping with this. Below you can find the code i have used for the layouts:

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    tools:context="www.propertyapp.co.za.propertyapp.TransferCost"
    android:background="#bcbdbf">

    <ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:eek:rientation="vertical">

    <ImageView
    android:layout_width="wrap_content"
    android:layout_height="200dp"
    android:id="@+id/imageView9"
    android:src="@drawable/venns"/>

    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:text="Property Value:"
    android:id="@+id/textView4"
    android:layout_alignParentTop="true"
    android:layout_alignParentStart="true"
    android:textColor="#9205a2"
    android:textSize="18sp"
    android:layout_marginTop="10dp"/>

    <EditText
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:inputType="number"
    android:ems="10"
    android:id="@+id/num"
    android:layout_below="@+id/textView4"
    android:layout_alignParentEnd="true"
    android:layout_gravity="right"/>

    <Button
    android:layout_width="285dp"
    android:layout_height="wrap_content"
    android:text="Calculate"
    android:eek:nClick="calbtn"
    android:id="@+id/calbtn"
    android:layout_centerVertical="true"
    android:layout_gravity="bottom|center"
    android:background="@drawable/shapebtn"
    android:textColor="#ffffff"
    android:textSize="16sp"
    android:layout_marginTop="10dp"/>

    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:text="Total Estimated Cost:"
    android:id="@+id/textView14"
    android:layout_below="@+id/num9"
    android:layout_alignParentStart="true"
    android:textColor="#9205a2"
    android:textSize="18sp"
    android:layout_marginTop="10dp"/>

    <EditText
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:inputType="number"
    android:ems="10"
    android:id="@+id/num10"
    android:focusable="false"
    android:layout_below="@+id/textView14"
    android:layout_alignParentEnd="true"
    android:layout_gravity="right"
    android:numeric="decimal"/>

    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:text="Rates Clearance Certificate:"
    android:id="@+id/textView5"
    android:layout_below="@+id/num"
    android:layout_alignParentStart="true"
    android:textColor="#9205a2"
    android:layout_marginTop="10dp"
    android:textSize="18sp"/>

    <EditText
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:inputType="number"
    android:ems="10"
    android:id="@+id/num1"
    android:editable="true"
    android:layout_below="@+id/textView5"
    android:layout_alignStart="@+id/num"
    android:layout_gravity="right"
    android:numeric="decimal"
    android:focusable="false"/>

    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:text="Postage and Petties:"
    android:id="@+id/textView6"
    android:layout_below="@+id/num1"
    android:layout_alignParentStart="true"
    android:textColor="#9205a2"
    android:textSize="18sp"/>

    <EditText
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:inputType="number"
    android:ems="10"
    android:id="@+id/num2"
    android:focusable="false"
    android:layout_below="@+id/textView6"
    android:layout_alignParentEnd="true"
    android:layout_gravity="right"
    android:numeric="decimal"/>

    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:text="Levy Clearance:"
    android:id="@+id/textView7"
    android:layout_below="@+id/num2"
    android:layout_alignParentStart="true"
    android:textColor="#9205a2"
    android:textSize="18sp"/>

    <EditText
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:inputType="number"
    android:ems="10"
    android:id="@+id/num3"
    android:focusable="false"
    android:layout_below="@+id/textView7"
    android:layout_alignEnd="@+id/num2"
    android:layout_gravity="right"
    android:numeric="decimal"/>

    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:text="Electronic Document Fee:"
    android:id="@+id/textView8"
    android:layout_below="@+id/num3"
    android:layout_alignParentStart="true"
    android:textColor="#9205a2"
    android:textSize="18sp"/>

    <EditText
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:inputType="number"
    android:ems="10"
    android:id="@+id/num4"
    android:focusable="false"
    android:layout_below="@+id/textView8"
    android:layout_alignParentEnd="true"
    android:layout_gravity="right"
    android:numeric="decimal"/>

    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:text="FICA Compliance:"
    android:id="@+id/textView9"
    android:layout_below="@+id/num4"
    android:layout_alignParentStart="true"
    android:textColor="#9205a2"
    android:textSize="18sp"/>

    <EditText
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:inputType="number"
    android:ems="10"
    android:id="@+id/num5"
    android:focusable="false"
    android:layout_below="@+id/textView9"
    android:layout_alignEnd="@+id/num4"
    android:layout_gravity="right"
    android:numeric="decimal"/>

    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:text="Electronic Deeds Office Search:"
    android:id="@+id/textView10"
    android:layout_below="@+id/num5"
    android:layout_alignParentStart="true"
    android:textColor="#9205a2"
    android:textSize="18sp"/>

    <EditText
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:inputType="number"
    android:ems="10"
    android:id="@+id/num6"
    android:focusable="false"
    android:layout_below="@+id/textView10"
    android:layout_alignParentEnd="true"
    android:layout_gravity="right"
    android:numeric="decimal"/>

    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:text="Share of Rates and Levies:"
    android:id="@+id/textView11"
    android:layout_below="@+id/num6"
    android:layout_alignParentStart="true"
    android:textColor="#9205a2"
    android:textSize="18sp"/>

    <EditText
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:inputType="number"
    android:ems="10"
    android:id="@+id/num7"
    android:focusable="false"
    android:layout_below="@+id/textView11"
    android:layout_alignEnd="@+id/num6"
    android:layout_gravity="right"
    android:numeric="decimal"/>

    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:text="Transfer Fees:"
    android:id="@+id/textView12"
    android:layout_below="@+id/num7"
    android:layout_alignParentStart="true"
    android:textColor="#9205a2"
    android:textSize="18sp"/>

    <EditText
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:inputType="number"
    android:ems="10"
    android:id="@+id/num8"
    android:focusable="false"
    android:layout_below="@+id/textView12"
    android:layout_alignParentEnd="true"
    android:layout_gravity="right"
    android:numeric="decimal"/>
    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceMedium"
    android:text="Deeds Office Fees:"
    android:id="@+id/textView13"
    android:layout_below="@+id/num8"
    android:layout_alignParentStart="true"
    android:textColor="#9205a2"
    android:textSize="18sp"/>

    <EditText
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:inputType="number"
    android:ems="10"
    android:id="@+id/num9"
    android:focusable="false"
    android:layout_below="@+id/textView13"
    android:layout_alignParentEnd="true"
    android:layout_gravity="right"
    android:numeric="decimal"/>

    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceSmall"
    android:text="All figures are estimates and cannot be used as actual values."
    android:id="@+id/textView"
    android:layout_marginTop="25dp"
    android:layout_gravity="center_horizontal"
    android:textSize="18sp"
    android:textColor="#9205a2"/>
    <LinearLayoutandroid:eek:rientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="10dp">
    <Button
    android:background="@drawable/shapebtn"
    android:text="Save"
    android:eek:nClick="write"
    android:id="@+id/Save"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:textColor="#ffffff">
    </Button>
    <Button
    android:background="@drawable/shapebtn"
    android:text="Read"
    android:eek:nClick="read"
    android:id="@+id/Read"
    android:layout_toRightOf="@+id/Previous"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:textColor="#ffffff">
    </Button>
    </LinearLayout>
    </LinearLayout>
     



    1. Download the Forums for Android™ app!


      Download

       
  2. Unforgiven

    Unforgiven ...eschew obfuscation...
    Moderator

    Application Development thread moved to the Development forum for better exposure.:)
     
    Pooveshin likes this.
  3. Deleted User

    Deleted User Guest

Loading...
Similar Threads - Code Android ExpandableListView
  1. xarzu
    Replies:
    0
    Views:
    692
  2. Dev101
    Replies:
    0
    Views:
    1,460
  3. max222
    Replies:
    4
    Views:
    2,351
  4. White_Rabbit
    Replies:
    1
    Views:
    1,431
  5. GiuseppeSM
    Replies:
    3
    Views:
    1,955
  6. JHolt
    Replies:
    0
    Views:
    2,117
  7. curvenger
    Replies:
    3
    Views:
    2,575
  8. CK4
    Replies:
    0
    Views:
    1,883
  9. WmDev
    Replies:
    0
    Views:
    1,185
  10. Satyam Mobile Infotech
    Replies:
    0
    Views:
    2,040

Share This Page

Loading...