SurfaceView setVisibility - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for SurfaceView setVisibility method.

This code example shows how to use the following methods:getHolder, setVisibility, setLayoutParams
 
        // start preview 
//        if (useTexture()) { 
//            mTextureView.setVisibility(View.VISIBLE); 
//        } else { 
            surfaceView.setVisibility(View.VISIBLE);
//        } 
    } 
 
    public void onResume() { 
        Log.v(TAG, "onResume.");
        paused = false;
 
        // Open the camera 
        if (camera == null) {
            openCamera(); 
            if (camera == null) {
                showCameraErrorAndFinish(); 
                return; 
            } 

6
CodeRank
This code example shows how to use the following methods:setVisibility, setMediaController, setVideoURI, start
 
  } 
 
  private void handleCameraVideo(Intent intent) {
    mVideoUri = intent.getData();
    mVideoView.setVideoURI(mVideoUri);
    mImageBitmap = null;
    mVideoView.setVisibility(View.VISIBLE);
    mVideoView.setMediaController(new MediaController(this)) ;
    mVideoView.start();
    mImageView.setVisibility(View.INVISIBLE);
  } 
 
  Button.OnClickListener mTakePicOnClickListener = 
    new Button.OnClickListener() { 
    @Override 
    public void onClick(View v) { 
      dispatchTakePictureIntent(ACTION_TAKE_PHOTO_B); 
    } 
  }; 
6
CodeRank
This code example shows how to use the following methods:setVisibility, setVideoURI, start
			case VIDEO_RESULT:
				 
				if (resultCode == RESULT_OK)
				{ 
					Log.v("RESULTS","HERE");
					videoView.setVisibility(View.VISIBLE);
					//videoView.setVideoPath(videoFilePath); 
					videoView.setVideoURI(videoFileUri);
					videoView.start();
				} 
				break;     
		} 
    } 
 
 
} 
	 
     
 
 
5
CodeRank
This code example shows how to use the following methods:setVisibility, stopPlayback
    public void stopVideo() { 
        if ((mVideoView != null)) {
            if (LOCAL_LOGV) {
                Log.v(TAG, "Stopping video playback.");
            } 
            mVideoView.stopPlayback();
        } 
    } 
 
    public void pauseVideo() { 
        if (mVideoView != null) {
            if (LOCAL_LOGV) {
                Log.v(TAG, "Pausing video playback.");
            } 
            mVideoView.pause();
        } 
    } 
 
    public void seekVideo(int seekTo) {
        if (mVideoView != null) {

5
CodeRank
This code example shows how to use the following methods:setVisibility, setVideoURI, start
	} 
 
	@Override 
	public void filmIsInserted(Film film) {
		if(ConnectionBroadcastHelper.hasValidConnection(getApplicationContext())){
			mVideoView.setVideoURI(Uri.parse(film.getLink()));
			mVideoView.start();
			mVideoView.setVisibility(View.VISIBLE);
			staticView.setVisibility(View.INVISIBLE);	
		}else{ 
			Toast.makeText(getApplicationContext(), "No Connectivity", Toast.LENGTH_SHORT).show();
		} 
		 
	} 
 
} 
5
CodeRank
This code example shows how to use the following methods:getHolder, setVisibility
5
CodeRank
This code example shows how to use the following methods:setVisibility, setOnPreparedListener, setVideoURI
    { 
        if(mVideoView != null && !TextUtils.isEmpty(mVideoThemeUrl))
        { 
            android.net.Uri.Builder builder = new android.net.Uri.Builder();
            builder.path(mVideoThemeUrl);
            mVideoView.setVisibility(0);
            mVideoView.setVideoURI(builder.build());
            mVideoView.setOnPreparedListener(this);
        } 
    } 
 
    protected void onLayout(boolean flag, int i, int j, int k, int l)
    { 
        int i1 = getMeasuredWidth();
        int j1 = (int)((float)i1 / 3.36F);
        mThemeImageView.layout(0, 0, i1, j1);
        if(mVideoView != null)
            mVideoView.layout(0, 0, i1, j1);
        int k1 = sPadding;
        int l1 = j1 - sAvatarOverlap;
5
CodeRank
This code example shows how to use the following methods:setVisibility, setVideoURI, start
        mWelcomeImageView.setImageResource(R.raw.setup_welcome_image);
        mWelcomeImageView.setVisibility(View.VISIBLE);
    } 
 
    private void showAndStartWelcomeVideo() { 
        mWelcomeVideoView.setVisibility(View.VISIBLE);
        mWelcomeVideoView.setVideoURI(mWelcomeVideoUri);
        mWelcomeVideoView.start();
    } 
 
    private void hideAndStopWelcomeVideo() { 
        mWelcomeVideoView.stopPlayback();
        mWelcomeVideoView.setVisibility(View.GONE);
    } 
 
    @Override 
    protected void onPause() { 
        hideAndStopWelcomeVideo(); 
        super.onPause(); 
    } 
5
CodeRank
This code example shows how to use the following methods:setVisibility, setVideoURI
	@Override 
	protected void onRestoreInstanceState(Bundle savedInstanceState) {
		super.onRestoreInstanceState(savedInstanceState);
		 
		mVideoUri = savedInstanceState.getParcelable(VIDEO_STORAGE_KEY);
		mVideoView.setVideoURI(mVideoUri);
		mVideoView.setVisibility(
				savedInstanceState.getBoolean(VIDEOVIEW_VISIBILITY_STORAGE_KEY) ? 
						ImageView.VISIBLE : ImageView.INVISIBLE
		); 
	} 
 
	/** 
	 * Indicates whether the specified action can be used as an intent. This 
	 * method queries the package manager for installed packages that can 
	 * respond to an intent with the specified action. If no suitable package is 
	 * found, this method returns false. 
	 * http://android-developers.blogspot.com/2009/01/can-i-use-this-intent.html 
	 * 
	 * @param context The application's environment. 
4
CodeRank
This code example shows how to use the following methods:setVisibility, setVideoURI
		startActivityForResult(takeVideoIntent, ACTION_TAKE_VIDEO);
	} 
 
	private void handleCameraVideo(Intent intent) {
		mVideoUri = intent.getData();
		mVideoView.setVideoURI(mVideoUri);
 
		mVideoView.setVisibility(View.VISIBLE);
	} 
 
	Button.OnClickListener mTakeVidOnClickListener = 
			new Button.OnClickListener() { 
		public void onClick(View v) { 
			dispatchTakeVideoIntent(); 
		} 
	}; 
 
	/** Called when the activity is first created. */ 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
4
CodeRank

Related SurfaceView setVisibility Questions & Answers:

Other SurfaceView setVisibility Examples

196:			try {
197:				// hide video preview
198:				videoPreview.setVisibility(View.GONE);
199:	
200:				imgPreview.setVisibility(View.VISIBLE);
-
224:				imgPreview.setVisibility(View.GONE);
225:	
226:				videoPreview.setVisibility(View.VISIBLE);
227:				videoPreview.setVideoPath(fileUri.getPath());
228:				// start playing

Read More

setVisibility Method Overview
Set the enabled state of this view.
See Code Examples for other Android SurfaceView Methods: