Explorar o código

因为详细的配置界面还没做好,进入配置设置的时候直接跳转到ram页面去操作

robbin %!s(int64=4) %!d(string=hai) anos
pai
achega
f37cede4ec

+ 1 - 1
.idea/misc.xml

@@ -29,7 +29,7 @@
       </value>
     </option>
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/build/classes" />
   </component>
   <component name="ProjectType">

+ 8 - 2
app/src/main/java/com/example/administrator/wingcool_gt9_apk/Config.java

@@ -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);