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

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

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

Toolbar.setAlpha介绍

暂无

代码示例

代码示例来源:origin: alexvasilkov/GestureViews

/**
 * Applying top image animation state: fading out toolbar and background.
 */
private void applyFullImageState(float position, boolean isLeaving) {
  views.fullBackground.setVisibility(position == 0f ? View.INVISIBLE : View.VISIBLE);
  views.fullBackground.setAlpha(position);
  views.fullImageToolbar.setVisibility(position == 0f ? View.INVISIBLE : View.VISIBLE);
  views.fullImageToolbar.setAlpha(position);
  views.fullImage.setVisibility(position == 0f && isLeaving
      ? View.INVISIBLE : View.VISIBLE);
}

代码示例来源:origin: alexvasilkov/GestureViews

/**
 * Applying pager image animation state: fading out toolbar, title and background.
 */
private void applyFullPagerState(float position, boolean isLeaving) {
  views.fullBackground.setVisibility(position == 0f ? View.INVISIBLE : View.VISIBLE);
  views.fullBackground.setAlpha(position);
  views.pagerToolbar.setVisibility(position == 0f ? View.INVISIBLE : View.VISIBLE);
  views.pagerToolbar.setAlpha(isSystemUiShown() ? position : 0f);
  views.pagerTitle.setVisibility(position == 1f ? View.VISIBLE : View.INVISIBLE);
  if (isLeaving && position == 0f) {
    pagerAdapter.setActivated(false);
    showSystemUi(true);
  }
}

代码示例来源:origin: ZieIony/Carbon

@Override
public void setAlpha(@FloatRange(from = 0.0, to = 1.0) float alpha) {
  super.setAlpha(alpha);
  invalidateParentIfNeeded();
  fireOnTransformationChangedListener();
}

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

toolbar.setAlpha(getModel().areToolbarsShown() ? 1 : 0);
} else {
  SwipeAnimation swipeAnimation =

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

toolbar.setAlpha(0);

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

toolbar.setAlpha(getModel().areToolbarsShown() ? 1 : 0);
} else if (selectionChanged) {
  tabViewRecycler.inflate(

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

@Override
public final void onGlobalLayout() {
  if (getModel().isSwitcherShown()) {
    AbstractItem[] items = calculateInitialItems(getModel().getReferenceTabIndex(),
        getModel().getReferenceTabPosition());
    AbstractItemIterator iterator = new InitialItemIteratorBuilder(items).create();
    AbstractItem item;
    while ((item = iterator.next()) != null) {
      if (item.isVisible()) {
        inflateAndUpdateView(item, false, createBottomMarginLayoutListener(item));
      }
    }
  } else if (getModel().getSelectedTab() != null) {
    AbstractItem item = TabItem.create(getTabSwitcher(), tabViewRecycler,
        getModel().getSelectedTabIndex());
    tabViewRecycler.inflate(item);
  }
  boolean showToolbar = getModel().areToolbarsShown() &&
      (getModel().isEmpty() || getModel().isSwitcherShown());
  toolbar.setAlpha(showToolbar ? 1 : 0);
  toolbar.setVisibility(showToolbar ? View.VISIBLE : View.INVISIBLE);
  adaptEmptyView(0);
}

相关文章