Search in sources :

Example 1 with FilterAdapter

use of com.seu.magiccamera.adapter.FilterAdapter 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);
}
Also used : MagicCameraView(com.seu.magicfilter.widget.MagicCameraView) RelativeLayout(android.widget.RelativeLayout) FilterAdapter(com.seu.magiccamera.adapter.FilterAdapter) Point(android.graphics.Point) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Aggregations

Point (android.graphics.Point)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RelativeLayout (android.widget.RelativeLayout)1 FilterAdapter (com.seu.magiccamera.adapter.FilterAdapter)1 MagicCameraView (com.seu.magicfilter.widget.MagicCameraView)1