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

[Android] New UI and Code Clean #980

Merged
merged 20 commits into from
Aug 27, 2016
Merged

[Android] New UI and Code Clean #980

merged 20 commits into from
Aug 27, 2016

Conversation

BlisterB
Copy link
Member

@BlisterB BlisterB commented Aug 8, 2016

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.

  • Setting's Controller and Activity are separated.
  • No need to pass the Context everywhere in order to modify/access a preference variable. This is cool because before this PR you had to put the context on too much function argument (thanks Android).
  • No need to update the Preferences class to be sure that data are updated.
  • With the facade design pattern used in SettingManager, element to modify are now clearer.

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

@BlisterB
Copy link
Member Author

BlisterB commented Aug 8, 2016

Ah, it seems that exiting a game cause a crash.

@Ghabry Ghabry self-assigned this Aug 12, 2016
@Ghabry
Copy link
Member

Ghabry commented Aug 12, 2016

BlisterB, are also new setting wishes welcome here?
Some users want a "force orientation" option for the PlayerActivity :D

@BlisterB
Copy link
Member Author

Okay, I'm trying to resolve all my buildingscript and crash problem and I do that.
Settings activity really need to be split in different activites x).

@BlisterB
Copy link
Member Author

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".

@Ghabry
Copy link
Member

Ghabry commented Aug 13, 2016

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.

@BlisterB
Copy link
Member Author

:O
It works like a charm, thank you!

@BlisterB
Copy link
Member Author

We should note it in the android's buildscript README, it would save hours for future developers.

@BlisterB
Copy link
Member Author

Landscape mode is here :).

android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="Force horizontal mode"
Copy link
Member

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"

Copy link
Member Author

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();
Copy link
Member

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".

Copy link
Member Author

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

Copy link
Member

@Ghabry Ghabry Aug 13, 2016

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 -.-

Copy link
Member Author

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.

@BlisterB
Copy link
Member Author

BlisterB commented Aug 13, 2016

I did several testing with the memory leak that endGame( ) causes. It seems to be not linked with the Java Code.

  1. With EndGame( )
    The actual way of exiting the app seems to cause a memory leak that corrupt the SettingsManager classe and cause the app to crash.

  2. If I keep endGame and add Activity.finish( ) after, or swap endGame( ) with Activity.finish( ) (the usual way to exit an activity) I can have 2 results : a crash, or a return to GameBrowser but with SettingManager with all parameter set to null value.
    I can see those lines on logs :

08-13 15:37:55.582 10471-10700/org.easyrpg.player E/libEGL: call to OpenGL ES API with no current context (logged once per thread)
08-13 15:37:55.698 10471-10709/org.easyrpg.player W/art: Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[18,tid=10709,Native,Thread*=0xa01d5600,peer=0x12c850a0,"Thread-35600"]
08-13 15:37:55.699 10471-10702/org.easyrpg.player W/art: Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[14,tid=10702,Native,Thread*=0xa07b9e00,peer=0x12c60100,"Thread-35597"]

Unfortunatly I can't try to delete the exit(0) instruction from the C code as I'm not able to compile the buildscript :/.
(And I now realize that github rejected a post in the buildscript discussion because of a too heavy output copy/paste)/

@Ghabry
Copy link
Member

Ghabry commented Aug 13, 2016

@BlisterB
You can delete the exit(0), push a commit and take the compiled main.so file ;)

@BlisterB
Copy link
Member Author

Yep, you're right!

@BlisterB
Copy link
Member Author

BlisterB commented Aug 13, 2016

Deleting the exit(0) indeed remove the crash.
But now it crash when we start another game after exiting one.

Here is the output for the first game (I launch the game, then exited it) :

08-13 17:29:00.589 15518-15518/org.easyrpg.player E/JSO reading: Error reading the file /storage/emulated/0/easyrpg/Save/EasyRPG/Velsarbor/easyrpg-pref.txt
                                                                 /storage/emulated/0/easyrpg/Save/EasyRPG/Velsarbor/easyrpg-pref.txt: open failed: ENOENT (No such file or directory)
08-13 17:29:00.736 15518-15518/org.easyrpg.player I/Timeline: Timeline: Activity_launch_request id:org.easyrpg.player time:147984730

                                                              --------- beginning of system
