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

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

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

NestedScrollView.animate介绍

暂无

代码示例

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

@Override
  public void onTransitionStart(Transition transition) {
    super.onTransitionStart(transition);
    // hide the fab as for some reason it jumps position??  TODO work out why
    mToolbar.animate()
        .alpha(0f)
        .setDuration(100)
        .setInterpolator(new AccelerateInterpolator());
    if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP) {
      mShot.setElevation(1f);
      mToolbar.setElevation(0f);
    }
    mNest.animate()
        .alpha(0f)
        .setDuration(50)
        .setInterpolator(new AccelerateInterpolator());
  }
};

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

@Override
  public void onTransitionStart(Transition transition) {
    super.onTransitionStart(transition);
    // hide the fab as for some reason it jumps position??  TODO work out why
    mToolbar.animate()
        .alpha(0f)
        .setDuration(100)
        .setInterpolator(new AccelerateInterpolator());
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      mShot.setElevation(1f);
      mToolbar.setElevation(0f);
    }
    mNest.animate()
        .alpha(0f)
        .setDuration(50)
        .setInterpolator(new AccelerateInterpolator());
  }
};

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

@Override
  public void onBackPressed() {
    fab.setVisibility(View.INVISIBLE);
    nestedScrollView.animate().alpha(0)
        .setInterpolator(new AccelerateInterpolator())
        .translationY(TransitionUtils.dpToPixels(TransitionActivity.this, 72))
        .start();
    supportFinishAfterTransition();
  }
}

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

@Override
public void onTransitionEnd(Transition transition) {
  fab.show();
  nestedScrollView.setTranslationY(
      TransitionUtils.dpToPixels(TransitionActivity.this, 72));
  nestedScrollView.animate().alpha(1f).translationY(0)
      .setInterpolator(new DecelerateInterpolator());
  transition.removeListener(this);
}

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

@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());
    }
  }
});

相关文章