use of com.stickercamera.app.model.PhotoItem in project StickerCamera by Skykai521.
the class CameraActivity method initView.
private void initView() {
SurfaceHolder surfaceHolder = surfaceView.getHolder();
surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
surfaceHolder.setKeepScreenOn(true);
surfaceView.setFocusable(true);
surfaceView.setBackgroundColor(TRIM_MEMORY_BACKGROUND);
//为SurfaceView的句柄添加一个回调函数
surfaceView.getHolder().addCallback(new SurfaceCallback());
//设置相机界面,照片列表,以及拍照布局的高度(保证相机预览为正方形)
ViewGroup.LayoutParams layout = cameraGrid.getLayoutParams();
layout.height = App.getApp().getScreenWidth();
layout = photoArea.getLayoutParams();
layout.height = DistanceUtil.getCameraPhotoAreaHeight();
layout = takePhotoPanel.getLayoutParams();
layout.height = App.getApp().getScreenHeight() - App.getApp().getScreenWidth() - DistanceUtil.getCameraPhotoAreaHeight();
//添加系统相册内的图片
ArrayList<PhotoItem> sysPhotos = FileUtils.getInst().findPicsInDir(FileUtils.getInst().getSystemPhotoPath());
int showNumber = sysPhotos.size() > photoNumber ? photoNumber : sysPhotos.size();
for (int i = 0; i < showNumber; i++) {
addPhoto(sysPhotos.get(showNumber - 1 - i));
}
}
Aggregations