本文整理了Java中android.support.v7.widget.Toolbar.setTranslationY()
方法的一些代码示例,展示了Toolbar.setTranslationY()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Toolbar.setTranslationY()
方法的具体详情如下:
包路径:android.support.v7.widget.Toolbar
类名称:Toolbar
方法名:setTranslationY
暂无
代码示例来源:origin: scwang90/SmartRefreshLayout
@Override
public void onHeaderMoving(RefreshHeader header, boolean isDragging, float percent, int offset, int headerHeight, int maxDragHeight) {
appBar.setTranslationY(offset);
toolbar.setTranslationY(-offset);
}
// @Override
代码示例来源:origin: frogermcs/InstaMaterial
private void startIntroAnimation() {
fabCreate.setTranslationY(2 * getResources().getDimensionPixelOffset(R.dimen.btn_fab_size));
int actionbarSize = Utils.dpToPx(56);
getToolbar().setTranslationY(-actionbarSize);
getIvLogo().setTranslationY(-actionbarSize);
getInboxMenuItem().getActionView().setTranslationY(-actionbarSize);
getToolbar().animate()
.translationY(0)
.setDuration(ANIM_DURATION_TOOLBAR)
.setStartDelay(300);
getIvLogo().animate()
.translationY(0)
.setDuration(ANIM_DURATION_TOOLBAR)
.setStartDelay(400);
getInboxMenuItem().getActionView().animate()
.translationY(0)
.setDuration(ANIM_DURATION_TOOLBAR)
.setStartDelay(500)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
startContentAnimation();
}
})
.start();
}
代码示例来源:origin: kollerlukas/Camera-Roll-Android-App
@Override
public void onTransitionStart(@NonNull Transition transition) {
//hide toolbar & statusbar
float toolbar_translationY = -(toolbar.getHeight());
float bottomBar_translationY = ((View) bottomBar.getParent()).getHeight();
toolbar.setTranslationY(toolbar_translationY);
((View) bottomBar.getParent()).setTranslationY(bottomBar_translationY);
super.onTransitionStart(transition);
}
代码示例来源:origin: r17171709/android_demo
@Override
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
float tranY=0;
float scrollY=slideOffset*(design_coor.getHeight()-design_toolbar.getHeight());
if (scrollY>design_coor.getHeight()-design_toolbar.getHeight()*2) {
tranY=(scrollY-(design_coor.getHeight()-design_toolbar.getHeight()*2));
}
else {
tranY=0;
}
design_toolbar.setTranslationY(-tranY);
}
});
代码示例来源:origin: matrixxun/ImmersiveDetailSample
LollipopCompatSingleton.setStatusBarColorImmediately(this,ContextCompat.getColor(this,android.R.color.transparent));
toolbar.setTranslationY(y);
setToolbarColor(TOOLBAR_STATE_NORMAL);
toolbar.setVisibility(View.INVISIBLE);
toolbar.setTranslationY(-toolbar.getHeight());
toolbar.setVisibility(View.VISIBLE);
toolbar.setTranslationY(toolbar.getTranslationY() + Math.abs(scrollY-oldScrollY));
}else{
toolbar.setTranslationY(0);
toolbar.setTranslationY(toolbar.getTranslationY() - Math.abs(scrollY-oldScrollY));
}else{
toolbar.setTranslationY(-toolbar.getHeight());
代码示例来源:origin: matrixxun/ImmersiveDetailSample
LollipopCompatSingleton.setStatusBarColorImmediately(activityWeakReference.get(),ContextCompat.getColor(getContext(),android.R.color.transparent));
toolbar.setTranslationY(y);
setToolbarColor(TOOLBAR_STATE_NORMAL);
toolbar.setVisibility(View.INVISIBLE);
toolbar.setTranslationY(-toolbar.getHeight());
toolbar.setVisibility(View.VISIBLE);
toolbar.setTranslationY(toolbar.getTranslationY() + Math.abs(scrollY-oldScrollY));
}else{
toolbar.setTranslationY(0);
toolbar.setTranslationY(toolbar.getTranslationY() - Math.abs(scrollY-oldScrollY));
}else{
toolbar.setTranslationY(-toolbar.getHeight());
代码示例来源:origin: AlphaBoom/ClassifyView
mBinding.toolBar.setTranslationY(-60*density);
return mBinding.getRoot();
代码示例来源:origin: kollerlukas/Camera-Roll-Android-App
toolbar.setTranslationY(translationY);
代码示例来源:origin: kollerlukas/Camera-Roll-Android-App
toolbar.setTranslationY(translationY);
内容来源于网络,如有侵权,请联系作者删除!