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

Change flag margins to restore previous row height #109

Merged
merged 1 commit into from
Feb 9, 2018
Merged

Change flag margins to restore previous row height #109

merged 1 commit into from
Feb 9, 2018

Conversation

goldfndr
Copy link
Contributor

@goldfndr goldfndr commented Feb 4, 2018

With the change from GridView to RecyclerView (#104), a change was made from GridView's rowHeight of 16dp and verticalSpacing of 1dp to... well, they simply weren't retained. Due to the sizes of the flag images (they're squares instead of rectangles), the rows grew higher to accommodate them, causing fewer rows to appear on the screen -- on my 4.5" 720x1280 Moto G, the number of rows went from 16 to 13. This proposed change (-2.5dp vertical margin) restores the layout to the previous row height. (I did try setting layout_height to 16dp, but that caused the ScaleType.FIT_START to resize the flag smaller.)

Note: I haven't tested this on any other devices, so I don't know if the same row count change will occur elsewhere. (I'm on WinXP, no Intel HAXM support for emulator images, 'twas a bit of an ordeal just getting Android Studio working on it; using 2.3.3.)

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Acknowledge that you're contributing your code under Apache v2.0 license

  • Apply the AndroidStyle.xml style template to your code in Android Studio.

  • If you have multiple commits please combine them into one commit by squashing them.

With the change from GridView to RecyclerView (#104), a change was made from GridView's rowHeight of 16dp and verticalSpacing of 1dp to... well, they simply weren't retained. Due to the sizes of the flag images (they're squares instead of rectangles), the rows grew higher to accommodate them, causing fewer rows to appear on the screen -- on my 4.5" 720x1280 Moto G, the number of rows went from 16 to 13. This proposed change (-2.5dp vertical margin) restores the layout to the previous row height. (I did try setting layout_height to 16dp, but that caused the `ScaleType.FIT_START` to resize the flag smaller.)

Note: I haven't tested this on any other devices, so I don't know if the same row count change will occur elsewhere. (I'm on WinXP, no Intel HAXM support for emulator images, 'twas a bit of an ordeal just getting Android Studio working on it; using 2.3.3.)
@CLAassistant
Copy link

CLAassistant commented Feb 4, 2018

CLA assistant check
All committers have signed the CLA.

@barbeau
Copy link
Owner

barbeau commented Feb 5, 2018

Thanks @goldfndr for testing this! Could you provide before and after screenshots on your device? I'll take a look at this on devices I have as well.

@goldfndr
Copy link
Contributor Author

goldfndr commented Feb 5, 2018

Here you go, before and after shots.

before
after

@barbeau
Copy link
Owner

barbeau commented Feb 9, 2018

Thanks @goldfndr! This patch works as a work-around - the "right" way to do this is probably to resize the images as rectangles instead of squares. Interestingly, the source images are rectangles, but it looks like the Android Icon Generator changed them to squares. I may resize all the flags to rectangles that at some point, but for now this will do.

Here's what it looks like on a Samsung Galaxy S8+ (master branch left, this PR right):

image

@barbeau barbeau merged commit 4fbfc06 into barbeau:master Feb 9, 2018
@barbeau
Copy link
Owner

barbeau commented Feb 9, 2018

I opened a new issue for cropping the flag images at #111.

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.

None yet

3 participants