wangjiegulu / RapidFloatingActionButton

Quick solutions for Floating Action Button,RapidFloatingActionButton(RFAB)
Apache License 2.0
1.29k stars 254 forks source link

Can't change view from onRFACItemIconClick #6

Open TunaYagci opened 9 years ago

TunaYagci commented 9 years ago

@wangjiegulu

@Override
    public void onRFACItemIconClick(int position, RFACLabelItem item) {
        item.setLabel("test1");
        rfaHelper.toggleContent();
    }

Above code isn't updating view. But, calling rfaHelper.build(); after toogleContent() is updating view, but it has many bugs. Like it's disabling recyclerview's scrolling, it disables its touch events. Also rfaLayout's alpha is decreasing.

Is there any solution for that?

TunaYagci commented 9 years ago

----I was wrong. Read the comment below.----

Solved it, you gotta put this to the end:

fabHelper.toggleContent();
        fabHelper = new RapidFloatingActionHelper(
                getActivity(), // for context
                rfaLayout,
                rfaButton,
                rfaContent
        ).build();

in your onRFACItemIconClick instead of just calling fabHelper.build(); That solves the issue.

TunaYagci commented 9 years ago

I was wrong, that didn't solve the issue.

wangjiegulu commented 8 years ago

I'm sorry that it can not be dynamic change item after initialized yet.