当前位置: 首页>>代码示例>>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;未经允许,请勿转载。