本文整理匯總了Java中android.support.design.widget.AppBarLayout.setBottom方法的典型用法代碼示例。如果您正苦於以下問題:Java AppBarLayout.setBottom方法的具體用法?Java AppBarLayout.setBottom怎麽用?Java AppBarLayout.setBottom使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.design.widget.AppBarLayout
的用法示例。
在下文中一共展示了AppBarLayout.setBottom方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: scale
import android.support.design.widget.AppBarLayout; //導入方法依賴的package包/類
private void scale(AppBarLayout abl, View target, int dy) {
mTotalDy += -dy;
mTotalDy = Math.min(mTotalDy, TARGET_HEIGHT);
mLastScale = Math.max(1f, 1f + mTotalDy / TARGET_HEIGHT);
mTargetView.setScaleX(mLastScale);
mTargetView.setScaleY(mLastScale);
mLastBottom = mParentHeight + (int) (mTargetViewHeight / 2 * (mLastScale - 1));
abl.setBottom(mLastBottom);
target.setScrollY(0);
}
示例2: recovery
import android.support.design.widget.AppBarLayout; //導入方法依賴的package包/類
private void recovery(final AppBarLayout abl) {
if (mTotalDy > 0) {
mTotalDy = 0;
if (isAnimate) {
ValueAnimator anim = ValueAnimator.ofFloat(mLastScale, 1f).setDuration(200);
anim.addUpdateListener(animation -> {
float value = (float) animation.getAnimatedValue();
mTargetView.setScaleX(value);
mTargetView.setScaleY(value);
abl.setBottom((int) (mLastBottom - (mLastBottom - mParentHeight) * animation.getAnimatedFraction()));
});
anim.start();
} else {
mTargetView.setScaleX(1f);
mTargetView.setScaleY(1f);
abl.setBottom(mParentHeight);
}
}
}