當前位置: 首頁>>代碼示例>>Java>>正文


Java CameraConfiguration.MediaAction方法代碼示例

本文整理匯總了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;
}
 
開發者ID:sandrios,項目名稱:sandriosCamera,代碼行數:26,代碼來源:CameraHelper.java

示例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();
}
 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:9,代碼來源:RecordButton.java

示例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);
}
 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:10,代碼來源:PreviewActivity.java

示例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);
    }
 
開發者ID:sandrios,項目名稱:sandriosCamera,代碼行數:16,代碼來源:RecordButton.java

示例5: getMediaAction

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入方法依賴的package包/類
@CameraConfiguration.MediaAction
int getMediaAction();
 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:3,代碼來源:CameraController.java

示例6: updateUiForMediaAction

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入方法依賴的package包/類
@Override
public void updateUiForMediaAction(@CameraConfiguration.MediaAction int mediaAction) {

}
 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:5,代碼來源:BaseSandriosActivity.java

示例7: updateUiForMediaAction

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入方法依賴的package包/類
void updateUiForMediaAction(@CameraConfiguration.MediaAction int mediaAction); 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:2,代碼來源:CameraView.java


注:本文中的com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration.MediaAction方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。