android 设置全屏

@SuppressWarnings("deprecation")
 @TargetApi(Build.VERSION_CODES.JELLY_BEAN) 
private void showSystemUi(boolean visible) {    
 //if (!ApiHelper.HAS_VIEW_SYSTEM_UI_FLAG_LAYOUT_STABLE) return;     
if (!hasField(View.class, "SYSTEM_UI_FLAG_LAYOUT_STABLE")) return;   
  int flag =  View.SYSTEM_UI_FLAG_IMMERSIVE              | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION              | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN;
Log.d(TAG, "new setSystem UiVisibility " + flag);   
  if (!MainActivity.mFactoryMode && mFullScreen) {     
    mVideoView.setSystemUiVisibility(flag);        
 mRootView.setSystemUiVisibility(flag);    
 } else if (!MainActivity.mFactoryMode) {    
     flag =  View.SYSTEM_UI_FLAG_IMMERSIVE               
  | View.SYSTEM_UI_FLAG_FULLSCREEN                
 |View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;       
  mVideoView.setSystemUiVisibility(flag);       
  mRootView.setSystemUiVisibility(flag);    
 } else {      
   //Log.d(TAG,"&&&&&&&&&&&");       
  mVideoView.setSystemUiVisibility(0);    
     mRootView.setSystemUiVisibility(0); 
    }
 }

你可能感兴趣的:(android代码类)