InAppUpdater icon indicating copy to clipboard operation
InAppUpdater copied to clipboard

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

Open STPLAmrut opened this issue 4 years ago • 4 comments

** 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 avatar Feb 09 '21 06:02 STPLAmrut

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

SanojPunchihewa avatar Feb 13 '21 12:02 SanojPunchihewa

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

Latest one :1.3.0

STPLAmrut avatar Feb 17 '21 05:02 STPLAmrut

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();
    }

cmy82 avatar Feb 24 '21 18:02 cmy82

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.

SanojPunchihewa avatar Feb 25 '21 12:02 SanojPunchihewa