androidx.appcompat.widget.Toolbar.setNavigationContentDescription()方法的使用及代码示例

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

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

Toolbar.setNavigationContentDescription介绍

暂无

代码示例

代码示例来源:origin: KeepSafe/TapTargetView

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

代码示例来源:origin: MCMrARM/revolution-irc

@Override
public void onDrawerOpened(View drawerView) {
  if (((LayoutParams) drawerView.getLayoutParams()).gravity != Gravity.START)
    return;
  mToolbar.setNavigationContentDescription(mCloseTextId);
}

代码示例来源:origin: MCMrARM/revolution-irc

@Override
public void onDrawerClosed(View drawerView) {
  if (((LayoutParams) drawerView.getLayoutParams()).gravity != Gravity.START)
    return;
  mToolbar.setNavigationContentDescription(mOpenTextId);
}

代码示例来源:origin: cbeyls/fosdem-companion-android

/**
 * Initialize event-related configuration after the event has been loaded.
 */
private void initEvent(@NonNull Event event) {
  this.event = event;
  // Enable up navigation only after getting the event details
  toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_material);
  toolbar.setNavigationContentDescription(R.string.abc_action_bar_up_description);
  toolbar.setNavigationOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      navigateUp();
    }
  });
  final Track.Type trackType = event.getTrack().getType();
  ThemeUtils.setStatusBarTrackColor(this, trackType);
  final ColorStateList trackColor = ContextCompat.getColorStateList(this, trackType.getColorResId());
  appBarLayout.setBackgroundColor(trackColor.getDefaultColor());
  bottomAppBar.setBackgroundTint(trackColor);
  bookmarkStatusViewModel.setEvent(event);
  // Enable Android Beam
  NfcUtils.setAppDataPushMessageCallbackIfAvailable(this, this);
}

代码示例来源:origin: MCMrARM/revolution-irc

public ActionBarDrawerToggle(Toolbar toolbar, LockableDrawerLayout drawerLayout,
               int openTextId, int closeTextId) {
  mDrawable = new DrawerArrowDrawable(toolbar.getContext());
  mToolbar = toolbar;
  mOpenTextId = openTextId;
  mCloseTextId = closeTextId;
  drawerLayout.addDrawerListener(this);
  toolbar.setNavigationIcon(mDrawable);
  toolbar.setNavigationContentDescription(drawerLayout.isDrawerOpen(Gravity.START)
      ? closeTextId : openTextId);
  toolbar.setNavigationOnClickListener((View view) -> {
    if (drawerLayout.isDrawerOpen(Gravity.START))
      drawerLayout.closeDrawer(Gravity.START, !drawerLayout.isCurrentlyLocked());
    else
      drawerLayout.openDrawer(Gravity.START, !drawerLayout.isCurrentlyLocked());
    drawerLayout.requestLayout();
  });
  mOpenTextId = openTextId;
  mCloseTextId = closeTextId;
}

代码示例来源:origin: cbeyls/fosdem-companion-android

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

相关文章