本文整理匯總了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);