本文整理汇总了Java中com.netease.nim.uikit.common.util.C类的典型用法代码示例。如果您正苦于以下问题:Java C类的具体用法?Java C怎么用?Java C使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
C类属于com.netease.nim.uikit.common.util包,在下文中一共展示了C类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkVideoFile
import com.netease.nim.uikit.common.util.C; //导入依赖的package包/类
/**
* 检查文件
* @param file 视频文件
* @return boolean
*/
private boolean checkVideoFile(String file) {
if (!AttachmentStore.isFileExist(file)) {
return false;
}
if (new File(file).length() > C.MAX_LOCAL_VIDEO_FILE_SIZE) {
Toast.makeText(activity, R.string.im_choose_video_file_size_too_large, Toast.LENGTH_SHORT).show();
return false;
}
if (!StorageUtil.isInvalidVideoFile(file)) {
Toast.makeText(activity, R.string.im_choose_video, Toast.LENGTH_SHORT).show();
return false;
}
return true;
}
示例2: checkVideoFile
import com.netease.nim.uikit.common.util.C; //导入依赖的package包/类
/**
* 检查文件
*
* @param file 视频文件
* @return boolean
*/
private boolean checkVideoFile(String file) {
if (!AttachmentStore.isFileExist(file)) {
return false;
}
if (new File(file).length() > C.MAX_LOCAL_VIDEO_FILE_SIZE) {
Toast.makeText(activity, R.string.im_choose_video_file_size_too_large, Toast.LENGTH_SHORT).show();
return false;
}
if (!StorageUtil.isInvalidVideoFile(file)) {
Toast.makeText(activity, R.string.im_choose_video, Toast.LENGTH_SHORT).show();
return false;
}
return true;
}
示例3: chooseVideoFromCamera
import com.netease.nim.uikit.common.util.C; //导入依赖的package包/类
/**
* 拍摄视频
*/
protected void chooseVideoFromCamera() {
if (!StorageUtil.hasEnoughSpaceForWrite(activity,
StorageType.TYPE_VIDEO, true)) {
return;
}
videoFilePath = StorageUtil.getWritePath(
activity, StringUtil.get36UUID()
+ C.FileSuffix.MP4, StorageType.TYPE_TEMP);
videoFile = new File(videoFilePath);
// 启动视频录制
CaptureVideoActivity.start(activity, videoFilePath, captureRequestCode);
}
示例4: chooseVideoFromLocalBeforeKitKat
import com.netease.nim.uikit.common.util.C; //导入依赖的package包/类
/**
* API19 之前选择视频
*/
protected void chooseVideoFromLocalBeforeKitKat() {
Intent mIntent = new Intent(Intent.ACTION_GET_CONTENT);
mIntent.setType(C.MimeType.MIME_VIDEO_ALL);
mIntent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
try {
activity.startActivityForResult(mIntent, localRequestCode);
} catch (ActivityNotFoundException e) {
Toast.makeText(activity, R.string.gallery_invalid, Toast.LENGTH_SHORT).show();
}
}
示例5: savePicture
import com.netease.nim.uikit.common.util.C; //导入依赖的package包/类
public void savePicture() {
ImageAttachment attachment = (ImageAttachment) message.getAttachment();
String path = attachment.getPath();
if (TextUtils.isEmpty(path)) {
return;
}
String srcFilename = attachment.getFileName();
//默认jpg
String extension = TextUtils.isEmpty(attachment.getExtension()) ? "jpg" : attachment.getExtension();
srcFilename += ("." + extension);
String picPath = StorageUtil.getSystemImagePath();
String dstPath = picPath + srcFilename;
if (AttachmentStore.copy(path, dstPath) != -1) {
try {
ContentValues values = new ContentValues(2);
values.put(MediaStore.Images.Media.MIME_TYPE, C.MimeType.MIME_JPEG);
values.put(MediaStore.Images.Media.DATA, dstPath);
getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
Toast.makeText(WatchMessagePictureActivity.this, getString(R.string.picture_save_to), Toast.LENGTH_LONG).show();
} catch (Exception e) {
// may be java.lang.UnsupportedOperationException
Toast.makeText(WatchMessagePictureActivity.this, getString(R.string.picture_save_fail), Toast.LENGTH_LONG).show();
}
} else {
Toast.makeText(WatchMessagePictureActivity.this, getString(R.string.picture_save_fail), Toast.LENGTH_LONG).show();
}
}