08-13 17:29:00.756 15518-15518/org.easyrpg.player V/SDL: Device: D5803
08-13 17:29:00.756 15518-15518/org.easyrpg.player V/SDL: Model: D5803
08-13 17:29:00.756 15518-15518/org.easyrpg.player V/SDL: onCreate(): null
08-13 17:29:00.807 15518-15518/org.easyrpg.player E/JSO reading: Error reading the file button_mapping.txt
                                                                 /data/user/0/org.easyrpg.player/files/button_mapping.txt: open failed: ENOENT (No such file or directory)
08-13 17:29:00.808 15518-15518/org.easyrpg.player E/JSO reading: Error parsing a JSO file : End of input at character 0 of 
08-13 17:29:00.808 15518-15518/org.easyrpg.player I/Button Mapping Model: No button_mapping.txt file, loading the default Button Mapping System
08-13 17:29:00.814 15518-15518/org.easyrpg.player E/JSO reading: Error reading the file /storage/emulated/0/easyrpg/Save/EasyRPG/Velsarbor/easyrpg-pref.txt
                                                                 /storage/emulated/0/easyrpg/Save/EasyRPG/Velsarbor/easyrpg-pref.txt: open failed: ENOENT (No such file or directory)
08-13 17:29:00.815 15518-15518/org.easyrpg.player V/SDL: onResume()
08-13 17:29:00.844 15518-15518/org.easyrpg.player V/SDL: surfaceCreated()
08-13 17:29:00.844 15518-15518/org.easyrpg.player V/SDL: surfaceChanged()
08-13 17:29:00.844 15518-15518/org.easyrpg.player V/SDL: pixel format RGB_565
08-13 17:29:00.845 15518-15518/org.easyrpg.player V/SDL: Window size: 720x1776
08-13 17:29:00.854 15518-15634/org.easyrpg.player I/SDL: SDL_Android_Init()
08-13 17:29:00.854 15518-15634/org.easyrpg.player I/SDL: SDL_Android_Init() finished!
08-13 17:29:00.854 15518-15634/org.easyrpg.player I/EasyRPG Player: EasyRPG Player 0.4.1 started
08-13 17:29:00.855 15518-15634/org.easyrpg.player I/EasyRPG Player: ============================
08-13 17:29:00.856 15518-15634/org.easyrpg.player I/EasyRPG Player: CLI: --project-path /storage/9016-4EF8/Mes Documents/EasyRPG/Velsarbor --save-path /storage/emulated/0/easyrpg/Save/EasyRPG/Velsarbor --encoding auto 
08-13 17:29:00.891 15518-15634/org.easyrpg.player V/SDL: SDL audio: opening device
08-13 17:29:00.891 15518-15634/org.easyrpg.player V/SDL: SDL audio: wanted stereo 16-bit 44.1kHz, 2048 frames buffer
08-13 17:29:00.902 15518-15518/org.easyrpg.player V/SDL: onWindowFocusChanged(): true
08-13 17:29:00.926 15518-15634/org.easyrpg.player V/SDL: SDL audio: got stereo 16-bit 44.1kHz, 3544 frames buffer
08-13 17:29:00.929 15518-15634/org.easyrpg.player I/EasyRPG Player: Opened audio at 44100 Hz (stereo), format: S16LSB
08-13 17:29:00.957 15518-15518/org.easyrpg.player I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@86666d3 time:147984951
08-13 17:29:01.763 15518-15634/org.easyrpg.player I/EasyRPG Player: Detected encoding: ibm-5348_P100-1997
08-13 17:29:01.765 15518-15634/org.easyrpg.player I/EasyRPG Player: Using /storage/9016-4EF8/Mes Documents/EasyRPG/Velsarbor as Game directory
08-13 17:29:01.765 15518-15634/org.easyrpg.player I/EasyRPG Player: Using /storage/emulated/0/easyrpg/Save/EasyRPG/Velsarbor as Save directory
08-13 17:29:02.287 15518-15634/org.easyrpg.player I/EasyRPG Player: Loading game Velsarbor
08-13 17:29:02.287 15518-15634/org.easyrpg.player I/EasyRPG Player: Using RPG2k Interpreter
08-13 17:29:02.293 15518-15634/org.easyrpg.player I/EasyRPG Player: Adding /storage/emulated/0/easyrpg/rtp/2000/ to RTP path
08-13 17:29:02.295 15518-15634/org.easyrpg.player I/EasyRPG Player: Actor 5: Removing invalid item 17 (of type 0) from equipment slot 0 (needs type 1)
08-13 17:29:02.295 15518-15634/org.easyrpg.player I/EasyRPG Player: Actor 8: Removing invalid item 17 (of type 0) from equipment slot 0 (needs type 1)
08-13 17:29:02.295 15518-15634/org.easyrpg.player I/EasyRPG Player: Actor 8: Removing invalid item 53 (of type 1) from equipment slot 2 (needs type 3)
08-13 17:29:02.296 15518-15634/org.easyrpg.player I/EasyRPG Player: Actor 9: Removing invalid item 17 (of type 0) from equipment slot 0 (needs type 1)
08-13 17:29:02.296 15518-15634/org.easyrpg.player I/EasyRPG Player: Actor 9: Removing invalid item 53 (of type 1) from equipment slot 2 (needs type 3)
08-13 17:29:03.415 15518-15634/org.easyrpg.player I/EasyRPG Player: FmMidi fallback: /storage/9016-4EF8/Mes Documents/EasyRPG/Velsarbor/Music/Tsuisou.mid
08-13 17:29:04.679 15518-15518/org.easyrpg.player V/Player: onCreateOption
08-13 17:29:04.771 15518-15518/org.easyrpg.player V/SDL: onWindowFocusChanged(): false
08-13 17:29:06.334 15518-15518/org.easyrpg.player V/SDL: onPause()
08-13 17:29:06.334 15518-15518/org.easyrpg.player V/SDL: nativePause()
08-13 17:29:06.334 15518-15518/org.easyrpg.player E/libEGL: call to OpenGL ES API with no current context (logged once per thread)
08-13 17:29:06.524 15518-15518/org.easyrpg.player I/Browser: 2 games found : [Velsarbor, Dyhortfight Chapitre 1]
08-13 17:29:06.660 15518-15518/org.easyrpg.player V/SDL: surfaceDestroyed()
08-13 17:29:06.676 15518-15518/org.easyrpg.player I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@6ebedd6 time:147990670
08-13 17:29:06.788 15518-15518/org.easyrpg.player V/SDL: onDestroy()
08-13 17:29:06.792 15518-15634/org.easyrpg.player E/libEGL: call to OpenGL ES API with no current context (logged once per thread)
08-13 17:29:06.892 15518-15649/org.easyrpg.player W/art: Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[17,tid=15649,Native,Thread*=0xa014e700,peer=0x12cd8100,"Thread-37379"]
08-13 17:29:06.894 15518-15636/org.easyrpg.player W/art: Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[15,tid=15636,Native,Thread*=0xb3407800,peer=0x12c50280,"Thread-37377"]
08-13 17:29:06.913 15518-15518/org.easyrpg.player E/SDL: error handling message, getContext() returned null
08-13 17:29:06.913 15518-15518/org.easyrpg.player E/SDL: error handling message, getContext() returned null

