小编Ara*_*ind的帖子

每当服务器上的驾驶员位置 (lat lng) 发生变化时,将标记动画化到新位置,例如超级汽车动画

private void GetDriverloc(HashMap<String, String> map) {
    Call<DriverLocationResToCus> call = apiInterface.GetDriverLoc(map);
    System.out.println("enter the currency alert api" + call.request().url());
    call.enqueue(new Callback<DriverLocationResToCus>() {
        @Override
        public void onResponse(Call<DriverLocationResToCus> call, Response<DriverLocationResToCus> response) {


            if (response.isSuccessful()) {

                assert response.body() != null;
                DriverStartLat = response.body().getDriverCurrentLatStart();
                DriverStartLng = response.body().getDriverCurrentLngStart();
                DriverEndLat = response.body().getDriverCurrentLatEnd();
                DriverEndLng = response.body().getDriverCurrentLngEnd();
Run Code Online (Sandbox Code Playgroud)

/这里我从服务器获取驱动程序的位置。我需要将驱动程序 lat lnt 传递给循环并相应地为标记设置动画。我试图将它直接传递给 startpostion 和 endpostion。但标记继续闪烁。

                Utilities.printV("DriverStartLat", DriverStartLat);

                ValueAnimator polylineAnimator = ValueAnimator.ofInt(0, 100);
                polylineAnimator.setDuration(2000);
                polylineAnimator.setInterpolator(new LinearInterpolator());
                polylineAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                    @Override
                    public void onAnimationUpdate(ValueAnimator valueAnimator) {
                        List<LatLng> points = greyPolyLine.getPoints();
                        int percentValue = …
Run Code Online (Sandbox Code Playgroud)

animation android

5
推荐指数
1
解决办法
2971
查看次数

标签 统计

android ×1

animation ×1