Android : Compatibility with portrait orientation #597

Merged
merged 7 commits into from Sep 24, 2015

Projects

None yet

3 participants

@BlisterB
Member

#575

The android port is now compatible with portrait orientation (no more freezing game), it's good BUT it will not be perfect until I'll implement resizable buttons. The problem is that tomorrow I start an intensive school year and I probably won't have time for EasyRPG during 1 year.

So this is what I've done, in portrait :

  • The game take the first half of the screen
  • Buttons keep proportional positions on portrait screen, but those proportions are decided in landscape mode ! ... With fixed size ! Sooo it brings some UX problem. I fixed them by slightly move buttons to the bottom of the screen (like if the was using the second half of the screen).

Why in this way ?
If I use proportional positions in the second half of the screen (like if it was a landscape mode) without resizing buttons : they may be one on the other.

Why no portrait mode in Button Mapping System ?
To not confuse users because proportions are not respected for the moment. Portrait mode is a "one more things" usefull, usable, but not perfect for the moment. Like we say in french "ça ne mange pas de pain".

Hope you like it !

@fdelapena
Member

Cool! 👍
by the way, "Add an Input Layout" button is not reachable in landscape mode in current upstream master.

Member

Hmmm, I can see it in landscape. Is that a version specific issue again?

Member

Hmmm, I can see it in landscape. Is that a version specific issue again?

I'm going to check with this new code, as "configChanges:orientation" might fix the issue with nested linearLayouts.

Member

Wuut, did i merged my own pull request on the main branch oô ? Heuu sorry guy ! I'll discuss in the pull request thread !

@Ghabry
Member
Ghabry commented Sep 24, 2015

Working rotation, cool. I could never get this to work without crashing.

The button realigning for Portrait works surprisingly well, not perfect but is a good start.
The game renders for me at the bottom 1/3 of the screen, is that correct?

Based on your workload I assume this can be merged for other devs to finish?

@fdelapena
Member

Missing button in landscape mode

The landscape mode is not showing the "Add an Input Layout" button in my Samsung Android 4.0.4, (note the scrollable nested linearLayout, reaching the end without the button). Could this be fixed in this PR?

@Ghabry
Member
Ghabry commented Sep 24, 2015

@BlisterBoy you can open PRs from any branch, not just master.
And you can do branch merges without opening PRs in your repo.

@BlisterB
Member

@fdelapena Oh i forgot about this thing ! Looks like Android doesn't provide a scrollbar by default, that's counter intuitive, you can have the same problem in portrait if you add a lot of input layouts. I'll study how to fix it, sorry for time loose !
(I feel the need to precise that I've never done Android programming before working on this project hahaha)

Thanks @Ghabry , the problem is that the player inherits of SDLActivity which has random comportments on some features. Now it shouldn't freeze anymore, but waiting for Samsungs feedback haha.
For the player screen, the problem is that getHeight and getWidth on the Surface give me the size of... the display. The Surface is not centered by Android, it's SDL that centered it on a canvas which take all the screen. So I move it a quarter on the top to put it at the center of the first half of the screen (because it was initially centered).
Maybe I'm mistaking but it's to avoid problem with strange devices with strange screen (and with Samsung devices haha), also to permit an error margin and not glue the Surface directly on the top screen without marging (I found this ugly).

Thanks for branchs' explanations !

Oh, I proposed the PR because I'm not sure to be ready to finish the work, and to permit user to enjoy it (I mean, it's usable without problems). I know myself, it's highly possible that I pull request the rest if I have the time. Don't loose time on this for the moment and fix the battle event things please :p.

@Ghabry
Member
Ghabry commented Sep 24, 2015

Thx for learning Android programming, you saved me lots of lifetime this way :D

@BlisterB
Member

lol nice, I save you a lot of time, and for my futur bank account a lot of money XD (android programming is very sought after in France).

Uuuurg trying to solve the @fdelapena , and it bring another problem, android I hate your UX problem è____é !!

@BlisterB
Member

@fdelapena you can merge this PR
I'm on the scrollbar thing but it may take a long time xp and is not related with this PR.

@fdelapena
Member

Found a bug, when toggling show/hide buttons, the layout is not shown stretched.

@BlisterB
Member

Fixed :p

@Ghabry Ghabry merged commit 3fc6cae into EasyRPG:master Sep 24, 2015

1 check passed

default Build finished. No test results found.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment