如何在Android上为我的动画添加其他过渡?

时间:2015-03-06 17:37:01

标签: android android-animation

我有一个非常好用的过渡动画。暂停1000毫秒后,如何添加其他翻译?

    view.getViewTreeObserver().addOnGlobalLayoutListener(
        new ViewTreeObserver.OnGlobalLayoutListener() {


            @Override
            public void onGlobalLayout() {
                int button1_position[] = new int[2];
                ibContact1.getLocationInWindow(button1_position);

                Log.e(">>>>", "button1_position[0] "+button1_position[0] + " button1_position[1] " + button1_position[1]);
                mSlidingImage = (ImageView) view.findViewById(R.id.slidingImage);
                Animation translation = new TranslateAnimation(button1_position[0]-200, button1_position[0]-25, 0, button1_position[1] - 110);
                translation.setStartOffset(1000);
                translation.setDuration(2000);
                translation.setRepeatCount(1);

                //translation.setRepeatCount(Animation.INFINITE);
                //translation.setRepeatMode(Animation.REVERSE);
                mSlidingImage.startAnimation(translation);
                //mSlidingImage.setVisibility(View.INVISIBLE);
            }
        });


    return view;
}

0 个答案:

没有答案