Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Use fullscreen theme for FBDialog if the context activity is fullscreen. #256

Closed
wants to merge 2 commits into from

2 participants

@ksperling

This makes the user experience more seamless.

@jamesgpearce

This pull request was raised against a previous version of the Facebook SDK for Android.

In 2012, the SDK had a significant rewrite and relaunch, and we are closing issues and pull requests that predate that v3.0 release.

If you think this pull request is still relevant, please refactor it to apply to the supported SDK (currently v3.6). For more information, please see our Android developer center at https://developers.facebook.com/docs/android

Many thanks for using the Facebook Platform, and your support of this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
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) {
Something went wrong with that request. Please try again.