packagecom.example.wzq;importjava.util.ArrayList;importjava.util.List;importjava.util.concurrent.Executors;importjava.util.concurrent.ScheduledExecutorService;importjava.util.concurrent.TimeUnit;importcom.example.wzq.MyInfo.MyInfoActivity;importcom.example.wzq.gameview.WzqGame;importandroid.os.Bundle;importandroid.os.Handler;importandroid.os.Message;importandroid.os.Parcelable;importandroid.app.Activity;importandroid.content.Intent;importandroid.graphics.Color;importandroid.support.v4.view.PagerAdapter;importandroid.support.v4.view.ViewPager;importandroid.support.v4.view.ViewPager.OnPageChangeListener;importandroid.view.KeyEvent;importandroid.view.Menu;importandroid.view.View;importandroid.view.View.OnClickListener;importandroid.widget.Button;importandroid.widget.ImageView;importandroid.widget.TextView;importandroid.widget.ImageView.ScaleType;importandroid.widget.Toast;publicclassMainActivityextendsActivityimplementsOnClickListener{ privateViewPagerviewPager; privateListimageViews; //滑动的图片集合 privateString[]titles;//图片标题 privateint[]imageResId;//图片ID privateListdots;//图片标题正文的那些点集合 privateTextViewtv_title; privateintcurrentItem=0;//当前图片的索引号 Intentintent=newIntent(); privateScheduledExecutorServicescheduledExecutorService; //切换到当前显示的图片 privateHandlerhandler=newHandler(){ @Override publicvoidhandleMessage(Messagemsg){ viewPager.setCurrentItem(currentItem); } }; //定义两种颜色设置 staticfinalintCOLOR1=Color.parseColor("#787878"); staticfinalintCOLOR2=Color.parseColor("#ffffff"); //定义四个按钮切换按钮 privateButtonstart_btn=null; privateButtonbluetooth_btn=null; privateButtonmyinfo_btn=null; privateButtonfinish_btn=null; @Override protectedvoidonCreate(BundlesavedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //生成滚动图片 initImageFlow(); Viewview_
1