use of com.seu.magicfilter.widget.MagicCameraView in project MagicCamera by wuhaoyu1990.
the class CameraActivity method initView.
private void initView() {
mFilterLayout = (LinearLayout) findViewById(R.id.layout_filter);
mFilterListView = (RecyclerView) findViewById(R.id.filter_listView);
btn_shutter = (ImageView) findViewById(R.id.btn_camera_shutter);
btn_mode = (ImageView) findViewById(R.id.btn_camera_mode);
findViewById(R.id.btn_camera_filter).setOnClickListener(btn_listener);
findViewById(R.id.btn_camera_closefilter).setOnClickListener(btn_listener);
findViewById(R.id.btn_camera_shutter).setOnClickListener(btn_listener);
findViewById(R.id.btn_camera_switch).setOnClickListener(btn_listener);
findViewById(R.id.btn_camera_mode).setOnClickListener(btn_listener);
findViewById(R.id.btn_camera_beauty).setOnClickListener(btn_listener);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
mFilterListView.setLayoutManager(linearLayoutManager);
mAdapter = new FilterAdapter(this, types);
mFilterListView.setAdapter(mAdapter);
mAdapter.setOnFilterChangeListener(onFilterChangeListener);
animator = ObjectAnimator.ofFloat(btn_shutter, "rotation", 0, 360);
animator.setDuration(500);
animator.setRepeatCount(ValueAnimator.INFINITE);
Point screenSize = new Point();
getWindowManager().getDefaultDisplay().getSize(screenSize);
MagicCameraView cameraView = (MagicCameraView) findViewById(R.id.glsurfaceview_camera);
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) cameraView.getLayoutParams();
params.width = screenSize.x;
params.height = screenSize.x * 4 / 3;
cameraView.setLayoutParams(params);
}
Aggregations