Parcourir la source

[공통][Bug] 하위 버전 (api 19에서 테스트 됨) 에서는 키보드 높이만큼 패딩이 주어진다.
- 실제 영역은 더 줄어들기때문에 리사이즈를 적용하지 않는다.

hyodong.min il y a 6 ans
Parent
commit
e1e4111785

+ 15 - 9
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/FullScreenWithKeyBoardLayout.java

@@ -39,16 +39,22 @@ public class FullScreenWithKeyBoardLayout {
     if (usableHeightNow != usableHeightPrevious) {
       int usableHeightSansKeyboard = mChildOfContent.getRootView().getHeight();
       int heightDifference = usableHeightSansKeyboard - usableHeightNow;
-      if (heightDifference > (usableHeightSansKeyboard / 4)) {
-        // keyboard probably just became visible
-        heightDifference = heightDifference - ResourceUtil.getStatusBarHeightManual() - ResourceUtil.getNavBarHeight();
-        frameLayoutParams.height = usableHeightSansKeyboard - heightDifference;
+      /**
+       * 하위 버전 (api 19에서 테스트 됨) 에서는 키보드 높이만큼 패딩이 주어진다.
+       * 실제 영역은 더 줄어들기때문에 리사이즈를 적용하지 않는다.
+       */
+      if (mChildOfContent.getPaddingBottom() < (usableHeightSansKeyboard / 4)) {
+        if (heightDifference > (usableHeightSansKeyboard / 4)) {
+          // keyboard probably just became visible
+          heightDifference = heightDifference - ResourceUtil.getStatusBarHeightManual() - ResourceUtil.getNavBarHeight();
+          frameLayoutParams.height = usableHeightSansKeyboard - heightDifference;
+        }
+        else {
+          // keyboard probably just became hidden
+          frameLayoutParams.height = usableHeightSansKeyboard;
+        }
+        mChildOfContent.requestLayout();
       }
-      else {
-        // keyboard probably just became hidden
-        frameLayoutParams.height = usableHeightSansKeyboard;
-      }
-      mChildOfContent.requestLayout();
       usableHeightPrevious = usableHeightNow;
     }
   }