Commit 8906c924008d7791f990b4d08f0dd65b8455cdb4

Authored by xiongwei
1 parent cc35aeb72a
Exists in master

recyclerview实现数据分离,定时器的修改

PersonalCenter/.idea/misc.xml
... ... @@ -37,7 +37,7 @@
37 37 <ConfirmationsSetting value="0" id="Add" />
38 38 <ConfirmationsSetting value="0" id="Remove" />
39 39 </component>
40   - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
  40 + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
41 41 <output url="file://$PROJECT_DIR$/build/classes" />
42 42 </component>
43 43 <component name="ProjectType">
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/AccountManagementActivity.java
... ... @@ -46,8 +46,31 @@ public class AccountManagementActivity extends AppCompatActivity implements View
46 46 super.handleMessage(msg);
47 47 switch (msg.what){
48 48 case HttpCode.CHILDS_SUCESS:
  49 + String name = null;
  50 + String grade = null;
  51 + String school = null;
  52 + String addr = null;
  53 + String phote = null;
  54 + List<ChildsInfo.DataBean> childList = new ArrayList<>() ;
  55 + List<ChildsInfo.DataBean> list = (List<ChildsInfo.DataBean>)msg.obj ;
  56 + for (int i = 0; i < list.size(); i++) {
  57 + int type = list.get(i).getType();
  58 + if(type == 1){
  59 + name = list.get(i).getName();
  60 + grade = list.get(i).getGrade();
  61 + school = list.get(i).getSchool();
  62 + addr = list.get(i).getRegion();
  63 + phote = list.get(i).getImage();
  64 + }else if (type == 2){
  65 + childList.add(list.get(i));
  66 + }
  67 + }
  68 + tv_username.setText(name);
  69 + tv_grade.setText(grade);
  70 + tv_school.setText(school);
  71 + tv_adress.setText(addr);
49 72 data.clear();
50   - data.addAll( (List<ChildsInfo.DataBean>)msg.obj);
  73 + data.addAll(childList);
51 74 childsAdapter.notifyDataSetChanged();
52 75 break;
53 76 }
... ... @@ -88,10 +111,7 @@ public class AccountManagementActivity extends AppCompatActivity implements View
88 111 String tv_adresss = SaveParam.getInstance().getLoginParam(this,SaveParam.ADRESS);
89 112 String account = SaveParam.getInstance().getLoginParam(this,SaveParam.ACCOUNT);
90 113 usernames.setText(cunt_username);
91   - tv_username.setText(tv_usernames);
92   - tv_grade.setText(tv_grades);
93   - tv_school.setText(tv_schools);
94   - tv_adress.setText(tv_adresss);
  114 +
95 115 if (account.equals("1")){
96 116 tv_changzhu.setText("使用中");
97 117 tv_changzhu.setEnabled(false);
... ...
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ForgotPasswordActivity.java
... ... @@ -23,6 +23,9 @@ import com.hjx.personalcenter.util.PhoneNumCheckUtils;
23 23 import org.json.JSONException;
24 24 import org.json.JSONObject;
25 25  
  26 +import java.util.Timer;
  27 +import java.util.TimerTask;
  28 +
26 29 /**
27 30 * 忘记密码
28 31 * Created by h on 2017/6/17.
... ...
PersonalCenter/app/src/test/java/com/hjx/personalcenter/ExampleUnitTest.java
... ... @@ -2,6 +2,9 @@ package com.hjx.personalcenter;
2 2  
3 3 import org.junit.Test;
4 4  
  5 +import java.util.Timer;
  6 +import java.util.TimerTask;
  7 +
5 8 import static org.junit.Assert.*;
6 9  
7 10 /**
... ... @@ -12,6 +15,13 @@ import static org.junit.Assert.*;
12 15 public class ExampleUnitTest {
13 16 @Test
14 17 public void addition_isCorrect() throws Exception {
15   - assertEquals(4, 2 + 2);
  18 +// assertEquals(4, 2 + 2);
  19 + Timer timer = new Timer();
  20 + timer.schedule(new TimerTask() {
  21 + @Override
  22 + public void run() {
  23 + System.out.print("爆炸");
  24 + }
  25 + }, 60 * 1000, 1000);
16 26 }
17 27 }
18 28 \ No newline at end of file
... ...