本文整理汇总了Java中com.zhihu.matisse.engine.impl.PicassoEngine类的典型用法代码示例。如果您正苦于以下问题:Java PicassoEngine类的具体用法?Java PicassoEngine怎么用?Java PicassoEngine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PicassoEngine类属于com.zhihu.matisse.engine.impl包,在下文中一共展示了PicassoEngine类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openGalleryByMatisse
import com.zhihu.matisse.engine.impl.PicassoEngine; //导入依赖的package包/类
/**
* 通过知乎Matisse类库 打开相册
*
* @param fragment
*/
public void openGalleryByMatisse(Fragment fragment) {
if (fragment == null) {
return;
}
int count = mPhotoLimitCount - mSelectPhotoAdapter.getBodyCount();
Matisse.from(fragment)
.choose(MimeType.allOf())
.theme(R.style.Matisse_Zhihu)
.capture(true)
.captureStrategy(new CaptureStrategy(true, AUTHORITY))
.countable(true)
.maxSelectable(count)
.gridExpectedSize(dip2px(120))
.restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
.thumbnailScale(0.85f)
.imageEngine(new PicassoEngine())
.forResult(mRequestCode);
}
示例2: openGalleryWithoutCapture
import com.zhihu.matisse.engine.impl.PicassoEngine; //导入依赖的package包/类
/**
* 打开相册(不带拍照)
*
* @param fragment
*/
public void openGalleryWithoutCapture(Fragment fragment) {
if (fragment == null) {
return;
}
int count = mPhotoLimitCount - mSelectPhotoAdapter.getBodyCount();
Matisse.from(fragment)
.choose(MimeType.allOf())
.theme(R.style.Matisse_Zhihu)
.capture(false)
.captureStrategy(new CaptureStrategy(true, AUTHORITY))
.countable(true)
.maxSelectable(count)
.gridExpectedSize(dip2px(120))
.restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
.thumbnailScale(0.85f)
.imageEngine(new PicassoEngine())
.forResult(mRequestCode);
}
示例3: openGallery
import com.zhihu.matisse.engine.impl.PicassoEngine; //导入依赖的package包/类
private void openGallery() {
Matisse.from(this)
.choose(MimeType.allOf())
.theme(R.style.Matisse_Zhihu)
.capture(true)
.captureStrategy(new CaptureStrategy(true, "com.sugarya.closet.camera.fileprovider"))
.countable(true)
.maxSelectable(1)
.gridExpectedSize(getResources().getDimensionPixelSize(R.dimen.grid_expected_size))
.restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
.thumbnailScale(0.85f)
.imageEngine(new PicassoEngine())
.forResult(REQUEST_CODE_CHOOSE);
}
示例4: onCreate
import com.zhihu.matisse.engine.impl.PicassoEngine; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_video_offscreen);
mRenderView = $(R.id.render_view);
$(R.id.choose).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Matisse.from(VideoOffscreenActivity.this)
.choose(MimeType.of(MimeType.MP4), false)
.showSingleMediaType(true)
.maxSelectable(1)
.countable(false)
.gridExpectedSize(getResources().getDimensionPixelSize(R.dimen.grid_expected_size))
.restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
.thumbnailScale(0.85f)
.imageEngine(new PicassoEngine())
.forResult(REQUEST_CODE_CHOOSE);
}
});
$(R.id.rotate).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mRenderView.setRotate90Degrees(mRenderView.getRotation90Degrees() + 1);
mRenderView.requestLayout();
}
});
}
示例5: onClick
import com.zhihu.matisse.engine.impl.PicassoEngine; //导入依赖的package包/类
@Override
public void onClick(final View v) {
RxPermissions rxPermissions = new RxPermissions(this);
rxPermissions.request(Manifest.permission.WRITE_EXTERNAL_STORAGE)
.subscribe(new Observer<Boolean>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(Boolean aBoolean) {
if (aBoolean) {
switch (v.getId()) {
case R.id.zhihu:
Matisse.from(SampleActivity.this)
.choose(MimeType.ofAll(), false)
.countable(true)
.capture(true)
.captureStrategy(
new CaptureStrategy(true, "com.zhihu.matisse.sample.fileprovider"))
.maxSelectable(9)
.addFilter(new GifSizeFilter(320, 320, 5 * Filter.K * Filter.K))
.gridExpectedSize(
getResources().getDimensionPixelSize(R.dimen.grid_expected_size))
.restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
.thumbnailScale(0.85f)
.imageEngine(new GlideEngine())
.forResult(REQUEST_CODE_CHOOSE);
break;
case R.id.dracula:
Matisse.from(SampleActivity.this)
.choose(MimeType.ofImage())
.theme(R.style.Matisse_Dracula)
.countable(false)
.maxSelectable(9)
.imageEngine(new PicassoEngine())
.forResult(REQUEST_CODE_CHOOSE);
break;
}
mAdapter.setData(null, null);
} else {
Toast.makeText(SampleActivity.this, R.string.permission_request_denied, Toast.LENGTH_LONG)
.show();
}
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
}
});
}
示例6: onClick
import com.zhihu.matisse.engine.impl.PicassoEngine; //导入依赖的package包/类
@Override
public void onClick(final View v) {
RxPermissions rxPermissions = new RxPermissions(this);
rxPermissions.request(Manifest.permission.WRITE_EXTERNAL_STORAGE)
.subscribe(new Observer<Boolean>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(Boolean aBoolean) {
if (aBoolean) {
switch (v.getId()) {
case R.id.zhihu:
Matisse.from(MatisseDemoActivity.this)
.choose(MimeType.ofAll(), false)
.countable(true)
.capture(true)
.captureStrategy(
new CaptureStrategy(true, getPackageName() + ".fileprovider"))
.maxSelectable(9)
.addFilter(new GifSizeFilter(320, 320, 5 * Filter.K * Filter.K))
.gridExpectedSize(
getResources().getDimensionPixelSize(R.dimen.grid_expected_size))
.restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
.thumbnailScale(0.85f)
.imageEngine(new GlideEngine())
.forResult(REQUEST_CODE_CHOOSE);
break;
case R.id.dracula:
Matisse.from(MatisseDemoActivity.this)
.choose(MimeType.of(MimeType.JPEG,MimeType.PNG))
.theme(R.style.Matisse_Dracula)
.countable(false)
.maxSelectable(1)
.imageEngine(new PicassoEngine())
.forResult(REQUEST_CODE_CHOOSE);
break;
case R.id.custom:
Matisse.from(MatisseDemoActivity.this)
.choose(MimeType.ofImage())
.forResult(REQUEST_CODE_CHOOSE);
break;
default:
break;
}
} else {
Toast.makeText(MatisseDemoActivity.this, R.string.permission_request_denied, Toast.LENGTH_LONG)
.show();
}
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
}
});
}