本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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());
}
示例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());
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
});
}
示例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);
}
示例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));
}