本文整理汇总了Java中android.view.View.SYSTEM_UI_FLAG_FULLSCREEN属性的典型用法代码示例。如果您正苦于以下问题:Java View.SYSTEM_UI_FLAG_FULLSCREEN属性的具体用法?Java View.SYSTEM_UI_FLAG_FULLSCREEN怎么用?Java View.SYSTEM_UI_FLAG_FULLSCREEN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.view.View
的用法示例。
在下文中一共展示了View.SYSTEM_UI_FLAG_FULLSCREEN属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if(Build.VERSION.SDK_INT < 16){
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
}else {
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
}
setContentView(R.layout.activity_picture_show);
Intent intent = getIntent();
pictureWebUrl = intent.getStringExtra(PICTUREURL);
pictureId = pictureWebUrl.substring(pictureWebUrl.lastIndexOf("/") + 1);
progressBar = (ProgressBar) findViewById(R.id.pb_progress);
getPictureUrl();
}
示例2: onCreate
@Override
protected void onCreate(Bundle savedInstanceState) {
ActivityCompat.setExitSharedElementCallback(this, exitTransitionCallback);
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_gallery);
ButterKnife.bind(this);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
ArrayList<String> imagesList = new ArrayList<>();
for (int i = 1; i <= 23; i++)
imagesList.add("http://ssninstincts.org.in/img/gallery/big/" + i + ".jpg");
galleryAdapter = new GalleryAdapter(this, imagesList);
StaggeredGridLayoutManager gridLayoutManager =
new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
gridLayoutManager.setGapStrategy(StaggeredGridLayoutManager.GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS);
galleryRecyclerView.setHasFixedSize(true);
galleryRecyclerView.setLayoutManager(gridLayoutManager);
galleryRecyclerView.setAdapter(galleryAdapter);
}
示例3: onCreate
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
decorView.setSystemUiVisibility(uiOptions);
ActionBar actionBar = getActionBar();
if (null != actionBar) actionBar.hide();
ButterKnife.bind(this);
FirebaseAuth auth = FirebaseAuth.getInstance();
if (auth.getCurrentUser() != null) {
showWhiteSnackBar(R.string.sign_in_successful);
googleLoginButton.setVisibility(View.INVISIBLE);
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
}
}
示例4: setImmersive
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void setImmersive() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
return;
}
int newUiOptions = getWindow().getDecorView().getSystemUiVisibility();
// Navigation bar hiding: Backwards compatible to ICS.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
newUiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
}
// Status bar hiding: Backwards compatible to Jellybean
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
newUiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
}
getWindow().getDecorView().setSystemUiVisibility(newUiOptions);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
setImmersive(true);
}
}
示例5: hideStatusBar
/**
* 隐藏状态栏
* <p>
* 在setContentView前调用
*/
protected void hideStatusBar() {
final int sdkVer = Build.VERSION.SDK_INT;
if (sdkVer < 16) {
//4.0及一下
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
} else {
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
ActionBar actionBar = getActionBar();
if (actionBar != null) {
actionBar.hide();
}
}
}
示例6: 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);
}
}
示例7: enterFullScreen
private void enterFullScreen() {
if(mToolbar == null || rootView == null || bottomView == null) return;
//bottomView.setVisibility(View.GONE);
int flag = View.SYSTEM_UI_FLAG_LOW_PROFILE;
if(ApiHelper.HAS_VIEW_SYSTEM_UI_FLAG_LAYOUT_STABLE)
flag = View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
mToolbar.setVisibility(View.INVISIBLE);
rootView.setSystemUiVisibility(flag);
fullScreen = true;
}
示例8: onSystemUiVisibilityChange
@Override
public void onSystemUiVisibilityChange(int i) {
if ((i & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
toggleToolbar(true);
} else {
// The system bars are NOT visible.
}
}
示例9: getSystemUiVisibility
@TargetApi(19)
private static int getSystemUiVisibility() {
int flags = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
flags |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
}
return flags;
}
示例10: fullscreen
private void fullscreen() {
View decorView = getWindow().getDecorView();
// Hide the status bar.
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
// Remember that you should never show the action bar if the
// status bar is hidden, so hide that too if necessary.
// ActionBar actionBar = getActionBar();
// actionBar.hide();
}
示例11: hideStatusBar
private void hideStatusBar() {
// If the Android version is lower than Jellybean, use this call to hide
// the status bar.
if (Build.VERSION.SDK_INT < 16) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
//Hide the Status Bar on Android 4.1 and Higher
View decorView = getWindow().getDecorView();
// Hide the status bar.
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
}
示例12: onCreate
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (BuildConfig.BACK_BUTTON_QUITS) {
createQuitDialog();
}
mSystemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
mSystemUiVisibility |= View.SYSTEM_UI_FLAG_FULLSCREEN;
mSystemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
mSystemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
mSystemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
mSystemUiVisibility |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
}
}
mPlayer = PlayerHelper.create(this);
mPlayer.setKeepScreenOn();
setContentView(mPlayer.getView());
if (!addBootstrapInterface(mPlayer)) {
Uri.Builder projectURIBuilder = Uri.fromFile(new File(getString(R.string.mv_project_index))).buildUpon();
Bootstrapper.appendQuery(projectURIBuilder, getString(R.string.query_noaudio));
if (BuildConfig.SHOW_FPS) {
Bootstrapper.appendQuery(projectURIBuilder, getString(R.string.query_showfps));
}
mPlayer.loadUrl(projectURIBuilder.build().toString());
}
}
示例13: onCreate
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
decorView.setSystemUiVisibility(uiOptions);
ActionBar actionBar = getActionBar();
if (null != actionBar) actionBar.hide();
mBottomBar.setOnTabSelectListener(
new OnTabSelectListener() {
@Override
public void onTabSelected(@IdRes int tabId) {
Fragment fragment;
switch (tabId) {
case R.id.bot_bar_today:
fragment = new TodayTasksFragment();
break;
case R.id.bot_bar_list:
fragment = new ListTasksFragment();
break;
case R.id.bot_bar_more:
fragment = new MoreInfoFragment();
break;
default:
fragment = new TodayTasksFragment();
}
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction ft = fragmentManager.beginTransaction();
ft.replace(R.id.flContent, fragment, fragment.getClass().getName());
ft.commit();
}
});
}
示例14: 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;
}
示例15: hideStatusbar
public static void hideStatusbar(Activity context) {
if (Build.VERSION.SDK_INT < 16) {
context.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
} else {
View decorView = context.getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
}
}