本文整理匯總了Java中android.view.View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION屬性的典型用法代碼示例。如果您正苦於以下問題:Java View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION屬性的具體用法?Java View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION怎麽用?Java View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.view.View
的用法示例。
在下文中一共展示了View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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;
}
示例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: 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);
}
}
示例4: hideSystemUI
private void hideSystemUI(View view) {
if (view == null) return;
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
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;
view.setSystemUiVisibility(uiOptions);
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例5: toggleHideyBar
public static void toggleHideyBar(Activity activity, boolean onResume) {
int newUiOptions = activity.getWindow().getDecorView().getSystemUiVisibility();
if (onResume) {
applyImmersiveMode(activity);
} else {
newUiOptions ^= View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
newUiOptions ^= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
newUiOptions ^= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
newUiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
newUiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;
newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE;
newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
activity.getWindow().getDecorView().setSystemUiVisibility(newUiOptions);
}
}
示例6: 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;
}
示例7: 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;
}
}
示例8: hideBar
/**
* Hide bar.
* 隱藏或顯示狀態欄和導航欄。 狀態欄和導航欄的顏色不起作用,都是透明色,以最後一次調用為準
*
* @param uiFlags the ui flags
* @return the int
*/
private int hideBar(int uiFlags) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
switch (mBarParams.barHide) {
case FLAG_HIDE_BAR:
uiFlags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.INVISIBLE;
break;
case FLAG_HIDE_STATUS_BAR:
uiFlags |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.INVISIBLE;
break;
case FLAG_HIDE_NAVIGATION_BAR:
uiFlags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
break;
case FLAG_SHOW_BAR:
uiFlags |= View.SYSTEM_UI_FLAG_VISIBLE;
break;
}
}
return uiFlags | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
}
示例9: toggleFullscreenMode
public void toggleFullscreenMode(boolean isFullscreen) {
View decorView = getWindow().getDecorView();
if (isFullscreen) {
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;
decorView.setSystemUiVisibility(uiOptions);
}
}
示例10: setUiVisibilityKitKat
@TargetApi(Build.VERSION_CODES.KITKAT)
private void setUiVisibilityKitKat(boolean isVisible) {
int flags = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
if (!isVisible) {
flags |= View.SYSTEM_UI_FLAG_LOW_PROFILE
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_IMMERSIVE;
}
viewPager.setSystemUiVisibility(flags);
}
示例11: setUpViewForFullscreen
private void setUpViewForFullscreen() {
if (isFullscreenLayout() && !isMultipaneLayout()) {
View decorView = getWindow().getDecorView();
int uiOptions = decorView.getSystemUiVisibility();
uiOptions ^= View.SYSTEM_UI_FLAG_LOW_PROFILE;
uiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;
uiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
uiOptions ^= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
uiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
uiOptions ^= View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
decorView.setSystemUiVisibility(uiOptions);
}
}
示例12: hideSystemUi
private void hideSystemUi() {
oldVisibility = getActivity().getWindow().getDecorView().getSystemUiVisibility();
int visibility =
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) visibility |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
getActivity().getWindow().getDecorView().setSystemUiVisibility(visibility);
}
示例13: initBarAboveLOLLIPOP
/**
* 初始化android 5.0以上狀態欄和導航欄
*
* @param uiFlags the ui flags
* @return the int
*/
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
private int initBarAboveLOLLIPOP(int uiFlags) {
uiFlags |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; //Activity全屏顯示,但狀態欄不會被隱藏覆蓋,狀態欄依然可見,Activity頂端布局部分會被狀態欄遮住。
if (mBarParams.fullScreen) {
uiFlags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION; //Activity全屏顯示,但導航欄不會被隱藏覆蓋,導航欄依然可見,Activity底部布局部分會被導航欄遮住。
}
mWindow.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); //需要設置這個才能設置狀態欄顏色
mWindow.setStatusBarColor(ColorUtils.blendARGB(mBarParams.statusBarColor,
mBarParams.statusBarColorTransform, mBarParams.statusBarAlpha)); //設置狀態欄顏色
mWindow.setNavigationBarColor(ColorUtils.blendARGB(mBarParams.navigationBarColor,
mBarParams.navigationBarColorTransform, mBarParams.navigationBarAlpha)); //設置導航欄顏色
return uiFlags;
}
示例14: 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);
}
示例15: onCreate
@Override
protected void onCreate(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_home);
ButterKnife.bind(this);
new LocalJSONSource(this);
new RemoteJSONSource(this);
DisplayMetrics displayMetrics = this.getResources().getDisplayMetrics();
logo.bringToFront();
List<Map.Entry<String, Integer>> entries = new ArrayList<>(6);
for (int i = 0; i < 6; i++) {
Map.Entry<String, Integer> entry = new AbstractMap.SimpleEntry<>("", 0x0);
entries.add(entry);
}
wheelView.setWheelRadius(displayMetrics.widthPixels / 2);
wheelView.setWheelItemRadius(displayMetrics.widthPixels / 6);
wheelView.setOnWheelItemClickListener(new WheelView.OnWheelItemClickListener() {
@Override
public void onWheelItemClick(WheelView parent, int position, boolean isSelected) {
switch (position) {
case 0:
startActivity(new Intent(HomeActivity.this, SponsorsActivity.class));
break;
case 1:
startActivity(new Intent(HomeActivity.this, GalleryActivity.class));
break;
case 2:
startActivity(new Intent(HomeActivity.this, HospitalityActivity.class));
break;
case 3:
if (firebaseUser == null)
startActivity(new Intent(HomeActivity.this, LoginActivity.class));
else
startActivity(new Intent(HomeActivity.this, ProfileActivity.class));
break;
case 4:
startActivity(new Intent(HomeActivity.this, EventsActivity.class));
break;
case 5:
startActivity(new Intent(HomeActivity.this, ScheduleActivity.class));
break;
}
}
});
wheelView.setAdapter(new WheelAdapter(entries));
moveClouds();
spinArrow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
wheelView.setSelected(ThreadLocalRandom.current().nextInt(0, 5 + 1));
}
});
AppUpdater appUpdater = new AppUpdater(this);
appUpdater.setUpdateFrom(UpdateFrom.GITHUB)
.setGitHubUserAndRepo("adithya321", "Instincts")
.start();
}