Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Revert "[Android] fix Android9 inaccurate ScreenHeight problem" #2544

Merged
merged 1 commit into from
Jun 13, 2019
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
Expand All @@ -37,8 +36,6 @@
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;

import com.taobao.weex.WXEnvironment;
import com.taobao.weex.WXSDKInstance;
import com.taobao.weex.WXSDKManager;
Expand Down Expand Up @@ -209,17 +206,8 @@ public static int getScreenHeight() {

public static int getScreenHeight(Context cxt) {
if(cxt!=null){
WindowManager wm;
Resources res = cxt.getResources();
if(Build.VERSION.SDK_INT >= 28 && (wm = (WindowManager)cxt.getSystemService(Context.WINDOW_SERVICE)) != null
&& wm.getDefaultDisplay() != null){
Point size = new Point();
wm.getDefaultDisplay().getRealSize(size);
mScreenHeight = size.y;
}
else {
mScreenHeight = cxt.getResources().getDisplayMetrics().heightPixels;
}
mScreenHeight =cxt.getResources().getDisplayMetrics().heightPixels;
if(WXEnvironment.SETTING_FORCE_VERTICAL_SCREEN){
mScreenWidth = res
.getDisplayMetrics()
Expand Down