Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

FAM On 4.4.4 pressing on the label changes button's color #82

Closed
eirinaios opened this issue Jul 2, 2015 · 5 comments
Closed

FAM On 4.4.4 pressing on the label changes button's color #82

eirinaios opened this issue Jul 2, 2015 · 5 comments

Comments

@eirinaios
Copy link

Hi everyone,

I noticed a weird behavior while testing my app for various platforms. On 4.4.4, if someone presses on the label of a button of a floating action menu, and that label has a different color from the button, then the button changes to that color, and stays there no matter how many times you open and close the menu. It will change to its proper color only if you tap on it (instead of its label). This doesn't happen on lollipop. Are there any workarounds?

@nodegin
Copy link

nodegin commented Jul 2, 2015

same here

@ivanviragine
Copy link

Same here!

@Clans
Copy link
Owner

Clans commented Jul 8, 2015

Could you provide some sample code for that? I'll try to find some time to fix this in near future.

@eirinaios
Copy link
Author

Thanks a lot! Below is my onViewCreated function, in which as you can see, I setup the FloatingActionMenu. The code is copied and pasted (more or less) from your sample app.

public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        final FloatingActionMenu fam = (FloatingActionMenu) view.findViewById(R.id.material_card_fam);
        fam.setMenuButtonColorNormalResId(R.color.accent);
        fam.setMenuButtonColorPressedResId(R.color.accent_pressed);
        fam.setMenuButtonColorRippleResId(R.color.ripple);
        fam.hideMenuButton(false);
        fam.setClosedOnTouchOutside(true);
        fam.setIconAnimated(true);
        createCustomAnimation(fam);
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                fam.showMenuButton(true);
            }
        }, 500);

        final FloatingActionButton fabPrev = (FloatingActionButton) view.findViewById(R.id.fam_btn_prev);
        fabPrev.setButtonSize(FloatingActionButton.SIZE_MINI);
        fabPrev.setColorNormalResId(R.color.accent);
        fabPrev.setColorPressedResId(R.color.accent_pressed);
        fabPrev.setColorRippleResId(R.color.ripple);
        final FloatingActionButton fabNext = (FloatingActionButton) view.findViewById(R.id.fam_btn_next);
        fabNext.setButtonSize(FloatingActionButton.SIZE_MINI);
        fabNext.setColorNormalResId(R.color.accent);
        fabNext.setColorPressedResId(R.color.accent_pressed);
        fabNext.setColorRippleResId(R.color.ripple);
        fabPrev.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(mDateInfoCard != null)
                    mDateInfoCard.updateForPrevDay();
                fam.close(true);
            }
        });
        fabNext.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(mDateInfoCard != null)
                    mDateInfoCard.updateForNextDay();
                fam.close(true);
            }
        });

        initCard();
    }

I recently updated to 5.0.1. In all APIs v. 21 and up, as well as in Kit Kat 4.4.2 (API 19) against which I'm testing with an emulator, the problem described does not appear. It appears only in 4.4.4.

Thank you in advance!

@Clans
Copy link
Owner

Clans commented Jul 8, 2015

Found the problem and fixed. Will upload new build on weekends.

@Clans Clans closed this as completed Jul 8, 2015
Clans added a commit that referenced this issue Jul 8, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants