• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How do I make this xml dynamically?

ARNAB2203

Lurker
<?xml version="1.0" encoding="utf-8"?>
<!--the tab content flows like this,
each magroup consits of a frame layout which holds a textview that acts as the clickable button of the category
and a frame layout to hold the subgroup. this nesting is followed for every category and subgroup and
stops when the lowest level is reached which only has chekboxes in it-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="HardcodedText"
android:padding="10dp">

<TextView android:id="@+id/txtDisplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#ffefef"
android:text="Problem Faced"
android:textColor="#8A5C0B"
android:textSize="14sp"
android:textStyle="bold" />

<CheckBox android:id="@+id/chkNone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="chkNoneMain"
android:text="None"/>

<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">


<FrameLayout android:id="@+id/frmProblemFacedMain"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>

<!--the framelayout for the Lack of capacity of GP employees category starts from here-->

<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:tag="hidden"
android:clickable="true"
android:text="ABC"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="setTreeShowHide"
android:background="@drawable/button_style_innerbtn"
android:textColor="#ffffff"
android:textSize="16sp"
android:layout_marginBottom="10dp"
android:textAlignment="center" />

<FrameLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffefef"
android:layout_marginLeft="10dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<CheckBox
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="None"
android:onClick="chkNoneClick"/>

<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:tag="hidden"
android:clickable="true"
android:text="DEF"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="setTreeShowHide"
android:background="@drawable/button_style_inner2btn"
android:textColor="#000000"
android:textSize="16sp"
android:layout_marginBottom="10dp"/>

<FrameLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<CheckBox
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="GHI"/>


</LinearLayout>

</FrameLayout>

</LinearLayout>

</FrameLayout>

<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:visibility="gone"
android:tag="hidden"
android:clickable="true"
android:text="-"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="setTreeShowHide"
android:background="@drawable/button_style_inner2btn"
android:textColor="#000000"
android:textSize="16sp"
android:layout_marginBottom="10dp"/>

<FrameLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<CheckBox
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="true"
android:visibility="gone"
android:text="-"/>


</LinearLayout>

</FrameLayout>

</LinearLayout>

</FrameLayout>

</LinearLayout>
</FrameLayout>
</LinearLayout>

</FrameLayout>

<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:tag="hidden"
android:clickable="true"
android:text="JKL"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="setTreeShowHide"
android:background="@drawable/button_style_innerbtn"
android:textColor="#ffffff"
android:textSize="16sp"
android:layout_marginBottom="10dp"
android:textAlignment="center" />



<FrameLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffefef"
android:layout_marginLeft="10dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<CheckBox
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="None"
android:onClick="chkNoneClick"/>

<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:tag="hidden"
android:clickable="true"
android:text="MNO"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="setTreeShowHide"
android:background="@drawable/button_style_inner2btn"
android:textColor="#000000"
android:textSize="16sp"
android:layout_marginBottom="10dp"/>

<FrameLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<CheckBox
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="PQR"/>


</LinearLayout>

</FrameLayout>

</LinearLayout>

</FrameLayout>

<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:visibility="gone"
android:tag="hidden"
android:clickable="true"
android:text="-"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="setTreeShowHide"
android:background="@drawable/button_style_inner2btn"
android:textColor="#000000"
android:textSize="16sp"
android:layout_marginBottom="10dp"/>

<FrameLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<CheckBox
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="true"
android:visibility="gone"
android:text="-"/>


</LinearLayout>

</FrameLayout>

</LinearLayout>

</FrameLayout>

</LinearLayout>
</FrameLayout>
</LinearLayout>

</FrameLayout>

</LinearLayout>

</FrameLayout>

</ScrollView>

</LinearLayout>
 
Back
Top Bottom