当前位置: 首页>>代码示例>>Java>>正文


Java BitmapRegionTileSource.UriBitmapSource方法代码示例

本文整理汇总了Java中com.android.photos.BitmapRegionTileSource.UriBitmapSource方法的典型用法代码示例。如果您正苦于以下问题:Java BitmapRegionTileSource.UriBitmapSource方法的具体用法?Java BitmapRegionTileSource.UriBitmapSource怎么用?Java BitmapRegionTileSource.UriBitmapSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.android.photos.BitmapRegionTileSource的用法示例。


在下文中一共展示了BitmapRegionTileSource.UriBitmapSource方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onClick

import com.android.photos.BitmapRegionTileSource; //导入方法依赖的package包/类
@Override
public void onClick(final WallpaperPickerActivity a) {
    a.setWallpaperButtonEnabled(false);
    final BitmapRegionTileSource.UriBitmapSource bitmapSource =
            new BitmapRegionTileSource.UriBitmapSource(a.getContext(), mUri);
    a.setCropViewTileSource(bitmapSource, true, false, null, new Runnable() {

        @Override
        public void run() {
            if (bitmapSource.getLoadingState() == BitmapSource.State.LOADED) {
                a.selectTile(mView);
                a.setWallpaperButtonEnabled(true);
            } else {
                ViewGroup parent = (ViewGroup) mView.getParent();
                if (parent != null) {
                    parent.removeView(mView);
                    Toast.makeText(a.getContext(), R.string.image_load_fail,
                            Toast.LENGTH_SHORT).show();
                }
            }
        }
    });
}
 
开发者ID:TeamBrainStorm,项目名称:SimpleUILauncher,代码行数:24,代码来源:WallpaperPickerActivity.java

示例2: onClick

import com.android.photos.BitmapRegionTileSource; //导入方法依赖的package包/类
@Override
public void onClick(final WallpaperPickerActivity a) {
    final Runnable onLoad;
    if (!mFirstClick) {
        onLoad = null;
    } else {
        mFirstClick = false;
        a.mSetWallpaperButton.setEnabled(false);
        onLoad = new Runnable() {
            public void run() {
                if (mBitmapSource != null &&
                        mBitmapSource.getLoadingState() == BitmapSource.State.LOADED) {
                    a.selectTile(mView);
                    a.mSetWallpaperButton.setEnabled(true);
                } else {
                    ViewGroup parent = (ViewGroup) mView.getParent();
                    if (parent != null) {
                        parent.removeView(mView);
                        Toast.makeText(a,
                                a.getString(R.string.image_load_fail),
                                Toast.LENGTH_SHORT).show();
                    }
                }
            }
        };
    }
    mBitmapSource = new BitmapRegionTileSource.UriBitmapSource(
            a, mUri, BitmapRegionTileSource.MAX_PREVIEW_SIZE);
    a.setCropViewTileSource(mBitmapSource, true, false, onLoad);
}
 
开发者ID:Phonemetra,项目名称:TurboLauncher,代码行数:31,代码来源:WallpaperPickerActivity.java

示例3: init

import com.android.photos.BitmapRegionTileSource; //导入方法依赖的package包/类
protected void init() {
    setContentView(R.layout.wallpaper_cropper);

    mCropView = (CropView) findViewById(R.id.cropView);
    mProgressView = findViewById(R.id.loading);

    Intent cropIntent = getIntent();
    final Uri imageUri = cropIntent.getData();

    if (imageUri == null) {
        Log.e(LOGTAG, "No URI passed in intent, exiting WallpaperCropActivity");
        finish();
        return;
    }

    // Action bar
    // Show the custom action bar view
    final ActionBar actionBar = getActionBar();
    actionBar.setCustomView(R.layout.actionbar_set_wallpaper);
    actionBar.getCustomView().setOnClickListener(
            new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    boolean finishActivityWhenDone = true;
                    cropImageAndSetWallpaper(imageUri, null, finishActivityWhenDone);
                }
            });
    mSetWallpaperButton = findViewById(R.id.set_wallpaper_button);

    // Load image in background
    final BitmapRegionTileSource.UriBitmapSource bitmapSource =
            new BitmapRegionTileSource.UriBitmapSource(getContext(), imageUri);
    mSetWallpaperButton.setEnabled(false);
    Runnable onLoad = new Runnable() {
        public void run() {
            if (bitmapSource.getLoadingState() != BitmapSource.State.LOADED) {
                Toast.makeText(getContext(), R.string.wallpaper_load_fail,
                        Toast.LENGTH_LONG).show();
                finish();
            } else {
                mSetWallpaperButton.setEnabled(true);
            }
        }
    };
    setCropViewTileSource(bitmapSource, true, false, null, onLoad);
}
 
