Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Even though this is not the complete solution still its a 3 layered Expandable List. So its left to you how you style it.</p> <p>here is the class</p> <pre><code>package com.custom.nagee; import android.app.ExpandableListActivity; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseExpandableListAdapter; import android.widget.ExpandableListView; import android.widget.LinearLayout; public class CustomemExpandible extends ExpandableListActivity{ LayoutInflater inflator; boolean flag = true; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); inflator = LayoutInflater.from(getApplicationContext()); setListAdapter(new MyAdapter()); } @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { if(flag){ v.findViewById(childPosition).setVisibility(View.VISIBLE); flag = false; return true; } v.findViewById(childPosition).setVisibility(View.GONE); flag = true; return true; } class MyAdapter extends BaseExpandableListAdapter{ @Override public Object getChild(int groupPosition, int childPosition) { return null; } @Override public long getChildId(int groupPosition, int childPosition) { return 0; } @Override public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { LinearLayout linearLayout = (LinearLayout)inflator.inflate(R.layout.group, null); linearLayout.getChildAt(1).setId(childPosition); return linearLayout; } @Override public int getChildrenCount(int groupPosition) { return 2; } @Override public Object getGroup(int groupPosition) { return null; } @Override public int getGroupCount() { return 2; } @Override public long getGroupId(int groupPosition) { return 0; } @Override public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { return ((LinearLayout)inflator.inflate(R.layout.group, null)); } @Override public boolean hasStableIds() { // TODO Auto-generated method stub return false; } @Override public boolean isChildSelectable(int groupPosition, int childPosition) { return true; } } } </code></pre> <p>and here goes the xml file</p> <p><strong>group.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; </code></pre> <p></p> <pre><code>&lt;TextView android:id="@+id/editText1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="@color/back" android:layout_marginLeft="30dip" android:text="DONE" &gt; &lt;/TextView&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_marginLeft="30dip" android:visibility="gone" &gt; &lt;TextView android:id="@+id/editText2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="DONE"&gt; &lt;/TextView&gt; &lt;TextView android:id="@+id/editText3" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="DONE" /&gt; &lt;TextView android:id="@+id/editText4" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="DONE" /&gt; &lt;/LinearLayout&gt; </code></pre> <p></p> <p>and this is under color folder for changing text color, its left you , you can even change the background for getting better looks.</p> <p><strong>back.xml</strong></p> <pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;item android:state_enabled="false" android:color="#808080"/&gt; &lt;item android:state_window_focused="false" android:color="#808080"/&gt; &lt;item android:state_pressed="true" android:color="#808080"/&gt; &lt;item android:state_selected="true" android:color="#000000"/&gt; &lt;item android:color="#FF0000"/&gt; &lt;!-- not selected --&gt; &lt;/selector&gt; </code></pre> <p>hope it works...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload