Skip to content

Commit

Permalink
Merge pull request crosswalk-project#2350 from kurli/activity_fullscreen
Browse files Browse the repository at this point in the history
[Android] Fix fullscreen configured with manifest not working issue
  • Loading branch information
Shiliu Wang committed Aug 27, 2014
2 parents 0b4876d + 2898297 commit 98522ef
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Rect;
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
Expand Down Expand Up @@ -468,7 +472,20 @@ public void onGetUrlAndLaunchScreenFromManifest(String url, String readyWhen, St

@CalledByNative
public void onGetFullscreenFlagFromManifest(boolean enterFullscreen) {
if (enterFullscreen) mContentsClientBridge.onToggleFullscreen(true);
if (enterFullscreen) {
if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) {
View decorView = mXWalkView.getActivity().getWindow().getDecorView();
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_FULLSCREEN |
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
} else {
mXWalkView.getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
}
}

public void destroy() {
Expand Down

0 comments on commit 98522ef

Please sign in to comment.