當前位置: 首頁>>代碼示例>>Java>>正文


Java View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN屬性代碼示例

本文整理匯總了Java中android.view.View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN屬性的典型用法代碼示例。如果您正苦於以下問題:Java View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN屬性的具體用法?Java View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN怎麽用?Java View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.view.View的用法示例。


在下文中一共展示了View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: processM

@TargetApi(Build.VERSION_CODES.M)
private void processM() {

  if (current < Build.VERSION_CODES.M) {
    return;
  }
  int flag = window.getDecorView().getSystemUiVisibility();
  if (lightStatusBar) {
    /**
     * 改變字體顏色
     * see {@link <a href="https://developer.android.com/reference/android/R.attr.html#windowLightStatusBar"></a>}
     */
    flag |= (WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
        | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
    window.setStatusBarColor(Color.TRANSPARENT);
  }
  if (transparentStatusBar) {
    flag |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
    window.setStatusBarColor(Color.TRANSPARENT);
  }
  if (transparentNavigationbar) {
    flag |= (View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
    window.setNavigationBarColor(Color.TRANSPARENT);
  }
  window.getDecorView().setSystemUiVisibility(flag);
}
 
開發者ID:MUFCRyan,項目名稱:BilibiliClient,代碼行數:26,代碼來源:StatusBarUtil.java

示例2: createHideFlags

@Override
protected int createHideFlags() {
    int flag = super.createHideFlags();

    if (mLevel >= SystemUiHelper.LEVEL_HIDE_STATUS_BAR) {
        flag |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                | View.SYSTEM_UI_FLAG_FULLSCREEN;

        if (mLevel >= SystemUiHelper.LEVEL_LEAN_BACK) {
            flag |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
        }
    }

    return flag;
}
 
開發者ID:h4h13,項目名稱:RetroMusicPlayer,代碼行數:16,代碼來源:SystemUiHelperImplJB.java

示例3: getFullscreenUiFlags

private int getFullscreenUiFlags() {
    int flags = View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;

    flags |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_FULLSCREEN
            | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;

    return flags;
}
 
開發者ID:maddog05,項目名稱:whatanime-android,代碼行數:11,代碼來源:VideoPreviewActivity.java

示例4: onCreate

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    changeTheme((String) SPUtils.get(this, AppConfig.choose_theme, AppConfig.DEFAULT_COLOR));
    super.onCreate(savedInstanceState);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        WindowManager.LayoutParams localLayoutParams = getWindow().getAttributes();
        localLayoutParams.flags = (WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | localLayoutParams.flags);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            View decorView = getWindow().getDecorView();
            int option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
            decorView.setSystemUiVisibility(option);
        }
    }
}
 
開發者ID:lanyuanxiaoyao,項目名稱:PicKing,代碼行數:16,代碼來源:BaseActivity.java

示例5: SystemUiHiderHoneycomb

/**
 * Constructor not intended to be called by clients. Use
 * {@link SystemUiHider#getInstance} to obtain an instance.
 */
protected SystemUiHiderHoneycomb(Activity activity, View anchorView, int flags) {
	super(activity, anchorView, flags);

	mShowFlags = View.SYSTEM_UI_FLAG_VISIBLE;
	mHideFlags = View.SYSTEM_UI_FLAG_LOW_PROFILE;
	mTestFlags = View.SYSTEM_UI_FLAG_LOW_PROFILE;

	if ((mFlags & FLAG_FULLSCREEN) != 0) {
		// If the client requested fullscreen, add flags relevant to hiding
		// the status bar. Note that some of these constants are new as of
		// API 16 (Jelly Bean). It is safe to use them, as they are inlined
		// at compile-time and do nothing on pre-Jelly Bean devices.
		mShowFlags |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
		mHideFlags |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_FULLSCREEN;
	}

	if ((mFlags & FLAG_HIDE_NAVIGATION) != 0) {
		// If the client requested hiding navigation, add relevant flags.
		mShowFlags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
		mHideFlags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
		mTestFlags |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
	}
}
 
