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

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

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

Toolbar.setNavigationContentDescription介绍

暂无

代码示例

代码示例来源:origin: henrichg/PhoneProfilesPlus

@Override
public void setNavigationContentDescription(CharSequence description) {
 toolbar.setNavigationContentDescription(description);
}

代码示例来源:origin: OceanLabs/Android-Print-SDK

@Override
public void setActionBarDescription( @StringRes int contentDescRes )
 {
 if ( contentDescRes == 0 )
  {
  mToolbar.setNavigationContentDescription( mDefaultContentDescription );
  }
 else
  {
  mToolbar.setNavigationContentDescription( contentDescRes );
  }
 }

代码示例来源:origin: jeanboydev/Android-Architecture

/**
 * 设置Toolbar左边按钮
 *
 * @param toolbar
 * @param resId
 * @param descId
 * @param listener
 */
public static void setToolbarNavigation(Toolbar toolbar, int resId, int descId, View.OnClickListener listener) {
  if (toolbar == null) return;
  toolbar.setNavigationIcon(resId);
  toolbar.setNavigationContentDescription(descId);
  toolbar.setNavigationOnClickListener(listener);
}

代码示例来源:origin: zendesk/belvedere

private void initToolbar(final boolean fullScreenOnly) {
  toolbar.setNavigationIcon(R.drawable.belvedere_ic_close);
  toolbar.setNavigationContentDescription(R.string.belvedere_toolbar_desc_collapse);
  toolbar.setBackgroundColor(Color.WHITE);
  toolbar.setNavigationOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      if(!fullScreenOnly) {
        bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
      } else {
        dismiss();
      }
    }
  });
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
    toolbarCompatShadow.setVisibility(View.VISIBLE);
  }
  CoordinatorLayout.LayoutParams layoutParams =
      (CoordinatorLayout.LayoutParams) toolbarContainer.getLayoutParams();
  if(layoutParams != null) {
    layoutParams.setBehavior(new ToolbarBehavior(!fullScreenOnly));
  }
}

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

public void updateActionBar() {
  final RootInfo root = getCurrentRoot();
  mToolbar.setNavigationIcon(
      root != null ? root.loadToolbarIcon(mToolbar.getContext()) : null);
  mToolbar.setNavigationContentDescription(R.string.drawer_open);
  mToolbar.setNavigationOnClickListener(null);
  if (mSearchExpanded) {
    mToolbar.setTitle(null);
    mToolbarStack.setVisibility(View.GONE);
    mToolbarStack.setAdapter(null);
  } else {
    if (mState.stack.size() <= 1) {
      mToolbar.setTitle(root.title);
      mToolbarStack.setVisibility(View.GONE);
      mToolbarStack.setAdapter(null);
    } else {
      mToolbar.setTitle(null);
      mToolbarStack.setVisibility(View.VISIBLE);
      mToolbarStack.setAdapter(mStackAdapter);
      mIgnoreNextNavigation = true;
      mToolbarStack.setSelection(mStackAdapter.getCount() - 1);
    }
  }
}
@Override

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

mToolbar.setNavigationContentDescription(R.string.drawer_open);
mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
  @Override

代码示例来源:origin: derry/delion

searchBar.setNavigationContentDescription(R.string.accessibility_toolbar_btn_back);
searchBar.setNavigationOnClickListener(new OnClickListener() {
  @Override

代码示例来源:origin: ashishbhandari/RetailStore

toolbar.setNavigationContentDescription(R.string.close_and_go_back);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
  @Override

代码示例来源:origin: ashishbhandari/RetailStore

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.cart_act);
  ButterKnife.bind(this);
  mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow_flipped, GravityCompat.END);
  registerHideableHeaderView(findViewById(R.id.headerbar));
  mFragment = (CartFragment) getFragmentManager().findFragmentById(R.id.product_request_frag);
  // Add the back button to the toolbar.
  Toolbar toolbar = getActionBarToolbar();
  toolbar.setNavigationIcon(R.drawable.ic_up);
  toolbar.setNavigationContentDescription(R.string.close_and_go_back);
  toolbar.setNavigationOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
      navigateUpOrBack(CartActivity.this, null);
    }
  });
}

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

final boolean toNormal = App.isSearching;
if (toNormal) {
  mActionbar.setNavigationContentDescription(R.string.cd_open_drawer);
  mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
  mViewInsideActionbar.setVisibility(View.VISIBLE);
  mActionbar.setNavigationContentDescription(R.string.cd_quit_searching);
  mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
  mViewInsideActionbar.setVisibility(View.GONE);

相关文章

Toolbar类方法