android - Expandable list with different size dividers for parent and child -


i'm new android, , first question here.

http://s11.postimg.org/tjhfoq7mb/123.png

i'm looking create looks in picture above.

  1. parent/group has child = parent/group has no divider
  2. parent/group has no child = parent/group has divider
  3. last child = child has full divider
  4. not last child = not full divider

is possible accomplish this. yes? how?

yes possible

@override public view getgroupview(int groupposition, boolean isexpanded, view convertview, viewgroup parent) {      // first of add parent line view in custom_expandable_parent_view.xml , reference     convertview = _lay.inflate(r.layout.custom_expandable_parent_view, null);     view parentline = convertview.findviewbyid(your_parent_line_id);      if (isexpanded) {         // if list expanded dont have show         // hide         parentline.setvisibility(gone);     }      return convertview; }  @override public view getchildview(int groupposition, int childposition, boolean islastchild, view convertview, viewgroup parent) {      // in add both childline ,  parentline in custom_expandable_child_view.xml     // reference both of them      convertview = _lay.inflate(r.layout.custom_expandable_child_view, null);     view parentline = convertview.findviewbyid(your_id);     view childline = convertview.findviewbyid(your_id);      // consider both line showing in everychild.      if (islastchild) {         // now, if last child have show parentline means long line. hide childline         childline.setvisibility(view.gone);     } else {         // now, if not last child have show childline means short line. child except long 1            // here hide parent 1         parentline.setvisibility(view.gone);     }      return convertview; } 

this code have done it. bcoz want same layout yours. have explain .. make changes according requirement.

enter image description here


Comments

Popular posts from this blog

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -

javascript - three.js lot of meshes optimization -