開發者ID:joaomneto,項目名稱:TitanCompanion,代碼行數:27,代碼來源:SystemUiHiderHoneycomb.java

示例6: tintStatusBarForDrawer

/**
 * Android4.4以上的狀態欄著色(針對於DrawerLayout)
 * 注:
 * 1.如果出現界麵展示不正確,刪除布局中所有fitsSystemWindows屬性,尤其是DrawerLayout的fitsSystemWindows屬性
 * 2.可以版本判斷在5.0以上不調用該方法,使用係統自帶
 *
 * @param activity Activity對象
 * @param drawerLayout DrawerLayout對象
 * @param statusBarColor 狀態欄顏色
 * @param alpha 透明欄透明度[0.0-1.0]
 */
public static void tintStatusBarForDrawer(Activity activity, DrawerLayout drawerLayout,
                                          @ColorInt int statusBarColor,
                                          @FloatRange(from = 0.0, to = 1.0) float alpha) {

  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
    return;
  }

  Window window = activity.getWindow();
  ViewGroup decorView = (ViewGroup) window.getDecorView();
  ViewGroup drawContent = (ViewGroup) drawerLayout.getChildAt(0);

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
    window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
    window.setStatusBarColor(Color.TRANSPARENT);
    drawerLayout.setStatusBarBackgroundColor(statusBarColor);

    int systemUiVisibility = window.getDecorView().getSystemUiVisibility();
    systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
    systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
    window.getDecorView().setSystemUiVisibility(systemUiVisibility);
  } else {
    window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
  }

  setStatusBar(decorView, statusBarColor, true, true);
  setTranslucentView(decorView, alpha);

  drawerLayout.setFitsSystemWindows(false);
  drawContent.setFitsSystemWindows(true);
  ViewGroup drawer = (ViewGroup) drawerLayout.getChildAt(1);
  drawer.setFitsSystemWindows(false);
}
 
開發者ID:MUFCRyan,項目名稱:BilibiliClient,代碼行數:45,代碼來源:SystemBarHelper.java

示例7: onStart

@Override
protected void onStart() {
    super.onStart();
    if ((getWindow().getDecorView().getSystemUiVisibility() & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) == 0) {
        ThemeColorManager.addActivityStatusBar(this);
    }

}
 
開發者ID:hyb1996,項目名稱:Auto.js,代碼行數:8,代碼來源:BaseActivity.java

示例8: onWindowFocusChanged

/**
 * Called when view focus is changed
 */
@Override
public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);
    if (hasFocus && immersiveMode) {
        final int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                | View.SYSTEM_UI_FLAG_FULLSCREEN
                | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;

        getWindow().getDecorView().setSystemUiVisibility(uiOptions);
    }
}
 
開發者ID:SUTFutureCoder,項目名稱:localcloud_fe,代碼行數:17,代碼來源:CordovaActivity.java

示例9: saveSystemVisibility

void saveSystemVisibility(Activity activity) {
    // If we are in fullscreen we may have also have hidden the system UI. This
    // is overridden when we display the dialog. Save the system UI visibility
    // state so we can restore it.
    FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
    mSystemVisibility = decor.getSystemUiVisibility();
    mRestoreSystemVisibility = (
            (mSystemVisibility & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) != 0);
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:9,代碼來源:MediaRouteControllerDialogFactory.java

示例10: setFullScreen

private void setFullScreen() {
	try {
		if (Build.VERSION.SDK_INT < 19) {
			getWindow().setFlags(
					WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER,
					WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER
			);
		} else {
			View decorView = getWindow().getDecorView();

			int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
					| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
					| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
					| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
					| View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
					| View.SYSTEM_UI_FLAG_IMMERSIVE;

			decorView.setSystemUiVisibility(uiOptions);

			getWindow().setFlags(
					WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER,
					WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER
			);
		}
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
開發者ID:alescdb,項目名稱:LauncherTV,代碼行數:28,代碼來源:Launcher.java

示例11: setStatusBar

/**
 * 設置狀態欄顏色
 */
private void setStatusBar() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        View decorView = getWindow().getDecorView();
        int option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
        decorView.setSystemUiVisibility(option);
        getWindow().setStatusBarColor(getResources().getColor(R.color.colorPrimary));
    }else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
    }
}
 
