android.support.v7.widget.Toolbar.setVisibility()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(246)

本文整理了Java中android.support.v7.widget.Toolbar.setVisibility()方法的一些代码示例,展示了Toolbar.setVisibility()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Toolbar.setVisibility()方法的具体详情如下:
包路径:android.support.v7.widget.Toolbar
类名称:Toolbar
方法名:setVisibility

Toolbar.setVisibility介绍

暂无

代码示例

代码示例来源:origin: wangdan/AisenWeiBo

@Override
public void onConfigurationChanged(Configuration newConfig) {
  super.onConfigurationChanged(newConfig);
  if (newConfig.orientation == 2) {
    getToolbar().setVisibility(View.GONE);
  }
  else {
    getToolbar().setVisibility(View.VISIBLE);
  }
}

代码示例来源:origin: wangdan/AisenWeiBo

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.ui_video_player);
  mVideoPlayer = (VideoView) findViewById(R.id.videoView);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  getSupportActionBar().setDisplayShowHomeEnabled(false);
  getSupportActionBar().setTitle("");
  if (getResources().getConfiguration().orientation == 2) {
    getToolbar().setVisibility(View.GONE);
  }
  mPlayingWhenPaused = true;
  String action = getIntent().getAction();
  if (Intent.ACTION_VIEW.equalsIgnoreCase(action) && getIntent().getData() != null) {
    Uri uri = getIntent().getData();
    if ("videoshort".equals(uri.getScheme())) {
      playWithShort(uri.toString().replace("videoshort://", ""));
    }
    else if ("videopath".equals(uri.getScheme())) {
      VideoBean bean = (VideoBean) getIntent().getSerializableExtra("bean");
      playWithVideo(uri.toString().replace("videopath://", ""), bean);
    }
  }
  else {
    finish();
  }
}

代码示例来源:origin: florent37/MaterialViewPager

mToolbar.setVisibility(INVISIBLE);

代码示例来源:origin: wenmingvs/NotifyUtil

private void initToolBar() {
  toolbar = (Toolbar) findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  toolbar.setVisibility(View.GONE);
}

代码示例来源:origin: beczesz/FragmentNavigationPatternDemo

/**
 * Sets the toolbars visibility
 * @param visibility
 */
public void setToolbarVisibility(int visibility) {
  mToolbar.setVisibility(visibility);
}

代码示例来源:origin: Fueled/flowr

@Override
public void setToolbarVisible(boolean visible) {
  binding.toolbar.setVisibility(visible ? View.VISIBLE : View.GONE);
}

代码示例来源:origin: CoderGuoy/Coder

/**
 * 设置整个ToolBar是否显示
 * @param visible
 */
public void setToolbarVisible(int visible){
  mBaseBinding.toolbar.setVisibility(visible);
}

代码示例来源:origin: anitaa1990/TrailersApp

public void displayToolbar() {
  binding.includedLayout.toolbar.setVisibility(View.VISIBLE);
}

代码示例来源:origin: anitaa1990/TrailersApp

public void hideToolbar() {
  binding.includedLayout.toolbar.setVisibility(View.INVISIBLE);
}

代码示例来源:origin: techyourchance/idocare-android

public void showToolbar() {
  mToolbar.setVisibility(View.VISIBLE);
}

代码示例来源:origin: gigabytedevelopers/FireFiles

public void setActionMode(boolean actionMode) {
  mActionMode = actionMode;
  mToolbar.setVisibility(actionMode ? View.INVISIBLE : View.VISIBLE);
}

代码示例来源:origin: kinecosystem/kin-ecosystem-android-sdk

@Override
  public void run() {
    getToolbar().setVisibility(View.VISIBLE);
  }
});

代码示例来源:origin: kinecosystem/kin-ecosystem-android-sdk

@Override
  public void run() {
    getToolbar().setVisibility(View.GONE);
  }
});

代码示例来源:origin: XunMengWinter/Now

protected void setToolbarVisibility(int viewVisibility) {
  if (mAppBarLayout != null)
    mAppBarLayout.setVisibility(viewVisibility);
  else if (mToolbar != null)
    mToolbar.setVisibility(viewVisibility);
}

代码示例来源:origin: ywwynm/EverythingDone

private void endPreviewAppWidget() {
  mFlPreviewAndConfig.setVisibility(View.GONE);
  mActionBar.setVisibility(View.VISIBLE);
  mRecyclerView.setVisibility(View.VISIBLE);
  updateStatusBarAndBottomUi(true);
  DisplayUtil.darkStatusBar(this);
}

代码示例来源:origin: ioneday/ImageSelector

public void switchBarVisibility() {
  barLayout.setVisibility(isShowBar ? View.GONE : View.VISIBLE);
  toolbar.setVisibility(isShowBar ? View.GONE : View.VISIBLE);
  selectBarLayout.setVisibility(isShowBar ? View.GONE : View.VISIBLE);
  if (isShowBar) {
    hideStatusBar();
  } else {
    showStatusBar();
  }
  isShowBar = !isShowBar;
}
public void onDoneClick(boolean isDone){

代码示例来源:origin: sjvc/Home-Assistant-Launcher

@Override
  public void onClick(DialogInterface dialog, int which) {
    Preferences.setHideToolbar(true);
    Preferences.save(MainActivity.this);
    mToolbar.setVisibility(View.GONE);
  }
})

代码示例来源:origin: mkulesh/microMathematics

@Override
public void onSupportActionModeStarted(android.support.v7.view.ActionMode mode)
{
  mToolbar.setVisibility(View.INVISIBLE);
  super.onSupportActionModeStarted(mode);
  activeActionModes.add(mode);
  final BaseFragment f = getVisibleFragment();
  if (f != null)
  {
    f.updateModeTitle();
  }
}

代码示例来源:origin: mkulesh/microMathematics

@Override
public void onSupportActionModeFinished(android.support.v7.view.ActionMode mode)
{
  super.onSupportActionModeFinished(mode);
  mToolbar.setVisibility(View.VISIBLE);
  activeActionModes.remove(mode);
  final BaseFragment f = getVisibleFragment();
  if (f != null)
  {
    f.enableObjectPropertiesButton(false);
    f.enableObjectDetailsButton(false);
  }
}

代码示例来源:origin: sjvc/Home-Assistant-Launcher

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  mToolbar = findViewById(R.id.toolbar_main);
  mUrlEditText = findViewById(R.id.urlEditText);
  setSupportActionBar(mToolbar);
  Preferences.load(this);
  mUrlEditText.setText(Preferences.getUrl());
  mToolbar.setVisibility(Preferences.getHideToolbar() ? View.GONE : View.VISIBLE);
  setupWebView();
  mUrlEditText.setOnEditorActionListener(mUrlEditTextOnEditorActionListener);
}

相关文章

Toolbar类方法