|
|
@@ -6,6 +6,8 @@ import android.view.View;
|
|
|
import android.view.ViewTreeObserver;
|
|
|
import android.widget.FrameLayout;
|
|
|
|
|
|
+import kr.co.zumo.app.lifeplus.util.ResourceUtil;
|
|
|
+
|
|
|
/**
|
|
|
* AndroidBug5497Workaround
|
|
|
* <pre>
|
|
|
@@ -16,17 +18,17 @@ import android.widget.FrameLayout;
|
|
|
* @history 하세미 [2018-12-05] [최초 작성]
|
|
|
* @since 2018-12-05
|
|
|
*/
|
|
|
-public class AndroidBug5497Workaround {
|
|
|
+public class FullScreenWithKeyBoardLayout {
|
|
|
|
|
|
public static void assistActivity(Activity activity) {
|
|
|
- new AndroidBug5497Workaround(activity);
|
|
|
+ new FullScreenWithKeyBoardLayout(activity);
|
|
|
}
|
|
|
|
|
|
private View mChildOfContent;
|
|
|
private int usableHeightPrevious;
|
|
|
private FrameLayout.LayoutParams frameLayoutParams;
|
|
|
|
|
|
- private AndroidBug5497Workaround(Activity activity) {
|
|
|
+ private FullScreenWithKeyBoardLayout(Activity activity) {
|
|
|
FrameLayout content = (FrameLayout) activity.findViewById(android.R.id.content);
|
|
|
mChildOfContent = content.getChildAt(0);
|
|
|
mChildOfContent.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
|
|
@@ -42,6 +44,7 @@ public class AndroidBug5497Workaround {
|
|
|
int heightDifference = usableHeightSansKeyboard - usableHeightNow;
|
|
|
if (heightDifference > (usableHeightSansKeyboard / 4)) {
|
|
|
// keyboard probably just became visible
|
|
|
+ heightDifference = heightDifference - ResourceUtil.getStatusBarHeightManual();
|
|
|
frameLayoutParams.height = usableHeightSansKeyboard - heightDifference;
|
|
|
}
|
|
|
else {
|