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


Java MimeType类代码示例

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


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

示例1: openGalleryByMatisse

import com.zhihu.matisse.MimeType; //导入依赖的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.MimeType; //导入依赖的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.MimeType; //导入依赖的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: isImage

import com.zhihu.matisse.MimeType; //导入依赖的package包/类
public boolean isImage() {
    if (mimeType == null) return false;
    return mimeType.equals(MimeType.JPEG.toString())
            || mimeType.equals(MimeType.PNG.toString())
            || mimeType.equals(MimeType.GIF.toString())
            || mimeType.equals(MimeType.BMP.toString())
            || mimeType.equals(MimeType.WEBP.toString());
}
 
开发者ID:sathishmscict,项目名称:Matisse-Image-and-Video-Selector,代码行数:9,代码来源:Item.java

示例5: isVideo

import com.zhihu.matisse.MimeType; //导入依赖的package包/类
public boolean isVideo() {
    if (mimeType == null) return false;
    return mimeType.equals(MimeType.MPEG.toString())
            || mimeType.equals(MimeType.MP4.toString())
            || mimeType.equals(MimeType.QUICKTIME.toString())
            || mimeType.equals(MimeType.THREEGPP.toString())
            || mimeType.equals(MimeType.THREEGPP2.toString())
            || mimeType.equals(MimeType.MKV.toString())
            || mimeType.equals(MimeType.WEBM.toString())
            || mimeType.equals(MimeType.TS.toString())
            || mimeType.equals(MimeType.AVI.toString());
}
 
开发者ID:sathishmscict,项目名称:Matisse-Image-and-Video-Selector,代码行数:13,代码来源:Item.java

示例6: isSelectableType

import com.zhihu.matisse.MimeType; //导入依赖的package包/类
private static boolean isSelectableType(Context context, Item item) {
    if (context == null) {
        return false;
    }

    ContentResolver resolver = context.getContentResolver();
    for (MimeType type : SelectionSpec.getInstance().mimeTypeSet) {
        if (type.checkType(resolver, item.getContentUri())) {
            return true;
        }
    }
    return false;
}
 
开发者ID:sathishmscict,项目名称:Matisse-Image-and-Video-Selector,代码行数:14,代码来源:PhotoMetadataUtils.java

示例7: needFiltering

import com.zhihu.matisse.MimeType; //导入依赖的package包/类
/**
 * Whether an {@link Item} need filtering.
 */
protected boolean needFiltering(Context context, Item item) {
    for (MimeType type : constraintTypes()) {
        if (type.checkType(context.getContentResolver(), item.getContentUri())) {
            return true;
        }
    }
    return false;
}
 
开发者ID:sathishmscict,项目名称:Matisse-Image-and-Video-Selector,代码行数:12,代码来源:Filter.java

示例8: openGallery

import com.zhihu.matisse.MimeType; //导入依赖的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

示例9: doSomething

import com.zhihu.matisse.MimeType; //导入依赖的package包/类
private void doSomething() {
    Matisse.from(MainActivity.this)
            .choose(MimeType.allOf())
            .countable(true)
            .maxSelectable(2000)
            .addFilter(new GifSizeFilter(320, 320, 5 * Filter.K * Filter.K))
            .gridExpectedSize(getResources().getDimensionPixelSize(R.dimen.grid_expected_size))
            .restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
            .thumbnailScale(0.85f)
            .imageEngine(new GlideEngine())
            .forResult(REQUEST_CODE_CHOOSE);
}
 
开发者ID:hiliving,项目名称:P2Video-master,代码行数:13,代码来源:MainActivity.java

示例10: selectImages

import com.zhihu.matisse.MimeType; //导入依赖的package包/类
@Override
public void selectImages() {
    Matisse.from(this)
            .choose(MimeType.of(MimeType.JPEG, MimeType.PNG))
            .countable(true)
            .maxSelectable(4 - uriList.size())
            .restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
            .thumbnailScale(0.80f)
            .imageEngine(new GlideEngine())
            .forResult(REQUEST_CODE_CHOOSE);
}
 
开发者ID:NICOLITE,项目名称:HutHelper,代码行数:12,代码来源:CreateLostAndFoundActivity.java

示例11: changeAvatar

import com.zhihu.matisse.MimeType; //导入依赖的package包/类
@Override
public void changeAvatar() {
    Matisse.from(this)
            .choose(MimeType.of(MimeType.JPEG, MimeType.PNG))
            .countable(true)
            .maxSelectable(1)
            .restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
            .thumbnailScale(0.85f)
            .imageEngine(new GlideEngine())
            .forResult(REQUEST_CODE_CHOOSE);
}
 
开发者ID:NICOLITE,项目名称:HutHelper,代码行数:12,代码来源:UserInfoActivity.java

示例12: toGallery

import com.zhihu.matisse.MimeType; //导入依赖的package包/类
private void toGallery() {
    Matisse.from(PubDynamicActivity.this)
            .choose(MimeType.allOf())
            .countable(true)
            .maxSelectable(9)
            .restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
            .thumbnailScale(0.85f)
            .imageEngine(new GlideEngine())
            .forResult(REQUEST_CODE_CHOOSE);
}
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:11,代码来源:PubDynamicActivity.java

示例13: onCreate

import com.zhihu.matisse.MimeType; //导入依赖的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();
        }
    });
}
 
开发者ID:uestccokey,项目名称:EZFilter,代码行数:31,代码来源:VideoOffscreenActivity.java

示例14: openAlbum

import com.zhihu.matisse.MimeType; //导入依赖的package包/类
private void openAlbum() {
    Matisse.from(this)
            .choose(MimeType.allOf())
            .countable(true)
            .maxSelectable(5)
            .thumbnailScale(0.5f)
            .imageEngine(new GlideEngine())
            .theme(R.style.Matisse_Dracula)
            .forResult(REQUEST_CODE_ALBUM);
}
 
开发者ID:Dobbbby,项目名称:Mediator,代码行数:11,代码来源:MainActivity.java

示例15: upImg

import com.zhihu.matisse.MimeType; //导入依赖的package包/类
private void upImg() {
    mTranslateBtn.setOnClickListener(v -> Matisse.from(TranslateActivity.this)
            .choose(MimeType.allOf())
            .countable(true)
            .maxSelectable(1)
            .restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
            .thumbnailScale(0.85f)
            .imageEngine(new GlideEngine())
            .forResult(REQUEST_CODE_CHOOSE));
}
 
开发者ID:sdwfqin,项目名称:AndroidSamples,代码行数:11,代码来源:TranslateActivity.java


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