1.新建类
import android.content.Context;
import android.graphics.Color;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.animation.AnimationUtils;
import android.widget.TextSwitcher;
import android.widget.TextView;
import android.widget.ViewSwitcher;
import androidx.annotation.NonNull;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
public class LunBo1 extends TextSwitcher implements ViewSwitcher.ViewFactory {
private int index = -1;
private Context context;
private List<String> list;
public LunBo1(Context context, AttributeSet attrs) {
super(context, attrs);
this.context = context;
setInAnimation(AnimationUtils.loadAnimation(context, R.anim.in));
setOutAnimation