本文整理汇总了Java中com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration.MediaAction方法的典型用法代码示例。如果您正苦于以下问题:Java CameraConfiguration.MediaAction方法的具体用法?Java CameraConfiguration.MediaAction怎么用?Java CameraConfiguration.MediaAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration
的用法示例。
在下文中一共展示了CameraConfiguration.MediaAction方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOutputMediaFile
import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //导入方法依赖的package包/类
public static File getOutputMediaFile(Context context, @CameraConfiguration.MediaAction int mediaAction) {
File mediaStorageDir = context.getFilesDir();
if (!mediaStorageDir.exists()) {
if (!mediaStorageDir.mkdirs()) {
Log.d(TAG, "Failed to create directory.");
return null;
}
}
String timeStamp = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss", Locale.ENGLISH)
.format(new Date());
File mediaFile;
if (mediaAction == CameraConfiguration.MEDIA_ACTION_PHOTO) {
mediaFile = new File(mediaStorageDir.getPath() + File.separator +
"IMG_" + timeStamp + ".jpg");
} else if (mediaAction == CameraConfiguration.MEDIA_ACTION_VIDEO) {
mediaFile = new File(mediaStorageDir.getPath() + File.separator +
"VID_" + timeStamp + ".mp4");
} else {
return null;
}
return mediaFile;
}
示例2: setMediaAction
import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //导入方法依赖的package包/类
public void setMediaAction(@CameraConfiguration.MediaAction int mediaAction) {
this.mediaAction = mediaAction;
if (CameraConfiguration.MEDIA_ACTION_PHOTO == mediaAction)
currentState = TAKE_PHOTO_STATE;
else currentState = READY_FOR_RECORD_STATE;
setRecordState(currentState);
setIcon();
}
示例3: newIntent
import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //导入方法依赖的package包/类
public static Intent newIntent(Context context,
@CameraConfiguration.MediaAction int mediaAction,
String filePath, boolean showImageCrop) {
return new Intent(context, PreviewActivity.class)
.putExtra(MEDIA_ACTION_ARG, mediaAction)
.putExtra(SHOW_CROP, showImageCrop)
.putExtra(FILE_PATH_ARG, filePath);
}
示例4: setup
import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //导入方法依赖的package包/类
public void setup(@CameraConfiguration.MediaAction int mediaAction, @NonNull RecordButtonListener listener) {
setMediaAction(mediaAction);
this.listener = listener;
// setBackground(ContextCompat.getDrawable(context, R.drawable.circle_frame_background_dark));
if (Build.VERSION.SDK_INT > 15)
setBackground(ContextCompat.getDrawable(context, R.drawable.circle_frame_background));
else
setBackgroundDrawable(ContextCompat.getDrawable(context, R.drawable.circle_frame_background));
setIcon();
setOnClickListener(new RecordClickListener());
setSoundEffectsEnabled(false);
setIconPadding(iconPadding);
}
示例5: getMediaAction
import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //导入方法依赖的package包/类
@CameraConfiguration.MediaAction
int getMediaAction();
示例6: updateUiForMediaAction
import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //导入方法依赖的package包/类
@Override
public void updateUiForMediaAction(@CameraConfiguration.MediaAction int mediaAction) {
}
示例7: updateUiForMediaAction
import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //导入方法依赖的package包/类
void updateUiForMediaAction(@CameraConfiguration.MediaAction int mediaAction);