Java Code Examples for android.view.SurfaceView#setOnClickListener()

The following examples show how to use android.view.SurfaceView#setOnClickListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SurfaceGrabberActivity.java    From CameraV with GNU General Public License v3.0 6 votes vote down vote up
@SuppressWarnings("deprecation")
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(getLayout());

	button = (Button) findViewById(R.id.surface_grabber_button);
	button.setOnClickListener(this);
	
	progress = (TextView) findViewById(R.id.surface_grabber_progress);
	progress.setText(String.valueOf(baseImages.size()));

	view = (SurfaceView) findViewById(R.id.surface_grabber_holder);
	view.setOnClickListener(this);
	
	holder = view.getHolder();
	holder.addCallback(this);
	holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);		
}
 
Example 2
Source File: BarcodeScanCameraActivity.java    From android-opensource-library-56 with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    requestWindowFeature(Window.FEATURE_NO_TITLE);

    mSurfaceView = new SurfaceView(this);
    mSurfaceView.setOnClickListener(this);
    setContentView(mSurfaceView);
}
 
Example 3
Source File: CameraBaseActivity.java    From CameraV with GNU General Public License v3.0 2 votes vote down vote up
@SuppressWarnings("deprecation")
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	View decorView = getWindow().getDecorView();
	int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
	decorView.setSystemUiVisibility(uiOptions);
			
	setContentView(getLayout());
	
	mIsSelfie = getIntent().getBooleanExtra("selfie", false);

	button = (Button) findViewById(R.id.surface_grabber_button);
	button.setOnClickListener(this);
	
	buttonSelfie = (Button)findViewById(R.id.selfie_button);
	buttonSelfie.setOnClickListener(new OnClickListener()
	{

		@Override
		public void onClick(View v) {
			toggleCamera();
			
		}
		
	});
	
	progress = (TextView) findViewById(R.id.surface_grabber_progress);
	view = (SurfaceView) findViewById(R.id.surface_grabber_holder);
	overlayView = findViewById(R.id.overlay_view);
        
	  
	holder = view.getHolder();
	holder.addCallback(this);
	holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
	
	view.setOnClickListener(this);
			
	view.setOnTouchListener(this);
	
}