本文整理汇总了Java中android.app.ActionBar.show方法的典型用法代码示例。如果您正苦于以下问题:Java ActionBar.show方法的具体用法?Java ActionBar.show怎么用?Java ActionBar.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.app.ActionBar
的用法示例。
在下文中一共展示了ActionBar.show方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: menuBarsShow
import android.app.ActionBar; //导入方法依赖的package包/类
private void menuBarsShow() {
Log.d(getClass().getName(), "menuBarsShow");
ActionBar actionBar = getActionBar();
if (actionBar == null) {
Log.d(getClass().getName(), "menuBarsShow ActionBar is null");
return;
}
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayShowHomeEnabled(false);
getWindow().addFlags(
WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_VISIBLE);
actionBar.show();
}
示例2: setActionBarTitle
import android.app.ActionBar; //导入方法依赖的package包/类
public void setActionBarTitle(String title) {
ActionBar actionBar = getActionBar();
if (actionBar != null && actionBar.getCustomView() != null) {
((TextView) actionBar.getCustomView().findViewById(R.id.action_bar_title)).setText(title);
actionBar.show();
}
}
示例3: run
import android.app.ActionBar; //导入方法依赖的package包/类
@Override
public void run() {
// Delayed display of UI elements
ActionBar actionBar = getActionBar();
if (actionBar != null) {
actionBar.show();
}
}
示例4: 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);
}
示例5: onSystemUiShown
import android.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onSystemUiShown() {
if (mLevel == SystemUiHelper.LEVEL_LOW_PROFILE) {
// Manually show the action bar when in low profile mode.
ActionBar ab = mActivity.getActionBar();
if (ab != null) {
ab.show();
}
}
setIsShowing(false);
}
示例6: onSystemUiShown
import android.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onSystemUiShown() {
if (mLevel == SystemUiHelper.LEVEL_LOW_PROFILE) {
// Manually show the action bar when in low profile mode.
ActionBar ab = mActivity.getActionBar();
if (ab != null) {
ab.show();
}
}
setIsShowing(true);
}
示例7: onSystemUiShown
import android.app.ActionBar; //导入方法依赖的package包/类
protected void onSystemUiShown() {
ActionBar ab = mActivity.getActionBar();
if (ab != null) {
ab.show();
}
mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
setIsShowing(true);
}
示例8: onSystemUiVisibilityChange
import android.app.ActionBar; //导入方法依赖的package包/类
@Override
public void onSystemUiVisibilityChange(int vis) {
// Test against mTestFlags to see if the system UI is visible.
final ActionBar actionBar = mActivity.getActionBar();
if ((vis & mTestFlags) != 0) {
if (Build.VERSION.SDK_INT < 16) { //Build.VERSION_CODES.JELLY_BEAN) {
// Pre-Jelly Bean, we must manually hide the action bar
// and use the old window flags API.
if (actionBar != null) {
actionBar.hide();
}
mActivity.getWindow().setFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
// Trigger the registered listener and cache the visibility
// state.
mOnVisibilityChangeListener.onVisibilityChange(false);
mVisible = false;
} else {
mAnchorView.setSystemUiVisibility(mShowFlags);
if (Build.VERSION.SDK_INT < 16) { //Build.VERSION_CODES.JELLY_BEAN) {
// Pre-Jelly Bean, we must manually show the action bar
// and use the old window flags API.
if (actionBar != null) {
actionBar.show();
}
mActivity.getWindow().setFlags(
0,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
// Trigger the registered listener and cache the visibility
// state.
mOnVisibilityChangeListener.onVisibilityChange(true);
mVisible = true;
}
}