Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Solution to restore immersiveSticky mode
Started by soyenrique Sep 09 2019 02:46 AM

No replies to this topic
immersivesticky
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

soyenrique

[GLOBAL: userInfoPane.html]
soyenrique
  • Observer

  • 4 posts
  • Corona SDK

 
After playing a bit with the Corona code, I found the solution so that the immersiveSticky mode is restored correctly in Android 5 and higher.
 
 
The following lines must be changed in the Corona source code:
(\platform\android\sdk\src\com\ansca\corona\CoronaEnvironment.java)
public void onResumed(CoronaRuntime runtime) {
	for (CoronaRuntimeListener listener : cloneListenerCollection()) {
		if (listener != null) {
			listener.onResumed(runtime);
		}
	}
}
 
 
For these others:
(You just have to set the correct parameters in setSystemUiVisibility, depending on the user settings)
public void onResumed(CoronaRuntime runtime) {
	for (CoronaRuntimeListener listener : cloneListenerCollection()) {
		if (listener != null) {
			listener.onResumed(runtime);
		}
	}

	com.ansca.corona.CoronaEnvironment.getCoronaActivity().runOnUiThread(new Runnable() {
		@Override
		public void run() {
    		com.ansca.corona.CoronaEnvironment.getCoronaActivity().getOverlayView().setSystemUiVisibility(0x00000100 | 0x00000200 | 0x00000400 | 0x00000002 | 0x00001000);
	    }
    });

}
 
I would be very grateful to Corona programmers to solve this problem, we have been with it for too many years. In addition, Corona is the only engine that does not work properly.
 
Thank you!
 
 
Note: Forgive my English, but I am using the Google Translator. :(



[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: immersivesticky