|
@@ -314,7 +314,7 @@ public class Config extends AppCompatActivity
|
|
|
View viewhoppingsetting;
|
|
|
View viewcfgram;
|
|
|
private int offset = 0;//移动条图片的偏移量
|
|
|
- private int currIndex = 0;//当前页面的编号
|
|
|
+ private int currIndex = 8;//当前页面的编号
|
|
|
private int bmpWidth;// 移动条图片的长度
|
|
|
private int one = 0; //移动条滑动一页的距离
|
|
|
private int two = 0; //滑动条移动两页的距离
|
|
@@ -532,6 +532,12 @@ public class Config extends AppCompatActivity
|
|
|
eight = one * 8;// 移动两页的偏移量,比如1直接跳3
|
|
|
nine = one * 9;// 移动两页的偏移量,比如1直接跳3
|
|
|
|
|
|
+ Animation animation = null;
|
|
|
+ animation = new TranslateAnimation(one * currIndex, eight, 0, 0); //currIndex初始化是8
|
|
|
+ animation.setFillAfter(true);// true表示图片停在动画结束位置
|
|
|
+ animation.setDuration(300); //设置动画时间为300毫秒
|
|
|
+ img_cursor.startAnimation(animation);//开始动画
|
|
|
+
|
|
|
//往ViewPager填充View,同时设置点击事件与页面切换事件
|
|
|
listViews = new ArrayList<View>();
|
|
|
|
|
@@ -560,7 +566,7 @@ public class Config extends AppCompatActivity
|
|
|
listViews.add(viewhoppingsetting);
|
|
|
listViews.add(viewcfgram);
|
|
|
vpagerCfg.setAdapter(new MyPagerAdapter(listViews));
|
|
|
- vpagerCfg.setCurrentItem(0); //设置ViewPager当前页,从0开始算
|
|
|
+ vpagerCfg.setCurrentItem(8); //设置ViewPager当前页,从8开始算,跳到最后ram页
|
|
|
|
|
|
tvSample.setOnClickListener(this);
|
|
|
tvModuleSwitch.setOnClickListener(this);
|