开发者ID:Mr-lin930819,项目名称:SimplOS,代码行数:47,代码来源:WallpaperCropActivity.java

示例4: init

import com.android.photos.BitmapRegionTileSource; //导入方法依赖的package包/类
protected void init() {
    setContentView(R.layout.wallpaper_cropper);

    mCropView = (CropView) findViewById(R.id.cropView);

    Intent cropIntent = getIntent();
    final Uri imageUri = cropIntent.getData();

    if (imageUri == null) {
        Log.e(LOGTAG, "No URI passed in intent, exiting WallpaperCropActivity");
        finish();
        return;
    }

    // Action bar
    // Show the custom action bar view
    final ActionBar actionBar = getActionBar();
    actionBar.setCustomView(R.layout.actionbar_set_wallpaper);
    actionBar.getCustomView().setOnClickListener(
            new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    boolean finishActivityWhenDone = true;
                    cropImageAndSetWallpaper(imageUri, null, finishActivityWhenDone);
                }
            });
    mSetWallpaperButton = findViewById(R.id.set_wallpaper_button);

    // Load image in background
    final BitmapRegionTileSource.UriBitmapSource bitmapSource =
            new BitmapRegionTileSource.UriBitmapSource(this, imageUri, 1024);
    mSetWallpaperButton.setEnabled(false);
    Runnable onLoad = new Runnable() {
        public void run() {
            if (bitmapSource.getLoadingState() != BitmapSource.State.LOADED) {
                Toast.makeText(WallpaperCropActivity.this,
                        getString(R.string.wallpaper_load_fail),
                        Toast.LENGTH_LONG).show();
                finish();
            } else {
                mSetWallpaperButton.setEnabled(true);
            }
        }
    };
    setCropViewTileSource(bitmapSource, true, false, onLoad);
}
 
开发者ID:Phonemetra,项目名称:TurboLauncher,代码行数:47,代码来源:WallpaperCropActivity.java

示例5: init

import com.android.photos.BitmapRegionTileSource; //导入方法依赖的package包/类
protected void init() {
    setContentView(R.layout.wallpaper_cropper);

    mCropView = (CropView) findViewById(R.id.cropView);
    mProgressView = findViewById(R.id.loading);

    Intent cropIntent = getIntent();
    final Uri imageUri = cropIntent.getData();

    if (imageUri == null) {
        Log.e(LOGTAG, "No URI passed in intent, exiting WallpaperCropActivity");
        finish();
        return;
    }

    // Action bar
    // Show the custom action bar view
    final ActionBar actionBar = getActionBar();
    actionBar.setCustomView(R.layout.actionbar_set_wallpaper);
    actionBar.getCustomView().setOnClickListener(
            new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    actionBar.hide();
                    boolean finishActivityWhenDone = true;
                    // Never fade on finish because we return to the app that started us (e.g.
                    // Photos), not the home screen.
                    boolean shouldFadeOutOnFinish = false;
                    cropImageAndSetWallpaper(imageUri, null, finishActivityWhenDone,
                            shouldFadeOutOnFinish);
                }
            });
    mSetWallpaperButton = findViewById(R.id.set_wallpaper_button);

    // Load image in background
    final BitmapRegionTileSource.UriBitmapSource bitmapSource =
            new BitmapRegionTileSource.UriBitmapSource(getContext(), imageUri);
    mSetWallpaperButton.setEnabled(false);
    Runnable onLoad = new Runnable() {
        public void run() {
            if (bitmapSource.getLoadingState() != BitmapSource.State.LOADED) {
                Toast.makeText(getContext(), R.string.wallpaper_load_fail,
                        Toast.LENGTH_LONG).show();
                finish();
            } else {
                mSetWallpaperButton.setEnabled(true);
            }
        }
    };
    setCropViewTileSource(bitmapSource, true, false, null, onLoad);
}
 
开发者ID:RunasSudo,项目名称:FLauncher,代码行数:52,代码来源:WallpaperCropActivity.java


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