And for the second (start the game, then crash):

08-13 17:29:29.273 15518-15518/org.easyrpg.player E/JSO reading: Error reading the file /storage/emulated/0/easyrpg/Save/EasyRPG/Dyhortfight Chapitre 1/easyrpg-pref.txt
                                                                 /storage/emulated/0/easyrpg/Save/EasyRPG/Dyhortfight Chapitre 1/easyrpg-pref.txt: open failed: ENOENT (No such file or directory)
08-13 17:29:29.382 15518-15518/org.easyrpg.player I/Timeline: Timeline: Activity_launch_request id:org.easyrpg.player time:148013376
08-13 17:29:29.398 15518-15518/org.easyrpg.player V/SDL: Device: D5803
08-13 17:29:29.398 15518-15518/org.easyrpg.player V/SDL: Model: D5803
08-13 17:29:29.398 15518-15518/org.easyrpg.player V/SDL: onCreate(): null
08-13 17:29:29.405 15518-15518/org.easyrpg.player E/JSO reading: Error reading the file button_mapping.txt
                                                                 /data/user/0/org.easyrpg.player/files/button_mapping.txt: open failed: ENOENT (No such file or directory)
08-13 17:29:29.405 15518-15518/org.easyrpg.player E/JSO reading: Error parsing a JSO file : End of input at character 0 of 
08-13 17:29:29.405 15518-15518/org.easyrpg.player I/Button Mapping Model: No button_mapping.txt file, loading the default Button Mapping System
08-13 17:29:29.409 15518-15518/org.easyrpg.player E/JSO reading: Error reading the file /storage/emulated/0/easyrpg/Save/EasyRPG/Dyhortfight Chapitre 1/easyrpg-pref.txt
                                                                 /storage/emulated/0/easyrpg/Save/EasyRPG/Dyhortfight Chapitre 1/easyrpg-pref.txt: open failed: ENOENT (No such file or directory)
