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

Java CaptureStrategy类代码示例

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

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



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

示例1: openGalleryByMatisse

import com.zhihu.matisse.internal.entity.CaptureStrategy; //导入依赖的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);
}
 
开发者ID:Sugarya,项目名称:SugarPhotoPicker,代码行数:24,代码来源:SelectPhotoRecyclerView.java


示例2: openGalleryWithoutCapture

import com.zhihu.matisse.internal.entity.CaptureStrategy; //导入依赖的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);
}
 
开发者ID:Sugarya,项目名称:SugarPhotoPicker,代码行数:24,代码来源:SelectPhotoRecyclerView.java


示例3: matisse

import com.zhihu.matisse.internal.entity.CaptureStrategy; //导入依赖的package包/类
private void matisse() {
    Matisse.from(this)
            .choose(MimeType.ofAll(), false)
            .theme(R.style.Matisse_Zhihu)
            .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);
}
 
开发者ID:Jusenr,项目名称:RX_Demo,代码行数:16,代码来源:MainActivity.java


示例4: openGallery

import com.zhihu.matisse.internal.entity.CaptureStrategy; //导入依赖的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);
}
 
开发者ID:Sugarya,项目名称:Closet,代码行数:15,代码来源:HomeFragment.java


示例5: showImageSelector

import com.zhihu.matisse.internal.entity.CaptureStrategy; //导入依赖的package包/类
protected void showImageSelector() {
    mContentPosition = mEtContent.getSelectionStart();

    Matisse.from(PostFragment.this)
            .choose(MimeType.ofImage())
            .countable(true)
            .maxSelectable(9)
            .restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
            .thumbnailScale(0.85f)
            .imageEngine(new GlideEngine())
            .theme(HiSettingsHelper.getInstance().getImageActivityTheme(getActivity()))
            .capture(ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED)
            .captureStrategy(new CaptureStrategy(false, BuildConfig.APPLICATION_ID + ".provider"))
            .forResult(SELECT_PICTURE);
}
 
开发者ID:GreenSkinMonster,项目名称:hipda,代码行数:16,代码来源:PostFragment.java


示例6: onClick

import com.zhihu.matisse.internal.entity.CaptureStrategy; //导入依赖的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() {

                }
            });
}
 
开发者ID:sathishmscict,项目名称:Matisse-Image-and-Video-Selector,代码行数:59,代码来源:SampleActivity.java


示例7: setCaptureStrategy

import com.zhihu.matisse.internal.entity.CaptureStrategy; //导入依赖的package包/类
public void setCaptureStrategy(CaptureStrategy strategy) {
    mCaptureStrategy = strategy;
}
 
开发者ID:sathishmscict,项目名称:Matisse-Image-and-Video-Selector,代码行数:4,代码来源:MediaStoreCompat.java


示例8: onClick

import com.zhihu.matisse.internal.entity.CaptureStrategy; //导入依赖的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() {

                }
            });
}
 
开发者ID:REBOOTERS,项目名称:AndroidAnimationExercise,代码行数:65,代码来源:MatisseDemoActivity.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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