|
|
@@ -37,8 +37,6 @@ public class FullScreenWithKeyBoardLayout {
|
|
|
frameLayoutParams = (FrameLayout.LayoutParams) childContent.getLayoutParams();
|
|
|
decorView = activity.getWindow().getDecorView();
|
|
|
|
|
|
- setOnSystemUiVisibilityChange();
|
|
|
- setOnSystemUiVisibilityChangeListener();
|
|
|
}
|
|
|
|
|
|
private void possiblyResizeChildOfContent() {
|
|
|
@@ -55,12 +53,19 @@ public class FullScreenWithKeyBoardLayout {
|
|
|
if (childContent.getPaddingBottom() < (usableHeightSansKeyboard / 4)) {
|
|
|
if (heightDifference > (usableHeightSansKeyboard / 4)) {
|
|
|
//keyboard probably just became visible
|
|
|
- heightDifference = heightDifference - ResourceUtil.getStatusBarHeightManual() - ResourceUtil.getNavBarHeight();
|
|
|
+ heightDifference = heightDifference - ResourceUtil.getStatusBarHeightManual();
|
|
|
frameLayoutParams.height = usableHeightSansKeyboard - heightDifference;
|
|
|
}
|
|
|
else {
|
|
|
//keyboard probably just became hidden
|
|
|
- frameLayoutParams.height = usableHeightSansKeyboard;
|
|
|
+ /**
|
|
|
+ * 화면 크기에 맞게 레이아웃 변경
|
|
|
+ * - 하단 네비바 유무에 따라서 스크린 사이즈 변경 됨
|
|
|
+ */
|
|
|
+ if (AppUtil.isFullScreenVersion()) {
|
|
|
+ usableHeightNow += ResourceUtil.getStatusBarHeight();
|
|
|
+ }
|
|
|
+ frameLayoutParams.height = usableHeightNow;
|
|
|
}
|
|
|
childContent.requestLayout();
|
|
|
}
|
|
|
@@ -78,26 +83,4 @@ public class FullScreenWithKeyBoardLayout {
|
|
|
childContent.getWindowVisibleDisplayFrame(r);
|
|
|
return (r.bottom - r.top);
|
|
|
}
|
|
|
-
|
|
|
- private void setOnSystemUiVisibilityChangeListener() {
|
|
|
- decorView.setOnSystemUiVisibilityChangeListener(visibility -> {
|
|
|
- setOnSystemUiVisibilityChange();
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 화면 크기에 맞게 레이아웃 변경
|
|
|
- * - 하단 네비바 유무에 따라서 스크린 사이즈 변경 됨
|
|
|
- */
|
|
|
- private void setOnSystemUiVisibilityChange() {
|
|
|
- int finalUsableHeightNow = computeUsableHeight();
|
|
|
-
|
|
|
- // 풀 스크린 버젼은 상단 스테이터스바의 높이가 계산되지 않아서 크기를 더해줌
|
|
|
- if (AppUtil.isFullScreenVersion()) {
|
|
|
- finalUsableHeightNow += ResourceUtil.getStatusBarHeight();
|
|
|
- }
|
|
|
-
|
|
|
- frameLayoutParams.height = finalUsableHeightNow;
|
|
|
- childContent.requestLayout();
|
|
|
- }
|
|
|
}
|