Created
January 19, 2018 09:31
-
-
Save bapspatil/3fdf42d8e578acb049147f63e58dce9a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private int numberOfColumns() { | |
| DisplayMetrics displayMetrics = new DisplayMetrics(); | |
| getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); | |
| // You can change this divider to adjust the size of the poster | |
| int widthDivider = 400; | |
| int width = displayMetrics.widthPixels; | |
| int nColumns = width / widthDivider; | |
| return nColumns; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment