Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

注释的是已翻译java #3

Open
1729022939 opened this issue May 24, 2019 · 2 comments
Open

注释的是已翻译java #3

1729022939 opened this issue May 24, 2019 · 2 comments

Comments

@1729022939
Copy link

// val effect = adInterpolator.getInterpolation(offset / offsetMax)
// val e: Int = argbEvaluator.evaluate(effect, Color.WHITE, 0xFF646464.toInt()) as Int
// vSearch.setImageDrawable(tintDrawable(drawableSearch, ColorStateList.valueOf(e)))
// vSearch.scaleX = (1 - 0.4 * effect).toFloat()
// vSearch.scaleY = (1 - 0.4 * effect).toFloat()
// vSearch.translationX = -(vSearchBorder.width - vSearch.width + dp(3)) * effect
// vSearchHint.alpha = effect
// vSearchHint.translationX = (vSearchHint.width / 3) * (1 - effect)
if (dy>0&&offset==offsetMax){
return 1F;
}else if (dy<0&&offset==0F){
return 0F;
}
offset+=dy;
if (offset>offsetMax){
offset=offsetMax;
}else if (offset<0){
offset=0F;
}
float effect = adInterpolator.getInterpolation(offset / offsetMax);
int e = (int) argbEvaluator.evaluate(effect,Color.WHITE,Color.parseColor("#999999"));
float kotlinturnjava (int dy){
if (dy>0&&offset==offsetMax){
return 1F;
}else if (dy<0&&offset==0F){
return 0F;
}
offset+=dy;
if (offset>offsetMax){
offset=offsetMax;
}else if (offset<0){
offset=0F;
}
float effect = adInterpolator.getInterpolation(offset / offsetMax);
int e = (int) argbEvaluator.evaluate(effect,Color.WHITE,Color.parseColor("#999999"));
sousuo_img.setImageDrawable(tintDrawable(getResources().getDrawable(R.mipmap.xin_khsousuo),ColorStateList.valueOf(e)));
sousuo_img.setScaleX(Float.parseFloat(String.valueOf(1 - 0.4 * effect)));
sousuo_img.setScaleY(Float.parseFloat(String.valueOf(1 - 0.4 * effect)));
hidesousuolay.setAlpha(effect);
hidesousuolay.setTranslationX(hidesousuolay.getWidth()-hidesousuolay.getWidth()+ DensityUtils.dip2px(NewUseShopActivity.this,3)*effect);
return effect;
}

这个没翻译:
if ((child.translationY < 0 || (child.translationY == 0F && dy > 0)) && !child.canScrollVertically()) {
val effect = layTitle.effectByOffset(dy)
selfView.vSmartTab.setBackgroundColor(argbEvaluator.evaluate(effect, Color.WHITE, 0xFFFAFAFA.toInt()) as Int)
val transY = -simpleTopDistance * effect
if (transY != child.translationY) {
child.translationY = transY
consumed[1] = dy
}

        if (type == 1) {
            isScrollToFullFood = true
        }
    } else if ((child.translationY > 0 || (child.translationY == 0F && dy < 0)) && !child.canScrollVertically()) {
        if (isScrollToFullFood) {
            child.translationY = 0F // top fling to bottom顶到底
        } else {
            child.translationY -= dy
            layContent.effectByOffset(child.translationY)
            laySettle.effectByOffset(child.translationY)
        }
        consumed[1] = dy
    } 

这段怎么用看不懂啊???求解

@1729022939
Copy link
Author

翻译完了Ok了

@iielse
Copy link
Owner

iielse commented Jan 28, 2020

这些都是根据业务来的。业务不一样代码不一样。
大体意思就是,通过behavior的特点先拿到了触摸事件,然后检查确定页面当前的状态.然后看对应的事件应该怎么处理

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants