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

Except for with() every other method for Snackbar class should be non static #5

Open
droidluv opened this issue Jun 23, 2018 · 4 comments

Comments

@droidluv
Copy link

Now to show status bar its a weird set of static calls like

Snackbar.with(this,null);
Snackbar.type(Type.SUCCESS);
Snackbar.message("Main Activity");
Snackbar.duration(Duration.SHORT);
Snackbar.fillParent(true);
Snackbar.textAlign(Align.LEFT);
Snackbar.show();

@AlvaroEstrada
Copy link

I do not know very well what you mean.

I have used this library with static methods without any problem.

You can see the code in this issue:

#4

Explain a little better what your problem is and I could help you.

A greeting.

@droidluv
Copy link
Author

I can't chain calls like below on the latest version of the library because every other method like type() is a static method, not instance based, I am using Kotlin and it doesn't allow static methods to be called from objects and here https://stackoverflow.com/questions/7884004/is-calling-static-methods-via-an-object-bad-form-why is why its a bad form

Snackbar.with(this,null)
.type(Type.SUCCESS)
.message("Profile updated successfully!")
.duration(Duration.SHORT)
.fillParent(true)
.textAlign(Align.LEFT)
.show();

@AlvaroEstrada
Copy link

Ah sorry but did not schedule in Kotlin.

In Java I call the static methods as it appears in the link that has given me and I have no problems.

Wait for the creator of the library to answer you better :)

A greeting.

@ChathuraHettiarachchi
Copy link
Owner

@droidluv @AlvaroEstrada Guys, I'll attend to this sooner, currently busy with office work. I'm planning to move all libs to support Kotlin.

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

3 participants