本文整理汇总了Java中android.app.ActionBar.hide方法的典型用法代码示例。如果您正苦于以下问题:Java ActionBar.hide方法的具体用法?Java ActionBar.hide怎么用?Java ActionBar.hide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.app.ActionBar
的用法示例。
在下文中一共展示了ActionBar.hide方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.app.ActionBar; //导入方法依赖的package包/类
@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();
}
}
示例2: hideStatusBar
import android.app.ActionBar; //导入方法依赖的package包/类
/**
* 隐藏状态栏
* <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();
}
}
}
示例3: onCreate
import android.app.ActionBar; //导入方法依赖的package包/类
@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();
}
});
}
示例4: onCreate
import android.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.d(TAG, "StandaloneDisplayActivity.onCreate()");
super.onCreate(savedInstanceState);
int layout = getLayout();
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
setContentView(layout);
displayLayout = (DisplayLayout) findViewById(R.id.display);
ActionBar ab = getActionBar();
if (ab != null) {
ab.hide();
}
if (!getIntent().getBooleanExtra(EXTRA_MIRROR_DISPLAY, false)) {
mediaRouter = (MediaRouter) getSystemService(MEDIA_ROUTER_SERVICE);
mediaRouter
.addCallback(MediaRouter.ROUTE_TYPE_LIVE_VIDEO, callback);
updatePresentation();
}
displayLayout.go(0, false);
View view = findViewById(R.id.display_attributes);
DisplayInfoHelper.populate(this, view, getWindowManager().getDefaultDisplay());
DisplayInfoHelper.show(view, DURATION);
}
示例5: menuBarsHide
import android.app.ActionBar; //导入方法依赖的package包/类
private void menuBarsHide() {
Log.d(getClass().getName(), "menuBarsHide");
ActionBar actionBar = getActionBar();
if (actionBar == null) {
Log.d(getClass().getName(), "menuBarsHide ActionBar is null");
return;
}
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayShowHomeEnabled(false);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().clearFlags(
WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LOW_PROFILE);
actionBar.hide(); // slides out
}
示例6: onCreate
import android.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_piclocation);
ActionBar actionBar = getActionBar();
if(actionBar!=null)actionBar.hide();
initView();
mMapView.onCreate(savedInstanceState);// 此方法必须重写
initMap();
}
示例7: hideStatusBar
import android.app.ActionBar; //导入方法依赖的package包/类
private void hideStatusBar() {
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();
if (actionBar != null) {
actionBar.hide();
}
}
示例8: hide
import android.app.ActionBar; //导入方法依赖的package包/类
private void hide() {
// Hide UI first
ActionBar actionBar = getActionBar();
if (actionBar != null) {
actionBar.hide();
}
mVisible = false;
// Schedule a runnable to remove the status and navigation bar after a delay
mHideHandler.removeCallbacks(mShowPart2Runnable);
mHideHandler.postDelayed(mHidePart2Runnable, UI_ANIMATION_DELAY);
}
示例9: setSystemUiVisible
import android.app.ActionBar; //导入方法依赖的package包/类
/** Toggle whether the system UI (status bar / system bar) is visible.
* This also toggles the action bar visibility.
* @param show True to show the system UI, false to hide it.
*/
void setSystemUiVisible(boolean show) {
mSystemUiVisible = show;
Window window = getActivity().getWindow();
WindowManager.LayoutParams winParams = window.getAttributes();
View view = getView();
ActionBar actionBar = getActivity().getActionBar();
if (show) {
// Show status bar (remove fullscreen flag)
window.setFlags(0, WindowManager.LayoutParams.FLAG_FULLSCREEN);
// Show system bar
view.setSystemUiVisibility(View.STATUS_BAR_VISIBLE);
// Show action bar
actionBar.show();
} else {
// Add fullscreen flag (hide status bar)
window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
// Hide system bar
view.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
// Hide action bar
actionBar.hide();
}
window.setAttributes(winParams);
}
示例10: onCreate
import android.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ActionBar b = getActionBar();
if (b!=null) b.hide();
display = (TextView) findViewById(R.id.display);
switchPhone = (Switch) findViewById(R.id.switchPhone);
hellos = getResources().getStringArray(R.array.hello);
byes = getResources().getStringArray(R.array.bye);
convos = getResources().getStringArray(R.array.convo);
mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
findViewById(R.id.about_link).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent about = new Intent(MainActivity.this, AboutActivity.class);
startActivity(about);
}
});
}
示例11: onSystemUiHidden
import android.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onSystemUiHidden() {
if (mLevel == SystemUiHelper.LEVEL_LOW_PROFILE) {
// Manually hide the action bar when in low profile mode.
ActionBar ab = mActivity.getActionBar();
if (ab != null) {
ab.hide();
}
}
setIsShowing(true);
}
示例12: onCreate
import android.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_security_setting);
StatusBarCompat.setStatusBarColor(this,getResources().getColor(R.color.brands_color));
//隐藏actionBar
ActionBar actionBar = getActionBar();
if(actionBar != null){
actionBar.hide();
}
//绑定ButterKnife
ButterKnife.bind(this);
initTitleBar();
}
示例13: onCreate
import android.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_setting);
StatusBarCompat.setStatusBarColor(this,getResources().getColor(R.color.brands_color));
//隐藏actionBar
ActionBar actionBar = getActionBar();
if(actionBar != null){
actionBar.hide();
}
//绑定ButterKnife
ButterKnife.bind(this);
initTitleBar();
}
示例14: onSystemUiHidden
import android.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onSystemUiHidden() {
if (mLevel == SystemUiHelper.LEVEL_LOW_PROFILE) {
// Manually hide the action bar when in low profile mode.
ActionBar ab = mActivity.getActionBar();
if (ab != null) {
ab.hide();
}
}
setIsShowing(false);
}
示例15: onSystemUiHidden
import android.app.ActionBar; //导入方法依赖的package包/类
protected void onSystemUiHidden() {
ActionBar ab = mActivity.getActionBar();
if (ab != null) {
ab.hide();
}
mActivity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
setIsShowing(false);
}