我坚持android方法FloatMath.floor API没有问题

我坚持android方法FloatMath.floor API没有问题,android,android-studio,window,floor,Android,Android Studio,Window,Floor,方法: 输出: 错误:(116,39)错误:找不到符号方法层(float) 任何一个解决这个问题的方法?FloatMath实用程序类都不推荐使用。改用Math.floor。FloatMath和getScale()都不推荐使用。请使用以下代码 @Override protected boolean isReadyForPullEnd() { @SuppressWarnings("deprecation") float exactContentHeight = FloatMath.f

方法:

输出:
错误:(116,39)错误:找不到符号方法层(float)


任何一个解决这个问题的方法?

FloatMath实用程序类都不推荐使用。改用Math.floor。

FloatMath和getScale()都不推荐使用。请使用以下代码

@Override
protected boolean isReadyForPullEnd() {
    @SuppressWarnings("deprecation")
    float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale());
    return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight());
}

不仅仅是反对“在版本23中,所有方法都从公共API中删除了。”当我将其转换为“Math.floor”时,它会说“需要不兼容的类型:float-Found:double”我该怎么办?@AphikritGerbertSaravasri将其转换为float,如下所示。float exactContentHeight=Math.floor((float)mRefreshableView.getContentHeight()*mRefreshableView.getScale());更多详细信息-注意:某些输入文件使用或覆盖不推荐的API。-注意:有关详细信息,请使用-Xlint:deprecation重新编译。
double exactContentHeight = Math.floor(mRefreshableView.getContentHeight() * getResources().getDisplayMetrics().density);