Skip to content

Commit

Permalink
fix(android): modal may not be fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
iPel authored and zoomchan-cxj committed Feb 6, 2023
1 parent 7d53ac0 commit 6358a5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import android.graphics.Canvas;
import android.graphics.Color;
import android.os.Build;
Expand All @@ -44,7 +42,6 @@
import com.tencent.mtt.hippy.utils.LogUtils;
import com.tencent.mtt.hippy.views.view.HippyViewGroup;

import java.lang.reflect.Field;
import java.util.ArrayList;

@SuppressWarnings({"unused"})
Expand Down Expand Up @@ -375,29 +372,14 @@ private int getScreenHeight() {

@SuppressWarnings("SameReturnValue")
protected int getThemeResId() {
return 0;
return android.R.style.Theme_Translucent_NoTitleBar;
}

protected Dialog createDialog(Context context) {
int themeResId = getThemeResId();
if (context != null) {
Resources res = context.getResources();
themeResId = res.getIdentifier("HippyFullScreenDialog", "style", context.getPackageName());
}

assert context != null;
Dialog dialog = new Dialog(context, themeResId);
if (themeResId == 0) {
Window window = dialog.getWindow();
if (window != null) {
window.requestFeature(Window.FEATURE_NO_TITLE);
window.setBackgroundDrawableResource(android.R.color.transparent);
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams
.MATCH_PARENT);
}
}

return dialog;
return new Dialog(context, themeResId);
}

protected View createContentView(View hostView) {
Expand Down
10 changes: 0 additions & 10 deletions android/sdk/src/main/res/values/themes.xml

This file was deleted.

0 comments on commit 6358a5e

Please sign in to comment.