開發者ID:miguoer,項目名稱:ApplicationCollention,代碼行數:13,代碼來源:TopbarActivity.java

示例12: restoreSystemVisibility

void restoreSystemVisibility(Activity activity) {
    if (!mWasFullscreenBeforeShowing) return;

    FrameLayout decor = (FrameLayout) activity.getWindow().getDecorView();
    // In some cases we come out of fullscreen before closing this dialog. In these
    // cases we don't want to restore the system UI visibility state.
    boolean isStillFullscreen =
            (decor.getSystemUiVisibility() & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) == 0;
    if (!isStillFullscreen) return;

    decor.setSystemUiVisibility(mSystemVisibilityToRestore);
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:12,代碼來源:BaseMediaRouteDialogManager.java

示例13: _setImmersiveMode

@TargetApi(19)
private void _setImmersiveMode(){
	//if (true) return;
	int vis = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
			| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
			| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
			| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
			| View.SYSTEM_UI_FLAG_FULLSCREEN
			| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
	if (mGLView.getSystemUiVisibility() != vis){
		//screenMessage("FORCING IMMERSIVE");
		mGLView.setSystemUiVisibility(vis);
	}
}
 
開發者ID:efroemling,項目名稱:bombsquad-remote-android,代碼行數:14,代碼來源:GamePadActivity.java

示例14: onCreate

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    ActivityCompat.postponeEnterTransition(this);
    ActivityCompat.setEnterSharedElementCallback(this, enterTransitionCallback);

    int mUIFlag = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            | View.SYSTEM_UI_FLAG_LOW_PROFILE
            | View.SYSTEM_UI_FLAG_FULLSCREEN
            | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;

    getWindow().getDecorView().setSystemUiVisibility(mUIFlag);

    setContentView(R.layout.activity_view_pager_gallery);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setTitle("Gallery");
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    galleryViewPagerAdapter = new GalleryViewPagerAdapter(this);

    viewPager = (ViewPager) findViewById(R.id.container);
    viewPager.setAdapter(galleryViewPagerAdapter);

    int position = selectedIndex = getIntent().getIntExtra(EXTRA_POSITION, 0);
    viewPager.setCurrentItem(position);
    viewPager.setOnPageChangeListener(pageChangeListener);
    viewPager.getViewTreeObserver().addOnGlobalLayoutListener(pagerLayoutListener);
}
 
開發者ID:adithya321,項目名稱:Instincts-2k17,代碼行數:33,代碼來源:GalleryViewPagerActivity.java

示例15: onCreate

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    int mUIFlag = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            | View.SYSTEM_UI_FLAG_LOW_PROFILE
            | View.SYSTEM_UI_FLAG_FULLSCREEN
            | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;

    getWindow().getDecorView().setSystemUiVisibility(mUIFlag);

    setContentView(R.layout.activity_splash);
    ButterKnife.bind(this);

    DisplayMetrics displayMetrics = this.getResources().getDisplayMetrics();
    spinArrow.setTranslationX(-2000);
    wheelView.setTranslationX(2000);
    wheelView.setWheelRadius(displayMetrics.widthPixels / 2);
    wheelView.setWheelItemRadius(displayMetrics.widthPixels / 6);

    new Handler().postDelayed(new Runnable() {
        @Override
        public void run() {
            startSecondActivity();
        }
    }, 1000);
}
 
開發者ID:adithya321,項目名稱:Instincts-2k17,代碼行數:29,代碼來源:SplashActivity.java


注:本文中的android.view.View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。