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

Line width completely different for different screen sizes #28

Open
MarkOSullivan94 opened this issue Jan 14, 2017 · 5 comments
Open

Line width completely different for different screen sizes #28

MarkOSullivan94 opened this issue Jan 14, 2017 · 5 comments

Comments

@MarkOSullivan94
Copy link

I've noticed a problem when comparing the charts on different screen sizes. While the line width might look perfect on one phone, if you use a phone with a smaller screen size the line width looks too thick.

@ghost
Copy link

ghost commented Feb 21, 2017

You have to do something like float decoViewLineWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 15, Resources.getSystem().getDisplayMetrics()); so that you're working with dp not pixels - in this example 15dp is the line width

@MarkOSullivan94
Copy link
Author

@nocturne9op2 tried out your suggestion but this still doesn't look great when scaling. I've taken screenshots when using an emulated Nexus 10 and an emulated Pixel.

I think there'll be complications whenever doing a layout for tablets as you can only specify the line width programmatically

screenshot_1490805111
screenshot_1490805185

@ghost
Copy link

ghost commented Mar 29, 2017

I see, I ran into some DecoView proportion issues as well while I was finishing my app. A way around this is to set a different line width for tablets. Android recommends using different xml layouts to suit different screen sizes anyway.

@MarkOSullivan94
Copy link
Author

Android recommends using different xml layouts to suit different screen sizes anyway.

@nocturne9op2 unfortunately the line width cannot be specified within the XML layouts. If that was the case, it would have made it a lot easier using this library for all different screen sizes.

@ghost
Copy link

ghost commented Apr 1, 2017

You should be able to programmatically check whether the device is a phone or tablet, then set the line width accordingly.

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