当前位置: 首页>>代码示例>>Java>>正文


Java SimpleDraweeView.getWidth方法代码示例

本文整理汇总了Java中com.facebook.drawee.view.SimpleDraweeView.getWidth方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleDraweeView.getWidth方法的具体用法?Java SimpleDraweeView.getWidth怎么用?Java SimpleDraweeView.getWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.drawee.view.SimpleDraweeView的用法示例。


在下文中一共展示了SimpleDraweeView.getWidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onDependentViewChanged

import com.facebook.drawee.view.SimpleDraweeView; //导入方法依赖的package包/类
@Override
public boolean onDependentViewChanged(CoordinatorLayout parent, SimpleDraweeView child, View dependency) {
    maybeInitProperties(child, dependency);

    final int maxScrollDistance = (int) (mStartToolbarPosition - getStatusBarHeight());
    float expandedPercentageFactor = dependency.getY() / maxScrollDistance;

    float distanceYToSubtract = ((mStartYPosition - mFinalYPosition)
            * (1f - expandedPercentageFactor)) + (child.getHeight()/2);

    float distanceXToSubtract = ((mStartXPosition - mFinalXPosition)
            * (1f - expandedPercentageFactor)) + (child.getWidth()/2);

    float heightToSubtract = ((mStartHeight - finalHeight) * (1f - expandedPercentageFactor));

    child.setY(mStartYPosition - distanceYToSubtract);
    child.setX(mStartXPosition - distanceXToSubtract);

    int proportionalAvatarSize = (int) (mAvatarMaxSize * (expandedPercentageFactor));

    CoordinatorLayout.LayoutParams lp = (CoordinatorLayout.LayoutParams) child.getLayoutParams();
    lp.width = (int) (mStartHeight - heightToSubtract);
    lp.height = (int) (mStartHeight - heightToSubtract);
    child.setLayoutParams(lp);
    return true;
}
 
开发者ID:picopalette,项目名称:event-me,代码行数:27,代码来源:ImageBehaviour.java

示例2: maybeInitProperties

import com.facebook.drawee.view.SimpleDraweeView; //导入方法依赖的package包/类
@SuppressLint("PrivateResource")
private void maybeInitProperties(SimpleDraweeView child, View dependency) {
    if (mStartYPosition == 0)
        mStartYPosition = (int) (dependency.getY());

    if (mFinalYPosition == 0)
        mFinalYPosition = (dependency.getHeight() /2);

    if (mStartHeight == 0)
        mStartHeight = child.getHeight();

    if (finalHeight == 0)
        finalHeight = mContext.getResources().getDimensionPixelOffset(R.dimen.image_small_width);

    if (mStartXPosition == 0)
        mStartXPosition = (int) (child.getX() + (child.getWidth() / 2));

    if (mFinalXPosition == 0)
        mFinalXPosition = mContext.getResources().getDimensionPixelOffset(R.dimen.abc_action_bar_content_inset_material) + (finalHeight / 2);

    if (mStartToolbarPosition == 0)
        mStartToolbarPosition = dependency.getY() + (dependency.getHeight()/2);
}
 
开发者ID:picopalette,项目名称:event-me,代码行数:24,代码来源:ImageBehaviour.java


注:本文中的com.facebook.drawee.view.SimpleDraweeView.getWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。