Skip to content
Browse files

Merge branch 'dialog_fullscreen'

  • Loading branch information...
2 parents 79d4c22 + 21ca609 commit cb299994b420cb4aa752a4454c93d157af008217 @ksperling committed Dec 18, 2011
Showing with 13 additions and 1 deletion.
  1. +13 −1 facebook/src/com/facebook/android/FbDialog.java
View
14 facebook/src/com/facebook/android/FbDialog.java
@@ -16,6 +16,7 @@
package com.facebook.android;
+import android.app.Activity;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;
@@ -30,6 +31,7 @@
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.Window;
+import android.view.WindowManager;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.FrameLayout;
@@ -59,10 +61,20 @@
private FrameLayout mContent;
public FbDialog(Context context, String url, DialogListener listener) {
- super(context, android.R.style.Theme_Translucent_NoTitleBar);
+ super(context, isFullScreenActivity(context)
+ ? android.R.style.Theme_Translucent_NoTitleBar_Fullscreen
+ : android.R.style.Theme_Translucent_NoTitleBar);
mUrl = url;
mListener = listener;
}
+
+ private static boolean isFullScreenActivity(Context context) {
+ if (!(context instanceof Activity)) return false;
+ Window window = ((Activity) context).getWindow();
+ if (window == null) return false;
+ WindowManager.LayoutParams params = window.getAttributes();
+ return (params.flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0;
+ }
@Override
protected void onCreate(Bundle savedInstanceState) {

0 comments on commit cb29999

Please sign in to comment.
Something went wrong with that request. Please try again.