import "android.util.*"
import "java.lang.*"
import "android.util.DisplayMetrics"
function getScreenPhysicalSize(ctx)
dm = DisplayMetrics();
ctx:getWindowManager():getDefaultDisplay():getMetrics(dm);
diagonalPixels = Math:sqrt(Math:pow(dm.widthPixels, 2) + Math:pow(dm.heightPixels, 2));
return diagonalPixels / (160 * dm.density);
end
function getBottomKeyboardHeight()
screenHeight = getScreenPhysicalSize(activity)
dm = DisplayMetrics()
activity:getWindowManager():getDefaultDisplay():getMetrics(dm)
heightDifference = screenHeight - dm.heightPixels
return heightDifference
end
syso(getBottomKeyboardHeight())
iApp一本通