Skip to content
This repository was archived by the owner on Nov 23, 2020. It is now read-only.

Commit 16cf764

Browse files
authored
Merge pull request #78 from shimohq/fix/null-bug
fix:尝试fix 线上bug
2 parents 3981411 + 75c6185 commit 16cf764

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

android/src/main/java/im/shimo/react/keyboard/AdjustResizeWithFullScreen.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ public class AdjustResizeWithFullScreen {
3131
private int mHeightPixels;
3232

3333
public static View getDecorView() {
34-
return mInstance.mActivity.getWindow().getDecorView();
34+
if(mInstance != null && mInstance.mActivity != null) {
35+
return mInstance.mActivity.getWindow().getDecorView();
36+
}
37+
return null;
3538
}
3639

3740
public static boolean isInit() {

android/src/main/java/im/shimo/react/keyboard/KeyboardView.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,10 +692,9 @@ public void run() {
692692
mContentViewPopupWindow.setWidth(useRight);
693693
}
694694
final View decorView = AdjustResizeWithFullScreen.getDecorView();
695-
if(decorView==null) {
696-
AdjustResizeWithFullScreen.assistRegisterActivity(mThemedContext.getCurrentActivity(), statusBarHeight, navigationBarHeight, this);
695+
if(decorView!=null) {
696+
mContentViewPopupWindow.showAtLocation(decorView, Gravity.NO_GRAVITY, AdjustResizeWithFullScreen.getUseLeft(), top);
697697
}
698-
mContentViewPopupWindow.showAtLocation(decorView, Gravity.NO_GRAVITY, AdjustResizeWithFullScreen.getUseLeft(), top);
699698
}
700699
mPreContentHeight = tempHeight;
701700
mPreContentTop = top;

0 commit comments

Comments
 (0)