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

Fix banner scaling using a different method. #524

Merged
merged 1 commit into from Jun 21, 2014

Conversation

sigmabeta
Copy link
Contributor

As I commented in PR #517, Lioncash's issue is not incorrect, but is doing extra work. This fix relies more on android's built-in scaling.

I've tested the fix on an HTC Amaze, a phone wholly incapable of running Dolphin but with a low screen resolution, which exacerbates the original issue:

amaze-issue

The code in GameListAdapter.java causes this incorrect scaling. I can't explain why that is since I don't really know what the logic of those two lines was supposed to be (if I had to guess, the 860 should probably be a 640, and the 0.5 addition is probably not necessary either.) If you were to make just the changes I made to the layout XML, the output would be the same, because this code overrides the XML's contents. If you take those two lines out as I did, you have the following output:

amaze-java-removed

As Lioncash commented, this is not a great case either - on this phone it looks decent, but on a Nexus 5 it would be unreadably small. If you then add in the changes from the XML file, you get a much more desirable result.

amaze-100dpnexus-5-fixed

In these screenshots (one from the Amaze and one from Nexus 5) the banners are proportionally the same size (100 density-independent pixels; for most phones this translates to roughly 27% of screen width, regardless of pixel density). We can tweak this 100dp number up or down as desired if further adjustments are necessary.

-In GameListAdapter.java, the existing scaling code is unnecessary and stops Android's built in scaling from doing its job.
-In gamelist...etc.xml, set the icon's width to 100 density-independent pixels (i.e. have android figure out how to make it the right size.)
@Hydr8gon
Copy link
Member

Wow, it was that easy? I have a lot to learn about XML files in Android code.

@lioncash
Copy link
Member

That is very weird. I had done the same thing, yet it did not work for me. However, this looks fine.

lioncash added a commit that referenced this pull request Jun 21, 2014
Fix banner scaling using a different method.
@lioncash lioncash merged commit 4d39076 into dolphin-emu:master Jun 21, 2014
@Hydr8gon
Copy link
Member

There seems to be a "slight" problem with this: http://i.imgur.com/OeEJwMD.png

@lioncash
Copy link
Member

@SeannyM Fixed within PR #525, I didn't bring it up here since I didn't think it fit within the scope of this PR.

@sigmabeta sigmabeta deleted the android-banner-scaling branch June 9, 2015 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants