Fix banner scaling using a different method. #524
Merged
+2
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
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:
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:
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.
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.