Skip to content

Clicking the button during the animation might cause button state confusion #5

@YassKnight

Description

@YassKnight

Thank you for your invitation
I've been looking at your team's code and I feel pretty good about it.We are very happy to introduce this project into our project
However, I found a small flaw in the fact that clicking the button during the animation might cause button state confusion

 binder.button.setOnClickListener {
            isNight = if(isNight){
                ThemeManager.instance.reverseChangeTheme(LightTheme(), it)
                false
            }else{
                ThemeManager.instance.changeTheme(NightTheme(), it)
                true
            }
               ...
        }
fun changeTheme(
        newTheme: AppTheme,
        sourceCoordinate: Coordinate,
        animDuration: Long,
        isReverse: Boolean
    ) {
         ...

        if (frontFakeThemeImageView.visibility == View.VISIBLE ||
            behindFakeThemeImageView.visibility == View.VISIBLE ||
            isRunningChangeThemeAnimation()
        ) {
            return
        }
         ...
      }

I think the easy way to do that is to add a return value.Maybe not a good way to handle it

Hope your project will get better and better

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