String url="http://172.17.8.100/small/commodity/v1/findCommodityByKeyword?keyword=" + s + "&&page="+page+"&&count=10";
拼接口
http://172.17.8.100/small/commodity/v1/findCommodityByKeyword?keyword=板鞋&page=1&count=5
拼接口
//okhttp
RequestBody requestBody=new FormBody.Builder()
.add(“phone”,phone)
.add(“pwd”,pwd)
.build();
Request request=new Request.Builder()
.url(url)
.post(requestBody)
.build();
okHttpClient.newCall(request).enqueue(callback);
动画
package com.baway.donghua;
import android.animation.ValueAnimator;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private ImageView imageView;
private TextView textView;
private ValueAnimator valueAnimator;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//初始化控件
imageView = findViewById(R.id.dong_img);
textView = findViewById(R.id.dong_text);
valueAnimator = ValueAnimator.ofInt(6,3,10,0);
valueAnimator.setDuration(5000);
valueAnimator.start();
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
private Object animatedValue;
@Override
public void onAnimationUpdate(ValueAnimator animation) {
animatedValue = animation.getAnimatedValue();
int animatedValue = (int) animation.getAnimatedValue();
textView.layout(animatedValue,animatedValue,animatedValue+textView.getWidth(),animatedValue+textView.getHeight());
}
});
valueAnimator.start();
}