Skip to content

Overload filldata method? #3

@Morgazmo

Description

@Morgazmo

Hi, I'm new to this, so I didn't know what the best way to suggest an addition to the code is.

I noticed you have a filldata(int, string, bool) method which needs a 0 value to set a null image resource. Why not just overload the method with this?

/**
 * Set the text to display, and if you want to use the chevron icon or plus icon.
 * @param text
 * @param useChevron - true to use the chevron icon, false to use the plus icon
 */
public void fillData(String text, boolean useChevron) {
    textView.setText(text);

    leftIcon.setVisibility(GONE);

    if (useChevron) {
        DEGREES = 180;
        rightIcon.setImageResource(R.mipmap.ic_expandable_view_chevron);
    } else {
        DEGREES = -225;
        rightIcon.setImageResource(R.mipmap.ic_expandable_view_plus);
    }
}

Also, I'm using a Collapsing Toolbar or NestedScrollView, and scrolling breaks when the views are collapsed. Basically, while expanded, I can click anywhere inside the ExpandableView (title or options) and my NestedScrolling works perfectly. If I collapse the ExpandableView though, I can't scroll anymore when I drag on the collapsed part of the ExpandableView.

I'm not sure what this is about, or how to fix it. My guess is that it has something to do with the height of the view not being measured correctly (with respect to the parent view), or that touch events are being intercepted when they should be disregarded. Would love to hear your thoughts.

Awesome library thanks so much for sharing!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions