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

[BUG] Working fine but my colorAccent is black, so it not showing with black Snackbar #82

Open
STPLAmrut opened this issue Feb 9, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@STPLAmrut
Copy link

** RESTART **
Working fine but if my colorAccent is black/blue, then it is not showing with black Snackbar.
RESTART button of snack bar not showing because of color.

@STPLAmrut STPLAmrut added the bug Something isn't working label Feb 9, 2021
@SanojPunchihewa
Copy link
Owner

@STPLAmrut Thanks for reporting this issue. Could you please share the material library version your using in the app?

@STPLAmrut
Copy link
Author

@STPLAmrut Thanks for reporting this issue. Could you please share the material library version your using in the app?

Latest one :1.3.0

@cmy82
Copy link

cmy82 commented Feb 24, 2021

You can add a function to the library for users to be able to set the color they want so it can match their theme.

private String notificationColor = "#2E7D32";

...

public void setNotificationColor(String color){
        try {
            notificationColor = color;
        } catch (Exception e){
            notificationColor = "#2E7D32";
        }
    }

...

private void popupSnackbarForCompleteUpdate() {
        Snackbar snackbar =
                Snackbar.make(
                        getActivity().getWindow().getDecorView().findViewById(android.R.id.content),
                        "An update has just been downloaded.",
                        Snackbar.LENGTH_INDEFINITE);
        snackbar.setAction("RESTART", v -> appUpdateManager.completeUpdate());
        snackbar.setBackgroundTint(Color.parseColor(notificationColor)); // Set snackbar color here
        snackbar.show();
    }

@SanojPunchihewa
Copy link
Owner

Hi @cmy82 , really value your contribution. But I'm quite busy these days. It will be great if you can send a PR for the above feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants