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

--HG--
extra : rebase_source : a4fd4db28ccb9b210a547b328af72c6390a038d0
This commit is contained in:
Nevin Chen 2017-11-14 15:06:18 +08:00
Родитель 639e6d2041
Коммит 3952fdd772
1 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -32,6 +32,7 @@ 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;
@ -84,6 +85,20 @@ public class BaseMessageDialog extends Dialog {
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));