Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions library/src/main/java/com/lxj/xpopup/core/FullScreenDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ protected void onCreate(Bundle savedInstanceState) {
// ViewGroup.LayoutParams layoutParams = contentView.getLayoutParams();
// layoutParams.height = getWindow().getAttributes().height;
// setContentView(contentView, layoutParams);
initListener();
setContentView(contentView);
}

Expand All @@ -97,6 +98,23 @@ private int getNavigationBarColor(){
: contentView.popupInfo.navigationBarColor;
}

private void initListener() {
final ViewGroup decorView = (ViewGroup) getWindow().getDecorView();
decorView.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
@Override
public void onSystemUiVisibilityChange(int visibility) {
if (!contentView.popupInfo.hasNavigationBar) {
hideNavigationBar();
}
if (!contentView.popupInfo.hasStatusBar) {
getWindow().setFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
}
});
}

public boolean isFuckVIVORoom(){
//vivo的Y开头的8.0和8.1系统特殊(y91 y85 y97):dialog无法覆盖到状态栏,并且坐标系下移了一个状态栏的距离
boolean isYModel = android.os.Build.MODEL.contains("Y")
Expand Down