08-13 17:29:29.410 15518-15518/org.easyrpg.player V/SDL: onResume()
08-13 17:29:29.460 15518-15518/org.easyrpg.player V/SDL: surfaceCreated()
08-13 17:29:29.460 15518-15518/org.easyrpg.player V/SDL: surfaceChanged()
08-13 17:29:29.460 15518-15518/org.easyrpg.player V/SDL: pixel format RGB_565
08-13 17:29:29.461 15518-15518/org.easyrpg.player V/SDL: Window size: 720x1776
08-13 17:29:29.472 15518-16150/org.easyrpg.player I/SDL: SDL_Android_Init()
08-13 17:29:29.472 15518-16150/org.easyrpg.player I/SDL: SDL_Android_Init() finished!

                                                         --------- beginning of crash
08-13 17:29:29.473 15518-16150/org.easyrpg.player A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x8 in tid 16150 (SDLThread)
08-13 17:29:29.521 15518-15518/org.easyrpg.player V/SDL: onWindowFocusChanged(): true
08-13 17:29:29.573 15518-15518/org.easyrpg.player I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@237ab21 time:148013567

@Ghabry
Copy link
Member

Ghabry commented Aug 13, 2016

This is because Android is the biggest bullshit ever and doesn't correctly start applications but only knows suspend and resume. >.>
So I guess it does a restart here of the already shut down app instead of starting a new instance.

@BlisterB
Copy link
Member Author

I agree for the bullshit part

@BlisterB
Copy link
Member Author

It tries to "recycle" the activity, is that what you mean?

@Ghabry
Copy link
Member

Ghabry commented Aug 13, 2016

yes

@Ghabry
Copy link
Member

Ghabry commented Aug 13, 2016

and this concept doesn't exist on any other system, so this will also not work for our code

@BlisterB
Copy link
Member Author

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?
Maybe one of them is not set to its default value on exit.
Moreover, why does those bugs happen now, okay its a pretty big refactoring, but it doesn't really change the way the Player works ?_?.
Is that what you like Android? Torturing good people??

@Ghabry
Copy link
Member

Ghabry commented Aug 13, 2016

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

@Ghabry
Copy link
Member

Ghabry commented Aug 13, 2016

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?

@BlisterB
Copy link
Member Author

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.

@BlisterB
Copy link
Member Author

BlisterB commented Aug 21, 2016

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 :).
This PR should be soon ready to merge, I've got 2 things to do :

  • Resolve your stack trace
  • Resolve a little UI bug : in a game in portrait mode, the menu doesn't start at the top, but if we choose an item in the menu, it go to the right place. (Not a big deal, but not very clean).

@BlisterB
Copy link
Member Author

@Ghabry the crash you reported should be fixed !

@Ghabry
Copy link
Member

Ghabry commented Aug 27, 2016

@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.
Happens in my case when I use "left" on the virtual dpad and swipe to the right. Is it possible to disable this? i assume users will be really annoyed by this.

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>
Copy link
Member

@Ghabry Ghabry Aug 27, 2016

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)

@BlisterB
Copy link
Member Author

I'm fixing what you reported :).
Could you provide me a screenshot of your menu in the Player's activity ? The text should have a green background exactly as in the Gamebrowser.

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.
It's for the same reason I haven't done the Gamepad mapping : I don't have a gamepad device. Does someone have a cheap but good device which adapt on every smartphone screen size to advise me :p ?

@BlisterB
Copy link
Member Author

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).

@BlisterB
Copy link
Member Author

Design done :).
But looks like you'll have to update the buildscript to API 24.
(I remembered that API 24 now support Java Lambdas, yay).

@carstene1ns
Copy link
Member

jenkins: test this please.
(Added the API 24 SDK on server)

@Ghabry
Copy link
Member

Ghabry commented Aug 27, 2016

Does not start @BlisterB

