-
Notifications
You must be signed in to change notification settings - Fork 186
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
[Android] New UI and Code Clean #980
Conversation
Ah, it seems that exiting a game cause a crash. |
BlisterB, are also new setting wishes welcome here? |
Okay, I'm trying to resolve all my buildingscript and crash problem and I do that. |
I will use Jenkins to get the .apk until I will be able to compile the buildscript with my computer, please ignore my further commits/message like "test this jenkins". |
btw you can skip the native code compilation on your PC by just taking the libmain.so and libSDL.so from the APK and placing them in the lib directory. Then you can compile only the Java code and Andriod Studio will use these libs. |
:O |
We should note it in the android's buildscript README, it would save hours for future developers. |
Landscape mode is here :). |
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginLeft="5dp" | ||
android:text="Force horizontal mode" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be translatable and "Force landscape orientation"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected
@@ -83,6 +88,7 @@ protected void onCreate(Bundle savedInstanceState) { | |||
getWindow().setFlags(0x01000000, 0x01000000); | |||
} | |||
} catch (Exception e) { | |||
e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing to note here, is that you use spaces for indentation in these lines again.
Would be really nice if you could convert them so this file is not "mixed".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I never see them because Intellij convert them silently.
The java convention is 4 spaces (I hate this, but well), do you want me to convert this file with spaces or tabulation?
http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-136091.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should have configured your editor to use Tabs or at least "keep source file identation" >.>
Also makes diffing impossible, look at the git diff. Shows 100% changed just because intellij siletly converts -.-
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I just did it.
I did several testing with the memory leak that endGame( ) causes. It seems to be not linked with the Java Code.
Unfortunatly I can't try to delete the exit(0) instruction from the C code as I'm not able to compile the buildscript :/. |
@BlisterB |
Yep, you're right! |
Deleting the exit(0) indeed remove the crash. Here is the output for the first game (I launch the game, then exited it) :
And for the second (start the game, then crash):
|
This is because Android is the biggest bullshit ever and doesn't correctly start applications but only knows suspend and resume. >.> |
I agree for the bullshit part |
It tries to "recycle" the activity, is that what you mean? |
yes |
and this concept doesn't exist on any other system, so this will also not work for our code |
Hmm I don't have the competences on SDL and the Player to really understand what happens, are you sure that this is not related with the fact that SDLActivity has a lot of static member? |
That " A/libc: Fatal signal 11 (SIGSEGV), code 1, " is usally followed by a stacktrace in the native code. When you pastebin the stacktrace I give you the readable one |
And I think it's not nice to do "EasyRpgPlayerActivity.this.finish();" until the Player is properly shutdown. What happens when you just comment out that "exit(0)" and remove your finish() function again? |
Yes indeed, that was to test what happened if the android code close the app by selecting exit in the activity menu (I just have to select the third option in the title screen to know what happen without android code). Without exit(0) and without finish( ) : produces the result above : the first exit doesn't crash, but the second launch does crash with "Fatal signal 11 (SIGSEGV), code 1 (SDLThread)" I will study how to display the native output. Sounds a little tricky without a root device. |
Yeah, we should now be able implement a debug mode in a way more cleaner than my previously attempt ^^. I've just swap the old menu with the new one in the Player and the ButtonMapping activities (#982). It's more modern and should be more compatible :).
|
@Ghabry the crash you reported should be fixed ! |
@BlisterB thats nice. You also replaced the legacy menu, wasn't expecting this. samsung users will love you :D Don't forget updating the compat lib to v24. But there is one problem itsSchoko mentioned a while ago which will probably happen: When you have a swipe out menu you can trigger that menu by accident. Oh and one minor thing: In that swipe out menu the text "EasyRPG Player" is hard to read because it is black. Should be white as in the gamebrowser. Otherwise I think we are done here. Don't see any further issues by now 👍 . Great job, could you also make the iOS Gui for us? hahaha ;) |
@@ -108,4 +104,5 @@ Please tell us in detail what went wrong.\n | |||
<!--GameBrowserAPI15--> | |||
<string name="navigation_drawer_open">Open navigation drawer</string> | |||
<string name="navigation_drawer_close">Close navigation drawer</string> | |||
<string name="menu">Menu</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change this in "Open Android Menu"? Makes the purpose more clear imo. (I assume this is the string for that rectangular menu button in the layout)
I'm fixing what you reported :). I know the Swift language and I have a Macbook, so I am technically able to do the iOS port. But I don't have an iPhone and I don't think the iOS simulator will be enough with all the native code handling xp. |
I've done your suggestion except for the text in the drawerlayout, but please don't merge, I just remembered that I didn't provide a design for the menu button x). |
Design done :). |
jenkins: test this please. |
Does not start @BlisterB
And a user reported that the menu opens now in the button editor, but the version on google play is still with legacy menu obviously, wtf. |
Looks like the solution is settings gradle to a version >= 2.0.0 See also https://code.google.com/p/android/issues/detail?id=214182 And https://developer.android.com/studio/releases/gradle-plugin.html |
Does it solve the problem on your devices? |
Works for me now 👍 I have Android 4.0.3 and 4.1 Oh and one minor thing: In that swipe out menu the text "EasyRPG Player" is hard to read because it is black. Should be white as in the gamebrowser. (applies to layout editor and ingame) |
Can you provide me a picture? It is not supposed to be black, it looks like this on my devices: |
Sorry The first one is a visual glitch that is probably not your fault. The first time the menu opens it only opens on the buttons and behind the Game screen. This gets fixed by touching the menu... Only happens on my 4.0.3 (works on 4.1), probably not fixable, OpenGL error I assume. After touching in correct: Except the color is black (on both 4.0.3 and 4.1) |
Oh okay, Android doesn't provide the same default color depending on the API. I'm fixing that. Thanks for the screenshot! |
I also have a bug with the DrawerLayout, but different than yours and not problematic. |
Doesn't happen on my Android 4.1, always opens at the top. Android is strange... |
Yep as always, can't wait the Samsung's users feedback x). I fixed the text color thing :). |
@BlisterB Colors are correct now. |
Nope, using the DrawerLayout is supposed to fix z layer itself, looks like an Android bug :/. |
Good job @BlisterB , please submit French translations for the new Ui stuff on Transifiex :D |
Okay ^^ |
Uhm looks like the metadata update depends on https://ci.easyrpg.org/view/Player/job/player-metadata/ So look again in 30min... |
Hi everyone.
This PR doesn't bring any new feature and is only focused on code clean related to Preferences.
Dealing with user's settings was a little annoying, but not anymore.
PS : I intend to do 1 code clean commit tomorrow (and I have to remove the 2 .iml files).
PS2 : I rebased on master.
Fix #919
Fix #982
Fix #996