Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openMenuIcon is not showing sometimes... #20

Open
isyuun opened this issue Aug 16, 2017 · 0 comments
Open

openMenuIcon is not showing sometimes... #20

isyuun opened this issue Aug 16, 2017 · 0 comments

Comments

@isyuun
Copy link

isyuun commented Aug 16, 2017

Hello,
When "setMainMenu(...)" is called after "onSizeChanged(...)", openMenuIcon is not showing sometimes.

So you have to call "resetMainDrawableBounds()" in "setMainMenu(...)".
This gonna be better to prevent openMenuIcon.draw(canvas) not working.

Have nice work!

Here is my fixes.

public CircleMenu2 setMainMenu(int mainMenuColor, int openMenuRes, int closeMenuRes) {
    this.openMenuIcon = this.convertDrawable(openMenuRes);
    this.closeMenuIcon = this.convertDrawable(closeMenuRes);
    this.mainMenuColor = mainMenuColor;
    **resetMainDrawableBounds();**
    return this;
}

public CircleMenu2 setMainMenu(int mainMenuColor, Bitmap openMenuBitmap, Bitmap closeMenuBitmap) {
    this.openMenuIcon = this.convertBitmap(openMenuBitmap);
    this.closeMenuIcon = this.convertBitmap(closeMenuBitmap);
    this.mainMenuColor = mainMenuColor;
    **resetMainDrawableBounds();**
    return this;
}

public CircleMenu2 setMainMenu(int mainMenuColor, Drawable openMenuDrawable, Drawable closeMenuDrawable) {
    this.openMenuIcon = openMenuDrawable;
    this.closeMenuIcon = closeMenuDrawable;
    this.mainMenuColor = mainMenuColor;
    **resetMainDrawableBounds();**
    return this;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant