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

Snackbar not adding newlines on large screens #53

Open
lordgordon opened this issue May 14, 2018 · 1 comment
Open

Snackbar not adding newlines on large screens #53

lordgordon opened this issue May 14, 2018 · 1 comment

Comments

@lordgordon
Copy link

Hi there,

I noticed a bug while adding the tablet UI to my existing smartphone project. Not sure if it is due to the screen resolution or something else (maybe API Level).

Smartphone (small screen) correct behaviour

API Level 23
topsnackbar_ok

Tablet (large screen) wrong behaviour

API Level 25
topsnackbar_wrong

Code

Snackbar creation

snack = TSnackbar.make(rootView, message, TSnackbar.LENGTH_INDEFINITE);

View view = snack.getView();
view.setPadding(0, 10, 0, 10);
view.setBackgroundColor(getColor(colorID));
snack.setIconLeft(iconID, 24);
 snack.setIconPadding(8);
snack.setMaxWidth(-1);

TextView textView = view.findViewById(com.androidadvance.topsnackbar.R.id.snackbar_text);
textView.setTextColor(getColor(R.color.Light_Grey));

snack.show();

strings.xml

<string name="no_connection">
        <b>Connessione assente.</b>\n Senza
        Internet questa App non funziona.
</string>

Any ideas on how to fix this?

Thank you very much for you help.

@lordgordon
Copy link
Author

Fixed with

textView.setMaxLines(3);

Don't know why there is a default difference between tablet and smartphone.

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

1 participant