Bug 1390454 - Make Banner dialog status bar transparent. r?maliu
I didn't check if currently the app is using dark theme(LightweightTheme) or not.
Cause that requires some hacky injection to let Leanplum SDK knows the status bar corlor or dark theme or not.
MozReview-Commit-ID: 4Twe59Gw6mS
--- a/mobile/android/thirdparty/com/leanplum/messagetemplates/BaseMessageDialog.java
+++ b/mobile/android/thirdparty/com/leanplum/messagetemplates/BaseMessageDialog.java
@@ -27,16 +27,17 @@ import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Point;
import android.graphics.Typeface;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.RoundRectShape;
import android.graphics.drawable.shapes.Shape;
import android.os.Build;
+import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.Display;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
@@ -79,16 +80,30 @@ public class BaseMessageDialog extends D
protected HTMLOptions htmlOptions;
protected Activity activity;
protected WebView webView;
private boolean isWeb = false;
private boolean isHtml = false;
private boolean isClosing = false;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ final Window window = getWindow();
+ window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+ window.setStatusBarColor(Color.TRANSPARENT);
+
+ int flags = window.getDecorView().getSystemUiVisibility();
+ flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
+ window.getDecorView().setSystemUiVisibility(flags);
+ }
+ }
+
protected BaseMessageDialog(Activity activity, boolean fullscreen, BaseMessageOptions options,
WebInterstitialOptions webOptions, HTMLOptions htmlOptions) {
super(activity, getTheme(activity));
SizeUtil.init(activity);
this.activity = activity;
this.options = options;
this.webOptions = webOptions;