15 Comments

  1. Alex Harmash says:

    May 20, 2014 at 4:05 pm

    I use your lib for animate expandable list. My child view has border (left, rigth, bottom), that i’ve maden using ninepatch format as view background. When expandable list start animate – my bottom border disappeared, but my right and left border still visible. When animation finished, my bottom border set visible. Please, can you tell me why my bottom border doesn’t draw with other elements of the view ? Also in this library, you redrawing divider every time, cause it also has such effect. Thank you!

  2. Hiren says:

    June 24, 2014 at 11:45 am

    Hi, your code for expandable listview works great, is it possible animated expandable listview for three level, i have tried to implement using your code, but animation doesn’t work proper if i used animated expandable listview in getReadChildView() method. Any suggestions, points to consider while implementing three level listivew. Thanks.

    • idunnololz says:

      June 24, 2014 at 6:29 pm

      Hmm, from past experience, I have reason to believe that remeasure is not carried out inside the children of an expendable list view in the same way that one would expect. Due to this, you might need to do some extra work in the animation method for the inner animated expendable list view. I’m not sure if it is as easy as a call to relayout on every step of the animation or not, but it’s worth a try.

      Anyways on a higher level, I would assume if you wanted to implement three level listviews that the most obvious approach is to nest an expandable list view inside another expandable list view and I assume this is what you are doing.

  3. Rogier says:

    July 10, 2014 at 8:45 am

    Hi there,

    Your code works nicely, thanks for the extensive documentation.

    Two quick questions:
    – When expanding, my adapter’s getRealChildView is called twice. The second time, convertView is a DummyView, not our my custom view. Does that mean I have to inflate a new view every time getRealChildView is called?
    – When collapsing, your adapter’s getChildView is called. At that time, convertView is given one of our own own custom views, created by my adapter’s getRealChildView when expanding. As convertView is not null, no new DummyView replaces it, and line 38 (final DummyView dummyView = (DummyView) convertView) throws a ClassCastException. What am I doing wrong?

    Thanks for any help!

    Kind regards,

    Rogier

    • idunnololz says:

      July 28, 2014 at 9:45 pm

      Sorry for the late reply, it’s the end of the term and I’m getting hammered with assignments plus I need to study for finals. Hmm… This sounds like an interesting problem. In theory, what I expect to happen is that the ExpandableListView will call getChildType first to determine the type of convertview to supply in the getChildView call. In which case, if we are animating I would return the id 0 (for the dummy view id) or whatever value you supply in getRealChildType + 1 (to resolve Id conflicts). So in theory you should not be getting a dummy view and the AnimatedExpandableViewAdapter should not be getting your view. Hmm, can you double check your code to make sure that you are returning a non negative value in getRealChildType?

  4. ivolianer says:

    July 19, 2014 at 4:02 am

    Hello, your widget is very good. Thanks for your sharing.
    I really like this one.

    By the way, when the child view just include a textview, the listview performance well.
    When the child view include imageview or other more complicated structrue, its performance is not satisfactory.
    Although I use the converView and childHolder like you do, the speed of rendering is not fast enough.

    • idunnololz says:

      July 28, 2014 at 9:47 pm

      Hmm, interesting. I will do a few tests with more complicated structures once I get time (in about a week). Sorry to hear that the library could not meet your requirements though.

  5. Brendan says:

    July 19, 2014 at 4:42 am

    Thank you so much for this! This was a breeze to incorporate into my project.

    I only seem to have one issue. When I expand the last group, the animation either does not happen or it glitches and expanding child blinks halfway through. Also when sometimes when I expand another group, as the list expands the bottom item (whether it be a group or expanded child) will flash.

    If it helps, my lists do not take up the entire layout space and there is empty space at the bottom. Thanks for your time!

  6. ivolianer says:

    July 22, 2014 at 9:11 am

    Hi, i am unhappy, because you delete my reply.
    I got back to tell you, when you use android:layout_gravity=”center_vertical” or android:gravity=”center_vertical”
    in the chlid view.
    The listview performance worst.

  7. P Kuijpers says:

    July 28, 2014 at 1:07 pm

    The animations work great, although I’ve experienced some bugs in specific situations. I’m wondering if it’s something I have to repair myself, or whether the bug described below is something that could be fixed in the AnimatedExpandableListView code:

    Situation: I’ve got a list with 5 groups, of which the first and second (index 0 and 1) are expandable. If the group (with index) 0 (G0) is already expanded, and I click on group 1 (G1), then G0 should collapse simultaniously, so I call collapseGroupWithAnimation(0) followed by expandGroupWithAnimation(1).

    This works fine in a screen that is scrolled to the top (top of G0 is top of listview). But when G0 is expanded, I scroll down until G0 (including children) is moved (just) off the screen, and THEN I try to expand G1, and it crashes (nullpointer in expandGroupWithAnimation(1), where v = null, because of an incorrect childIndex: it’s -1 while it should be 0. Because of this, G1 is considered to be offscreen because “… the user is not going to be able to see the animation” as the comments explain? In my case expandable animations are (I guess) always visible / onscreen, so I’ve added a temporary workaround by checking if v != null before calling v.getBottom(), which prevents the crash.
    Is this something you could improve in the code, or am I doing something wrong myself?

    Note: in the described situation, collapseGroupWithAnimation(0) works fine (although the childIndex is -1 as well, the animation is correctly ignored in collapseGroupWithAnimation() because it is offscreen).

    • idunnololz says:

      July 28, 2014 at 9:50 pm

      Hmm, thanks for bringing this up. I will have to investigate this more once I am done with my school work however that will be in a week or two. I’ll try to get this fixed as soon as I can.

  8. Jacob says:

    October 16, 2014 at 4:59 pm

    This is exactly what I’ve been looking for! I’m brand new to Android development (and development in general) and I was able to implement your list with very few hiccups. I even edited it to include all my information. One question I have though is: The title of my app has now changed to AnimatedExpandableListView instead of my actual title in the ActionBar, and I can’t seem to figure out why that is. Is there something I changed that caused that?

      • idunnololz says:

        October 19, 2014 at 2:56 am

        The default string used in the action bar or title bar is determined by the value of android:name of your activity as defined in AndroidManifest.xml.

Leave a Reply

Your email address will not be published. Required fields are marked *