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

added min_width max_width to default values.xml #131

Merged
merged 1 commit into from
May 30, 2015
Merged

Conversation

sbaar
Copy link
Contributor

@sbaar sbaar commented May 29, 2015

This fixes a crash when calling
SnackbarManager.show(snackbar,false) on devices where the smallest width is less than 600dp, such as the nexus 5. It would throw a resource not found exception because the only value specified for the resource is in values-sw600dp

Particularly, it would crash on line layout.setMinimumWidth(res.getDimensionPixelSize(dimen.sb__min_width)); in
private MarginLayoutParams init(Context context, Activity targetActivity, ViewGroup parent, boolean usePhoneLayout)
of snackbar.java because it's being forced to use the tablet specific implementation when it would not normally do so, namely when the width is less than 600dp on a device like the nexus 5 which is 360.0 dp x 592.0 dp

This fixes a crash when calling 
SnackbarManager.show(snackbar,false) on devices where the smallest width is less than 600dp, such as the nexus 5. It would throw a resource not found exception because the only value specified for the resource is in values-sw600dp

Particularly, it would crash on line layout.setMinimumWidth(res.getDimensionPixelSize(dimen.sb__min_width)); in
 private MarginLayoutParams init(Context context, Activity targetActivity, ViewGroup parent, boolean usePhoneLayout)
of snackbar.java because it's being forced to use the tablet specific implementation when it would normally do so, namely when the width is less than 600dp on a device like the nexus 5 which is 360.0 dp x 592.0 dp
wmora added a commit that referenced this pull request May 30, 2015
added min_width max_width to default values.xml
@wmora wmora merged commit 9f8eaa2 into nispok:master May 30, 2015
@sbaar sbaar deleted the patch-1 branch May 30, 2015 00:24
@sbaar sbaar restored the patch-1 branch May 30, 2015 00:24
Copy link

@Skitso51-50 Skitso51-50 left a comment

Choose a reason for hiding this comment

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

Good 👍

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

Successfully merging this pull request may close these issues.

3 participants