android.support.v4.widget.NestedScrollView.setAlpha()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(95)

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

NestedScrollView.setAlpha介绍

暂无

代码示例

代码示例来源:origin: xinghongfei/LookLook

private void initView() {
  mNest.setAlpha(0.5f);
  mToolbar.setNavigationIcon(R.drawable.ic_arrow_back);
  mToolbar.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
      mNest.smoothScrollTo(0, 0);
    }
  });
  mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      expandImageAndFinish();
    }
  });
}

代码示例来源:origin: rubensousa/Transitions

@Override
public void onTransitionStart(Transition transition) {
  fab.setScaleX(0);
  fab.setScaleY(0);
  fab.setVisibility(View.INVISIBLE);
  nestedScrollView.setAlpha(0f);
}

代码示例来源:origin: rubensousa/Transitions

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setupTransitions();
  setContentView(R.layout.activity_toolbar);
  appbar = (AppBarLayout) findViewById(R.id.appbar);
  nestedScrollView = (NestedScrollView) findViewById(R.id.nestedScrollView);
  collapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsingLayout);
  if (savedInstanceState == null) {
    nestedScrollView.setAlpha(0f);
    nestedScrollView.getViewTreeObserver()
        .addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
          @Override
          public void onGlobalLayout() {
            if (nestedScrollView.getHeight() != 0) {
              appbar.setExpanded(true);
              appbar.addOnOffsetChangedListener(ToolbarActivity.this);
              nestedScrollView.getViewTreeObserver()
                  .removeOnGlobalLayoutListener(this);
              nestedScrollView.animate().setStartDelay(400).alpha(1f);
              nestedScrollView.setTranslationY(nestedScrollView.getHeight() / 3);
              nestedScrollView.animate().setStartDelay(400).translationY(0)
                  .setInterpolator(new AccelerateDecelerateInterpolator());
            }
          }
        });
  }
}

相关文章