E/AndroidRuntime( 6762): FATAL EXCEPTION: main
E/AndroidRuntime( 6762): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.easyrpg.player/org.easyrpg.player.game_browser.GameBrowserActivity}: java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.
E/AndroidRuntime( 6762):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
E/AndroidRuntime( 6762):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2146)
E/AndroidRuntime( 6762):        at android.app.ActivityThread.access$700(ActivityThread.java:140)
E/AndroidRuntime( 6762):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1238)
E/AndroidRuntime( 6762):        at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 6762):        at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 6762):        at android.app.ActivityThread.main(ActivityThread.java:4947)
E/AndroidRuntime( 6762):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 6762):        at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 6762):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
E/AndroidRuntime( 6762):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
E/AndroidRuntime( 6762):        at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
E/AndroidRuntime( 6762):        at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 6762): Caused by: java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.
E/AndroidRuntime( 6762):        at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:692)
E/AndroidRuntime( 6762):        at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:186)
E/AndroidRuntime( 6762):        at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:77)
E/AndroidRuntime( 6762):        at android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:83)
E/AndroidRuntime( 6762):        at android.support.v7.app.AppCompatDelegateImplV7.<init>(AppCompatDelegateImplV7.java:146)
E/AndroidRuntime( 6762):        at android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:28)
E/AndroidRuntime( 6762):        at android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:41)
E/AndroidRuntime( 6762):        at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:193)
E/AndroidRuntime( 6762):        at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:173)
E/AndroidRuntime( 6762):        at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:511)
E/AndroidRuntime( 6762):        at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
E/AndroidRuntime( 6762):        at org.easyrpg.player.game_browser.GameBrowserActivity.onCreate(GameBrowserActivity.java:46)
E/AndroidRuntime( 6762):        at android.app.Activity.performCreate(Activity.java:5207)
E/AndroidRuntime( 6762):        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
E/AndroidRuntime( 6762):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2085)
E/AndroidRuntime( 6762):        ... 12 more

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.

@Ghabry
Copy link
Member

Ghabry commented Aug 27, 2016

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

@BlisterB
Copy link
Member Author

Does it solve the problem on your devices?
Mines were working from the beginning.

@Ghabry
Copy link
Member

Ghabry commented Aug 27, 2016

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)

@BlisterB
Copy link
Member Author

Can you provide me a picture?

It is not supposed to be black, it looks like this on my devices:
https://drive.google.com/file/d/0BzyFBzg6Eyy5NVRsLUVleVotSXc/view?usp=sharing

@Ghabry
Copy link
Member

Ghabry commented Aug 27, 2016

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.

20160827_212311

After touching in correct: Except the color is black (on both 4.0.3 and 4.1)

20160827_212335

@BlisterB
Copy link
Member Author

Oh okay, Android doesn't provide the same default color depending on the API. I'm fixing that. Thanks for the screenshot!

@BlisterB
Copy link
Member Author

I also have a bug with the DrawerLayout, but different than yours and not problematic.
In portrait mode the menu open at the vertical begining of the first button, but it fixes itself after selecting an item. But no glitch like yours.
I think this is linked to the translation I apply on the RelativeLayout containing all the buttons, on Activity's creation.

@Ghabry
Copy link
Member

Ghabry commented Aug 27, 2016

Doesn't happen on my Android 4.1, always opens at the top. Android is strange...

@BlisterB
Copy link
Member Author

Yep as always, can't wait the Samsung's users feedback x).

I fixed the text color thing :).

@Ghabry
Copy link
Member

Ghabry commented Aug 27, 2016

@BlisterB
Is there some z-layer attribute for that menu? If yes could you increase it and I check if this fixes the visual glitch? If not lets ignore this, the problem solves itself over time.

Colors are correct now.

@BlisterB
Copy link
Member Author

Nope, using the DrawerLayout is supposed to fix z layer itself, looks like an Android bug :/.

@Ghabry Ghabry merged commit 8d9dc6b into EasyRPG:master Aug 27, 2016
@Ghabry
Copy link
Member

Ghabry commented Aug 27, 2016

Good job @BlisterB , please submit French translations for the new Ui stuff on Transifiex :D

@BlisterB
Copy link
Member Author

Okay ^^
Thanks everyone for the help!

@Ghabry
Copy link
Member

Ghabry commented Aug 27, 2016

Uhm looks like the metadata update depends on https://ci.easyrpg.org/view/Player/job/player-metadata/ So look again in 30min...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants