Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

snackbar duration #133

Closed
wants to merge 1 commit into from
Closed

snackbar duration #133

wants to merge 1 commit into from

Conversation

bluemix
Copy link

@bluemix bluemix commented Mar 18, 2017

i guess there is a shorter or a better code :)

i guess there is a shorter or a better code :)
Copy link
Contributor

@Serchinastico Serchinastico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the checkstyle and the small comments and this PR can be merged.

Thank you very much for your contribution @bluemix !

@@ -37,6 +37,7 @@
private final String buttonText;
private final View.OnClickListener onButtonClickListener;
private final Snackbar.Callback snackbarCallback;
private int duration = 5_000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to give it a default value if it already has one in the builder

@@ -76,16 +80,26 @@ private SnackbarOnDeniedPermissionListener(ViewGroup rootView, String text, Stri
private String buttonText;
private View.OnClickListener onClickListener;
private Snackbar.Callback snackbarCallback;
private int duration = 5_000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous default value was Snackbar.LENGTH_LONG

public static Builder with(ViewGroup rootView, String text) {
return new Builder(rootView, text);
}

public static Builder
with(ViewGroup rootView, String text, int duration) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being duration an optional parameter, I'd create a new non-static method withDuration instead

@Serchinastico
Copy link
Contributor

Besides, there is a very similar implementation called SnackbarOnAnyDeniedMultiplePermissionsListener we should update as well

@Serchinastico Serchinastico mentioned this pull request Apr 3, 2017
@Serchinastico
Copy link
Contributor

I'm merging this PR in #141 and releasing a new version

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants