• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TileSource类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.android.photos.views.TiledImageRenderer.TileSource的典型用法代码示例。如果您正苦于以下问题:Java TileSource类的具体用法?Java TileSource怎么用?Java TileSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TileSource类属于com.android.photos.views.TiledImageRenderer包,在下文中一共展示了TileSource类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onClick

import com.android.photos.views.TiledImageRenderer.TileSource; //导入依赖的package包/类
@Override
public void onClick(final WallpaperPickerActivity a) {
    a.setWallpaperButtonEnabled(false);
    final BitmapRegionTileSource.ResourceBitmapSource bitmapSource =
            new BitmapRegionTileSource.ResourceBitmapSource(mResources, mResId);
    a.setCropViewTileSource(bitmapSource, false, false, new CropViewScaleProvider() {

        @Override
        public float getScale(TileSource src) {
            Point wallpaperSize = WallpaperUtils.getDefaultWallpaperSize(
                    a.getResources(), a.getWindowManager());
            RectF crop = Utils.getMaxCropRect(
                    src.getImageWidth(), src.getImageHeight(),
                    wallpaperSize.x, wallpaperSize.y, false);
            return wallpaperSize.x / crop.width();
        }
    }, new Runnable() {

        @Override
        public void run() {
            if (bitmapSource.getLoadingState() == BitmapSource.State.LOADED) {
                a.setWallpaperButtonEnabled(true);
            }
        }
    });
}
 
开发者ID:Mr-lin930819,项目名称:SimplOS,代码行数:27,代码来源:WallpaperPickerActivity.java


示例2: onLoadRequestComplete

import com.android.photos.views.TiledImageRenderer.TileSource; //导入依赖的package包/类
protected void onLoadRequestComplete(LoadRequest req, boolean success) {
    mCurrentLoadRequest = null;
    if (success) {
        TileSource oldSrc = mCropView.getTileSource();
        mCropView.setTileSource(req.result, null);
        mCropView.setTouchEnabled(req.touchEnabled);
        if (req.moveToLeft) {
            mCropView.moveToLeft();
        }
        if (req.scaleProvider != null) {
            mCropView.setScale(req.scaleProvider.getScale(req.result));
        }

        // Free last image
        if (oldSrc != null) {
            // Call yield instead of recycle, as we only want to free GL resource.
            // We can still reuse the bitmap for decoding any other image.
            oldSrc.getPreview().yield();
        }
        addReusableBitmap(oldSrc);
    }
    if (req.postExecute != null) {
        req.postExecute.run();
    }
    mProgressView.setVisibility(View.GONE);
}
 
开发者ID:Mr-lin930819,项目名称:SimplOS,代码行数:27,代码来源:WallpaperCropActivity.java


示例3: onLoadRequestComplete

import com.android.photos.views.TiledImageRenderer.TileSource; //导入依赖的package包/类
protected void onLoadRequestComplete(LoadRequest req, boolean success) {
    mCurrentLoadRequest = null;
    if (success) {
        TileSource oldSrc = mCropView.getTileSource();
        mCropView.setTileSource(req.result, null);
        mCropView.setTouchEnabled(req.touchEnabled);
        if (req.moveToLeft) {
            mCropView.moveToLeft();
        }
        if (req.scaleAndOffsetProvider != null) {
            req.scaleAndOffsetProvider.updateCropView(this, req.result);
        }

        // Free last image
        if (oldSrc != null) {
            // Call yield instead of recycle, as we only want to free GL resource.
            // We can still reuse the bitmap for decoding any other image.
            oldSrc.getPreview().yield();
        }
        addReusableBitmap(oldSrc);
    }
    if (req.postExecute != null) {
        req.postExecute.run();
    }
    mProgressView.setVisibility(View.GONE);
}
 
开发者ID:RunasSudo,项目名称:FLauncher,代码行数:27,代码来源:WallpaperCropActivity.java


示例4: updateCropView

import com.android.photos.views.TiledImageRenderer.TileSource; //导入依赖的package包/类
public void updateCropView(WallpaperCropActivity a, TileSource src) {
    Point wallpaperSize = WallpaperUtils.getDefaultWallpaperSize(
            a.getResources(), a.getWindowManager());
    RectF crop = Utils.getMaxCropRect(src.getImageWidth(), src.getImageHeight(),
            wallpaperSize.x, wallpaperSize.y, false /* leftAligned */);

    float scale = getScale(wallpaperSize, crop);
    PointF center = a.mCropView.getCenter();

    // Offsets wallpaper preview according to the state it will be displayed in upon
    // returning home. Offset ranges from 0 to 1, where 0 is the leftmost parallax and
    // 1 is the rightmost.
    // Make sure the offset is in the correct range.
    float offset = Math.max(0, Math.min(getParallaxOffset(), 1));
    float screenWidth = a.mCropView.getWidth() / scale;
    center.x = screenWidth / 2 + offset * (crop.width() - screenWidth) + crop.left;
    a.mCropView.setScaleAndCenter(scale, center.x, center.y);
}
 
开发者ID:RunasSudo,项目名称:FLauncher,代码行数:19,代码来源:WallpaperCropActivity.java


示例5: setTileSource

import com.android.photos.views.TiledImageRenderer.TileSource; //导入依赖的package包/类
public void setTileSource(TileSource source, Runnable isReadyCallback) {
    super.setTileSource(source, isReadyCallback);
    mCenterX = mRenderer.centerX;
    mCenterY = mRenderer.centerY;
    mRotateMatrix.reset();
    mRotateMatrix.setRotate(mRenderer.rotation);
    mInverseRotateMatrix.reset();
    mInverseRotateMatrix.setRotate(-mRenderer.rotation);
    updateMinScale(getWidth(), getHeight(), source, true);
}
 
开发者ID:Mr-lin930819,项目名称:SimplOS,代码行数:11,代码来源:CropView.java


示例6: updateMinScale

import com.android.photos.views.TiledImageRenderer.TileSource; //导入依赖的package包/类
private void updateMinScale(int w, int h, TileSource source, boolean resetScale) {
    synchronized (mLock) {
        if (resetScale) {
            mRenderer.scale = 1;
        }
        if (source != null) {
            final float[] imageDims = getImageDims();
            final float imageWidth = imageDims[0];
            final float imageHeight = imageDims[1];
            mMinScale = Math.max(w / imageWidth, h / imageHeight);
            mRenderer.scale =
                    Math.max(mMinScale, resetScale ? Float.MIN_VALUE : mRenderer.scale);
        }
    }
}
 
开发者ID:Mr-lin930819,项目名称:SimplOS,代码行数:16,代码来源:CropView.java


示例7: addReusableBitmap

import com.android.photos.views.TiledImageRenderer.TileSource; //导入依赖的package包/类
@Thunk void addReusableBitmap(TileSource src) {
    synchronized (mReusableBitmaps) {
        if (Utilities.ATLEAST_KITKAT && src instanceof BitmapRegionTileSource) {
            Bitmap preview = ((BitmapRegionTileSource) src).getBitmap();
            if (preview != null && preview.isMutable()) {
                mReusableBitmaps.add(preview);
            }
        }
    }
}
 
开发者ID:Mr-lin930819,项目名称:SimplOS,代码行数:11,代码来源:WallpaperCropActivity.java


示例8: setTileSource

import com.android.photos.views.TiledImageRenderer.TileSource; //导入依赖的package包/类
public void setTileSource(TileSource source, Runnable isReadyCallback) {
    synchronized (mLock) {
        mRenderer.source = source;
        mRenderer.isReadyCallback = isReadyCallback;
        mRenderer.centerX = source != null ? source.getImageWidth() / 2 : 0;
        mRenderer.centerY = source != null ? source.getImageHeight() / 2 : 0;
        mRenderer.rotation = source != null ? source.getRotation() : 0;
        mRenderer.scale = 0;
        updateScaleIfNecessaryLocked(mRenderer);
    }
    invalidate();
}
 
开发者ID:Mr-lin930819,项目名称:SimplOS,代码行数:13,代码来源:TiledImageView.java


示例9: setTileSource

import com.android.photos.views.TiledImageRenderer.TileSource; //导入依赖的package包/类
public void setTileSource(TileSource source, Runnable isReadyCallback) {
    if (!IS_SUPPORTED) {
        return;
    }
    synchronized (mLock) {
        mRenderer.source = source;
        mRenderer.isReadyCallback = isReadyCallback;
        mRenderer.centerX = source != null ? source.getImageWidth() / 2 : 0;
        mRenderer.centerY = source != null ? source.getImageHeight() / 2 : 0;
        mRenderer.rotation = source != null ? source.getRotation() : 0;
        mRenderer.scale = 0;
        updateScaleIfNecessaryLocked(mRenderer);
    }
    invalidate();
}
 
开发者ID:Phonemetra,项目名称:TurboLauncher,代码行数:16,代码来源:TiledImageView.java


示例10: getCropViewScaleAndOffsetProvider

import com.android.photos.views.TiledImageRenderer.TileSource; //导入依赖的package包/类
@Override
protected CropViewScaleAndOffsetProvider getCropViewScaleAndOffsetProvider() {
    if (mExtras != null) {
        return new CropViewScaleAndOffsetProvider() {
            @Override
            public void updateCropView(WallpaperCropActivity a, TileSource src) {
                a.mCropView.setScaleAndCenter(mExtras[0], mExtras[1], mExtras[2]);
            }
        };
    }
    return null;
}
 
开发者ID:RunasSudo,项目名称:FLauncher,代码行数:13,代码来源:SavedWallpaperImages.java


示例11: getTileSource

import com.android.photos.views.TiledImageRenderer.TileSource; //导入依赖的package包/类
public TileSource getTileSource() {
    return mRenderer.source;
}
 
开发者ID:Mr-lin930819,项目名称:SimplOS,代码行数:4,代码来源:TiledImageView.java


示例12: getScale

import com.android.photos.views.TiledImageRenderer.TileSource; //导入依赖的package包/类
float getScale(TileSource src); 
开发者ID:Mr-lin930819,项目名称:SimplOS,代码行数:2,代码来源:WallpaperCropActivity.java



注:本文中的com.android.photos.views.TiledImageRenderer.TileSource类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Connect类代码示例发布时间:2022-05-22
下一篇:
Java AsyncParser类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap