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

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

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

Toolbar.getChildCount介绍

暂无

代码示例

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

@Override
public int getChildCount() {
 return toolbar.getChildCount();
}

代码示例来源:origin: michael-rapp/ChromeLikeTabSwitcher

/**
 * Returns the menu item, which shows the navigation icon of the tab switcher's toolbar.
 *
 * @return The menu item, which shows the navigation icon of the tab switcher's toolbar, as an
 * instance of the class {@link View} or null, if no navigation icon is shown
 */
@Nullable
private View getNavigationMenuItem() {
  Toolbar[] toolbars = tabSwitcher.getToolbars();
  if (toolbars != null) {
    Toolbar toolbar = toolbars.length > 1 ? toolbars[1] : toolbars[0];
    int size = toolbar.getChildCount();
    for (int i = 0; i < size; i++) {
      View child = toolbar.getChildAt(i);
      if (child instanceof ImageButton) {
        return child;
      }
    }
  }
  return null;
}

代码示例来源:origin: h4h13/RetroMusicPlayer

public static void colorBackButton(Toolbar toolbar, @ColorInt int color) {
  final PorterDuffColorFilter colorFilter = new PorterDuffColorFilter(color, PorterDuff.Mode.MULTIPLY);
  for (int i = 0; i < toolbar.getChildCount(); i++) {
    final View backButton = toolbar.getChildAt(i);
    if (backButton instanceof ImageView) {
      ((ImageView) backButton).getDrawable().setColorFilter(colorFilter);
    }
  }
}

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

AppBarLayout.LayoutParams.MATCH_PARENT, params.height);
replacement.setLayoutParams(toolbarParams);
for (int j = 0; j < mToolbar.getChildCount(); j++) {
  View v = mToolbar.getChildAt(j);
  if (v instanceof TabLayout) {

代码示例来源:origin: h4h13/RetroMusicPlayer

PorterDuff.Mode.MULTIPLY);
for (int i = 0; i < toolbarView.getChildCount(); i++) {
  final View v = toolbarView.getChildAt(i);

相关文章