我在Android应用程序中使用了ObjectAnimator.ofFloat,它不能以相同的方式在每个设备上运行.
MainActivity(扩展活动):
Button button1 = (Button) findViewById(R.id.button1);
button1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startAnimation();
}
});
public void startAnimation() {
ImageView aniView = (ImageView) findViewById(R.id.imageView1);
ObjectAnimator fadeOut = ObjectAnimator.ofFloat(aniView, "alpha", 0f);
fadeOut.setDuration(2000);
ObjectAnimator mover = ObjectAnimator.ofFloat(aniView, "translationX", -500f, 0f);
mover.setInterpolator(new TimeInterpolator() {
@Override
public float getInterpolation(float input) {
Log.v("MainActivity", "getInterpolation() " + String.format("%.4f", input));
return input;
}
});
mover.setDuration(2000);
ObjectAnimator fadeIn = ObjectAnimator.ofFloat(aniView, "alpha", 0f, 1f);
fadeIn.setDuration(2000);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.play(mover).with(fadeIn).after(fadeOut);
animatorSet.start();
}
Run Code Online (Sandbox Code Playgroud)
三星Galaxy S4(Android …
我正在寻找类似的东西
apply plugin: 'android-library'
dependencies {
flavor1Compile files('utility.aar')
}
Run Code Online (Sandbox Code Playgroud)
一切都失败了:
无法在根项目"SampleProject"上找到参数[文件集合]的方法flavor1Compile().