android.util.FloatMath#floor ( )源码实例Demo

下面列出了android.util.FloatMath#floor ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: android-open-project-demo   文件: BitmapUtils.java
public static Bitmap getSampledBitmap(String filePath, int reqWidth, int reqHeight) {		
	Options options = new Options();
	options.inJustDecodeBounds = true;
	
	BitmapFactory.decodeFile(filePath, options);
	
	// Raw height and width of image
    final int height = options.outHeight;
    final int width = options.outWidth;
    int inSampleSize = 1;

    if (height > reqHeight || width > reqWidth) {
        if (width > height) {
            inSampleSize = (int)FloatMath.floor(((float)height / reqHeight)+0.5f); //Math.round((float)height / (float)reqHeight);
        } else {
            inSampleSize = (int)FloatMath.floor(((float)width / reqWidth)+0.5f); //Math.round((float)width / (float)reqWidth);
        }
    }
    
    options.inSampleSize = inSampleSize;
    options.inJustDecodeBounds = false;
    	    
    return BitmapFactory.decodeFile(filePath, options);
}
 
源代码2 项目: android-project-wo2b   文件: BitmapUtils.java
public static Bitmap getSampledBitmap(String filePath, int reqWidth, int reqHeight)
{
	Options options = new Options();
	options.inJustDecodeBounds = true;

	BitmapFactory.decodeFile(filePath, options);

	// Raw height and width of image
	final int height = options.outHeight;
	final int width = options.outWidth;
	int inSampleSize = 1;

	if (height > reqHeight || width > reqWidth)
	{
		if (width > height)
		{
            inSampleSize = (int)FloatMath.floor(((float)height / reqHeight)+0.5f); //Math.round((float)height / (float)reqHeight);
		}
		else
		{
            inSampleSize = (int)FloatMath.floor(((float)width / reqWidth)+0.5f); //Math.round((float)width / (float)reqWidth);
		}
	}

	options.inSampleSize = inSampleSize;
	options.inJustDecodeBounds = false;

	return BitmapFactory.decodeFile(filePath, options);
}
 
源代码3 项目: LB-Launcher   文件: BitmapUtils.java
public static int computeSampleSizeLarger(float scale) {
    int initialSize = (int) FloatMath.floor(1f / scale);
    if (initialSize <= 1) return 1;

    return initialSize <= 8
            ? Utils.prevPowerOf2(initialSize)
            : initialSize / 8 * 8;
}
 
public AmbilWarnaPrefWidgetView(Context context, AttributeSet attrs) {
	super(context, attrs);
	
	float density = context.getResources().getDisplayMetrics().density;
	rectSize = FloatMath.floor(24.f * density + 0.5f);
	strokeWidth = FloatMath.floor(1.f * density + 0.5f);

	paint = new Paint();
	paint.setColor(0xffffffff);
	paint.setStyle(Style.STROKE);
	paint.setStrokeWidth(strokeWidth);
}
 
源代码5 项目: Pi-Locker   文件: AmbilWarnaPrefWidgetView.java
public AmbilWarnaPrefWidgetView(Context context, AttributeSet attrs) {
	super(context, attrs);
	
	float density = context.getResources().getDisplayMetrics().density;
	rectSize = FloatMath.floor(24.f * density + 0.5f);
	strokeWidth = FloatMath.floor(1.f * density + 0.5f);

	paint = new Paint();
	paint.setColor(0xffffffff);
	paint.setStyle(Style.STROKE);
	paint.setStrokeWidth(strokeWidth);
}
 
@Override
protected boolean isReadyForPullEnd() {
	float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale());
	return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight());
}
 
@Override
protected boolean isReadyForPullEnd() {
	float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale());
	return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight());
}
 
@Override
protected boolean isReadyForPullEnd() {
	float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale());
	return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight());
}
 
@Override
protected boolean isReadyForPullEnd() {
	float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale());
	return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight());
}
 
源代码10 项目: GifAssistant   文件: PullToRefreshWebView.java
@Override
protected boolean isReadyForPullEnd() {
	float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale());
	return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight());
}
 
@Override
protected boolean isReadyForPullEnd() {
	float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale());
	return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight());
}
 
源代码12 项目: SweetMusicPlayer   文件: PullToRefreshWebView.java
@Override
protected boolean isReadyForPullEnd() {
	float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale());
	return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight());
}
 
源代码13 项目: ONE-Unofficial   文件: PullToRefreshWebView.java
@Override
protected boolean isReadyForPullEnd() {
	float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale());
	return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight());
}
 
源代码14 项目: MiBandDecompiled   文件: PullToRefreshWebView.java
protected boolean isReadyForPullEnd()
{
    float f = FloatMath.floor((float)((WebView)l).getContentHeight() * ((WebView)l).getScale());
    return (float)((WebView)l).getScrollY() >= f - (float)((WebView)l).getHeight();
}
 
@Override
protected void updateTextBounds(final String pCharacterAsString) {
	this.mStrokePaint.getTextBounds(pCharacterAsString, 0, 1, this.mTextBounds);
	final int inset = -(int)FloatMath.floor(this.mStrokeWidth * 0.5f);
	this.mTextBounds.inset(inset, inset);
}
 
@Override
protected boolean isReadyForPullEnd() {
	float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale());
	return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight());
}
 
源代码17 项目: iSCAU-Android   文件: PullToRefreshWebView.java
@Override
protected boolean isReadyForPullEnd() {
	float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale());
	return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight());
}
 
@Override
protected boolean isReadyForPullEnd() {
	float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale());
	return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight());
}
 
@Override
protected boolean isReadyForPullEnd() {
	float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale());
	return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight());
}
 
源代码20 项目: zen4android   文件: PullToRefreshWebView.java
@Override
protected boolean isReadyForPullEnd() {
	float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale());
	return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight());
}