Commit 3163a156d1832ffd7a82d5b7e7cf924fa01cc130

Authored by 陶汉栋
2 parents b8d5d471 8c991655

Merge branch 'yxb_dev' of http://git.shunzhi.net/taohd/parentwork into developer

Showing 48 changed files with 1287 additions and 196 deletions   Show diff stats
app/src/main/AndroidManifest.xml
... ... @@ -71,7 +71,8 @@
71 71 <category android:name="android.intent.category.LAUNCHER" />
72 72 </intent-filter>
73 73 </activity>
74   - <!-- <activity android:name=".ui.activity.LoginAndRegistActivity" /> -->
  74 + <activity android:name=".ui.MainActivity"
  75 + android:screenOrientation="portrait" />
75 76 <activity
76 77 android:name=".ui.activity.MyChildActivity"
77 78 android:screenOrientation="portrait" />
... ... @@ -81,6 +82,10 @@
81 82 android:name=".ui.activity.StartActivity"
82 83 android:screenOrientation="portrait" />
83 84 <activity
  85 + android:name=".ui.activity.binding.CreateChildInfoActivity"
  86 + android:screenOrientation="portrait"
  87 + android:windowSoftInputMode="adjustPan|stateHidden"/>
  88 + <activity
84 89 android:name=".ui.activity.binding.SelectSchoolActivity"
85 90 android:screenOrientation="portrait"
86 91 android:windowSoftInputMode="adjustPan|stateHidden" />
... ... @@ -96,9 +101,7 @@
96 101 android:screenOrientation="portrait"
97 102 android:windowSoftInputMode="adjustPan|stateHidden" />
98 103 <activity android:name=".ui.activity.consult.ConsultTwoLevelActivity"></activity>
99   - <activity android:name=".ui.MainActivity"
100   - android:screenOrientation="portrait"
101   - />
  104 +
102 105 </application>
103 106  
104 107 </manifest>
105 108 \ No newline at end of file
... ...
app/src/main/java/com/shunzhi/parent/AppConfig.java
... ... @@ -18,6 +18,10 @@ public class AppConfig {
18 18 public static String LOGIN_NAME = "login_name";
19 19 public static String LOGIN_PWD = "login_pwd";
20 20 public static String ACCESS_TOKEN = "access_token";
  21 + public static String USER_NAME = "user_name";
  22 + public static String USER_SEX = "user_sex";
  23 + public static String USER_IMAGE = "user_image";
  24 +
21 25  
22 26 //默认日志保存的路径
23 27 public final static String DEFAULT_SAVE_LOG_PATH = Environment
... ... @@ -29,7 +33,6 @@ public class AppConfig {
29 33 + File.separator;
30 34  
31 35  
32   -
33 36 private static AppConfig appConfig = null;
34 37 private static Context mContext = null;
35 38  
... ... @@ -71,6 +74,4 @@ public class AppConfig {
71 74 }
72 75  
73 76  
74   -
75   -
76 77 }
... ...
app/src/main/java/com/shunzhi/parent/AppContext.java
... ... @@ -99,6 +99,7 @@ public class AppContext extends GlobalApplication {
99 99  
100 100 if (aMapLocation.getErrorCode()==0){
101 101 cityName=aMapLocation.getCity();
  102 + aMapLocation.getCityCode();
102 103 Log.d("mlocation:","handler="+handler);
103 104 Intent intent=new Intent();
104 105 intent.setAction(LOCATION_CITYNAME+"");
... ...
app/src/main/java/com/shunzhi/parent/adapter/ChildAdapter.java
... ... @@ -32,17 +32,20 @@ public class ChildAdapter extends BaseRecyclerViewAdapter&lt;ChildBean&gt;{
32 32  
33 33 private class MyViewHolder extends BaseRecyclerViewHolder<ChildBean>{
34 34  
35   - TextView textView;
  35 + TextView txt_childname,txt_childclass;
36 36  
37 37  
38 38 public MyViewHolder(View view) {
39 39 super(view);
40   - textView=view.findViewById(R.id.txt_childname);
  40 + txt_childname=view.findViewById(R.id.txt_childname);
  41 + txt_childclass=view.findViewById(R.id.txt_childclass);
41 42 }
42 43  
43 44 @Override
44 45 public void onBindViewHolder(ChildBean object, int position) {
45   - textView.setText("1234");
  46 + txt_childname.setText(object.getStudentName());
  47 + txt_childclass.setText(object.getSchoolName()+" "+object.getClassName());
  48 +
46 49 }
47 50  
48 51 }
... ...
app/src/main/java/com/shunzhi/parent/adapter/SchoolListAdapter.java
... ... @@ -6,12 +6,13 @@ import android.view.LayoutInflater;
6 6 import android.view.View;
7 7 import android.view.ViewGroup;
8 8 import android.widget.ImageView;
  9 +import android.widget.RelativeLayout;
9 10 import android.widget.TextView;
10 11  
11 12 import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter;
12 13 import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder;
13 14 import com.shunzhi.parent.R;
14   -import com.shunzhi.parent.bean.SchoolBean;
  15 +import com.shunzhi.parent.bean.SortBean;
15 16  
16 17 import java.util.List;
17 18  
... ... @@ -19,14 +20,22 @@ import java.util.List;
19 20 * Created by Administrator on 2018/3/9 0009.
20 21 */
21 22  
22   -public class SchoolListAdapter extends BaseRecyclerViewAdapter<SchoolBean> {
  23 +public class SchoolListAdapter extends BaseRecyclerViewAdapter<SortBean> {
23 24  
24 25 Context context;
25   - List<SchoolBean>list;
  26 + List<SortBean> list;
  27 + boolean[] ischeck;
  28 + int currentPosition=-1;
  29 + public static SortBean currentSortBean;
26 30  
27   - public SchoolListAdapter(Context context,List<SchoolBean>list) {
  31 + public SchoolListAdapter(Context context, List<SortBean> list) {
28 32 this.context = context;
29   - this.list=list;
  33 + this.list = list;
  34 + ischeck = new boolean[list.size()];
  35 + for (int i=0;i<ischeck.length;i++){
  36 + ischeck[i]=false;
  37 + }
  38 +
30 39 }
31 40  
32 41  
... ... @@ -36,20 +45,26 @@ public class SchoolListAdapter extends BaseRecyclerViewAdapter&lt;SchoolBean&gt; {
36 45 return new MyViewHolder(view);
37 46 }
38 47  
39   - private class MyViewHolder extends BaseRecyclerViewHolder<SchoolBean> {
  48 + private class MyViewHolder extends BaseRecyclerViewHolder<SortBean> {
40 49 TextView school_name;
41 50 ImageView select_school;
42 51 TextView tvLetter;
  52 + RelativeLayout item_view;
43 53  
44 54 public MyViewHolder(View view) {
45 55 super(view);
46 56 school_name = view.findViewById(R.id.school_name);
47 57 select_school = view.findViewById(R.id.select_school);
48 58 tvLetter = view.findViewById(R.id.uiPPLetter);
  59 + item_view = view.findViewById(R.id.item_view);
49 60 }
50 61  
51 62 @Override
52   - public void onBindViewHolder(SchoolBean object, int position) {
  63 + public void onBindViewHolder(final SortBean object, final int position) {
  64 + select_school.setVisibility(View.INVISIBLE);
  65 + if (ischeck[position] ==true) {
  66 + select_school.setVisibility(View.VISIBLE);
  67 + }
53 68 int section = getSectionForPosition(position);
54 69 //如果当前位置等于该分类首字母的Char的位置 ,则认为是第一次出现,并且不是老师
55 70 if (position == getPositionForSection(section)) {
... ... @@ -62,35 +77,49 @@ public class SchoolListAdapter extends BaseRecyclerViewAdapter&lt;SchoolBean&gt; {
62 77 tvLetter.setVisibility(View.GONE);
63 78 }
64 79  
65   - school_name.setText(object.getSchoolname());
  80 + school_name.setText(object.getSchool_name());
  81 + item_view.setOnClickListener(new View.OnClickListener() {
  82 + @Override
  83 + public void onClick(View v) {
  84 + ischeck[position] = true;
  85 + if(currentPosition!=-1) {
  86 + ischeck[currentPosition] = false;
  87 + }
  88 + currentPosition = position;
  89 + currentSortBean=object;
  90 + notifyDataSetChanged();
  91 + }
  92 + });
66 93  
67 94  
68 95 }
69 96  
70 97  
71   -
72   -
73 98 }
  99 +
74 100 public int getPositionForSection(int section) {
75 101 for (int i = 0; i < getCount(); i++) {
76   - String sortStr = list.get(i).getSortLetters();
77   - char firstChar = sortStr.toUpperCase().charAt(0);
78   - if (firstChar == section) {
79   - return i;
  102 + String sortStr = list.get(i).getSortLetters();
  103 + char firstChar = sortStr.toUpperCase().charAt(0);
  104 + if (firstChar == section) {
  105 + return i;
80 106 }
81 107 }
82 108  
83 109 return -1;
84 110 }
  111 +
85 112 public int getCount() {
86 113 return list.size();
87 114 }
88 115  
89 116 public int getSectionForPosition(int position) {
90 117  
91   - return list.get(position).getSortLetters().charAt(0);
  118 + return list.get(position).getSortLetters().charAt(0);
92 119  
93 120 }
94 121  
95   -
  122 + public static SortBean getCurrentSortBean() {
  123 + return currentSortBean;
  124 + }
96 125 }
... ...
app/src/main/java/com/shunzhi/parent/api/LoginRegisterApi.java
1 1 package com.shunzhi.parent.api;
2 2  
3 3 import com.google.gson.JsonObject;
4   -import com.shunzhi.parent.bean.CurrentBean;
  4 +import com.shunzhi.parent.bean.UserInfo;
5 5  
6 6 import io.reactivex.Observable;
7 7 import retrofit2.http.Field;
... ... @@ -38,6 +38,6 @@ public interface LoginRegisterApi {
38 38  
39 39 @FormUrlEncoded
40 40 @POST("/api/ParentHelper/GetParentInfo")
41   - Observable<CurrentBean> getUserInfo();
  41 + Observable<UserInfo> getUserInfo(@Field("mobile") String mobile, @Field("school_id") int school_id, @Field("captcha") String captcha);
42 42  
43 43 }
... ...
app/src/main/java/com/shunzhi/parent/api/MineApi.java 0 → 100644
... ... @@ -0,0 +1,35 @@
  1 +package com.shunzhi.parent.api;
  2 +
  3 +import com.google.gson.JsonObject;
  4 +
  5 +import io.reactivex.Observable;
  6 +import retrofit2.http.Field;
  7 +import retrofit2.http.FormUrlEncoded;
  8 +import retrofit2.http.POST;
  9 +
  10 +/**
  11 + * Created by Administrator on 2018/3/7 0007.
  12 + */
  13 +
  14 +public interface MineApi {
  15 + // String url="http://campus.myjxt.com/";
  16 + String url = "http://60.190.202.57:1000/";
  17 +
  18 + @FormUrlEncoded
  19 + @POST("/api/ParentHelper/GetAreaSchool")
  20 + Observable<JsonObject> getSchoolListResult(
  21 + @Field("areaName") String areaName, @Field("Keyword") String Keyword);
  22 +
  23 + @FormUrlEncoded
  24 + @POST("/api/ParentHelper/UpdateParentInfo")
  25 + Observable<JsonObject> getChangeInfoResult(
  26 + @Field("parentName") String parentName, @Field("sex") int sex, @Field("mobile") String mobile);
  27 +
  28 + @FormUrlEncoded
  29 + @POST("/api/ParentHelper/BindlingChildren")
  30 + Observable<JsonObject> addChildResult(
  31 + @Field("parentId") int parentId, @Field("mobileFlag") boolean mobileFlag, @Field("cooperateFlag") boolean cooperateFlag
  32 + , @Field("schoolId") int schoolId, @Field("classId") int classId, @Field("studentId") int studentId, @Field("studentUserId") String studentUserId);
  33 +
  34 +}
  35 +
... ...
app/src/main/java/com/shunzhi/parent/bean/ChildBean.java
1 1 package com.shunzhi.parent.bean;
2 2  
  3 +import java.io.Serializable;
  4 +
3 5 /**
4 6 * Created by Administrator on 2018/3/9 0009.
5 7 */
6 8  
7   -public class ChildBean {
8   -}
  9 +public class ChildBean implements Serializable{
  10 + private String studentUserId;
  11 + private int parentMobile;
  12 + private int parentId;
  13 + private boolean mobileFlag;
  14 + private boolean bindingState;
  15 + private boolean cooperateFlag;
  16 + private int schoolId;
  17 + private String schoolName;
  18 + private int grade;
  19 + private String gradename;
  20 + private int classId;
  21 + private String className;
  22 + private int studentId;
  23 + private String studentName;
  24 + private String photo;
  25 + private int sex;
  26 +
  27 + public String getStudentName() {
  28 + return studentName;
  29 + }
  30 +
  31 + public void setStudentName(String studentName) {
  32 + this.studentName = studentName;
  33 + }
  34 +
  35 + public int getParentMobile() {
  36 + return parentMobile;
  37 + }
  38 +
  39 + public void setParentMobile(int parentMobile) {
  40 + this.parentMobile = parentMobile;
  41 + }
  42 +
  43 + public int getParentId() {
  44 + return parentId;
  45 + }
  46 +
  47 + public void setParentId(int parentId) {
  48 + this.parentId = parentId;
  49 + }
  50 +
  51 + public boolean isMobileFlag() {
  52 + return mobileFlag;
  53 + }
  54 +
  55 + public void setMobileFlag(boolean mobileFlag) {
  56 + this.mobileFlag = mobileFlag;
  57 + }
  58 +
  59 + public boolean isBindingState() {
  60 + return bindingState;
  61 + }
  62 +
  63 + public void setBindingState(boolean bindingState) {
  64 + this.bindingState = bindingState;
  65 + }
  66 +
  67 + public boolean isCooperateFlag() {
  68 + return cooperateFlag;
  69 + }
  70 +
  71 + public void setCooperateFlag(boolean cooperateFlag) {
  72 + this.cooperateFlag = cooperateFlag;
  73 + }
  74 +
  75 + public int getSchoolId() {
  76 + return schoolId;
  77 + }
  78 +
  79 + public void setSchoolId(int schoolId) {
  80 + this.schoolId = schoolId;
  81 + }
  82 +
  83 + public String getSchoolName() {
  84 + return schoolName;
  85 + }
  86 +
  87 + public void setSchoolName(String schoolName) {
  88 + this.schoolName = schoolName;
  89 + }
  90 +
  91 + public int getGrade() {
  92 + return grade;
  93 + }
  94 +
  95 + public void setGrade(int grade) {
  96 + this.grade = grade;
  97 + }
  98 +
  99 + public String getGradename() {
  100 + return gradename;
  101 + }
  102 +
  103 + public void setGradename(String gradename) {
  104 + this.gradename = gradename;
  105 + }
  106 +
  107 + public int getClassId() {
  108 + return classId;
  109 + }
  110 +
  111 + public void setClassId(int classId) {
  112 + this.classId = classId;
  113 + }
  114 +
  115 + public String getClassName() {
  116 + return className;
  117 + }
  118 +
  119 + public void setClassName(String className) {
  120 + this.className = className;
  121 + }
  122 +
  123 + public int getStudentId() {
  124 + return studentId;
  125 + }
  126 +
  127 + public void setStudentId(int studentId) {
  128 + this.studentId = studentId;
  129 + }
  130 +
  131 + public String getStudentUserId() {
  132 + return studentUserId;
  133 + }
  134 +
  135 + public void setStudentUserId(String studentUserId) {
  136 + this.studentUserId = studentUserId;
  137 + }
  138 +
  139 + public String getPhoto() {
  140 + return photo;
  141 + }
  142 +
  143 + public void setPhoto(String photo) {
  144 + this.photo = photo;
  145 + }
  146 +
  147 + public int getSex() {
  148 + return sex;
  149 + }
  150 +
  151 + public void setSex(int sex) {
  152 + this.sex = sex;
  153 + }
  154 +
  155 + @Override
  156 + public String toString() {
  157 + return "ChildBean{" +
  158 + "parentMobile='" + parentMobile + '\'' +
  159 + ",parentId='" + parentId + '\'' +
  160 + ",mobileFlag='" + mobileFlag + '\'' +
  161 + ",bindingState='" + bindingState + '\'' +
  162 + ",cooperateFlag='" + cooperateFlag + '\'' +
  163 + ",schoolId='" + schoolId + '\'' +
  164 + ",schoolName='" + schoolName + '\'' +
  165 + ",grade='" + grade + '\'' +
  166 + ",gradename='" + gradename + '\'' +
  167 + ",classId='" + classId + '\'' +
  168 + ",className='" + className + '\'' +
  169 + ",studentId='" + studentId + '\'' +
  170 + ",studentName='" + studentName + '\'' +
  171 + ",studentUserId='" + studentUserId + '\'' +
  172 + ",photo='" + photo + '\'' +
  173 + ", sex=" + sex +
  174 + "}";
  175 + }
  176 +}
9 177 \ No newline at end of file
... ...
app/src/main/java/com/shunzhi/parent/bean/CurrentBean.java
1 1 package com.shunzhi.parent.bean;
2 2  
  3 +import java.io.Serializable;
  4 +import java.util.List;
  5 +
3 6 /**
4 7 * Created by Administrator on 2018/3/13 0013.
5 8 */
6 9  
7   -public class CurrentBean {
  10 +public class CurrentBean implements Serializable{
  11 + private String userid;
  12 + private String name;
  13 + private String image;
  14 + private String mobile;
  15 + private boolean bindSchoolFlag;
  16 + private boolean bindingChildrenFlag;
  17 + private int parentId;
  18 + private int sex;
  19 + private List<ChildBean> studentClass;
  20 +
  21 +
  22 + public int getParentId() {
  23 + return parentId;
  24 + }
  25 +
  26 + public void setParentId(int parentId) {
  27 + this.parentId = parentId;
  28 + }
  29 +
  30 + public int getSex() {
  31 + return sex;
  32 + }
  33 +
  34 + public void setSex(int sex) {
  35 + this.sex = sex;
  36 + }
  37 +
  38 + public String getUserid() {
  39 + return userid;
  40 + }
  41 +
  42 + public void setUserid(String userid) {
  43 + this.userid = userid;
  44 + }
  45 +
  46 + public String getName() {
  47 + return name;
  48 + }
  49 +
  50 + public void setName(String name) {
  51 + this.name = name;
  52 + }
  53 +
  54 + public String getImage() {
  55 + return image;
  56 + }
  57 +
  58 + public void setImage(String image) {
  59 + this.image = image;
  60 + }
  61 +
  62 + public String getMobile() {
  63 + return mobile;
  64 + }
  65 +
  66 + public void setMobile(String mobile) {
  67 + this.mobile = mobile;
  68 + }
  69 +
  70 + public boolean isBindSchoolFlag() {
  71 + return bindSchoolFlag;
  72 + }
  73 +
  74 + public void setBindSchoolFlag(boolean bindSchoolFlag) {
  75 + this.bindSchoolFlag = bindSchoolFlag;
  76 + }
  77 +
  78 + public boolean isBindingChildrenFlag() {
  79 + return bindingChildrenFlag;
  80 + }
  81 +
  82 + public void setBindingChildrenFlag(boolean bindingChildrenFlag) {
  83 + this.bindingChildrenFlag = bindingChildrenFlag;
  84 + }
8 85  
  86 + public List<ChildBean> getStudentClass() {
  87 + return studentClass;
  88 + }
9 89  
  90 + public void setStudentClass(List<ChildBean> studentClass) {
  91 + this.studentClass = studentClass;
  92 + }
10 93  
  94 + @Override
  95 + public String toString() {
  96 + return "CurrentBean{" +
  97 + ", userid='" + userid + '\'' +
  98 + ", name='" + name + '\'' +
  99 + ", image='" + image + '\'' +
  100 + ", mobile='" + mobile + '\'' +
  101 + ", parentId='" + parentId + '\'' +
  102 + ", bindSchoolFlag='" + bindSchoolFlag + '\'' +
  103 + ", bindingChildrenFlag='" + bindingChildrenFlag + '\'' +
  104 + ", sex='" + sex + '\'' +
  105 + ", studentClass='" + studentClass +
  106 + "}";
  107 + }
11 108 }
... ...
app/src/main/java/com/shunzhi/parent/bean/SchoolBean.java
1 1 package com.shunzhi.parent.bean;
2 2  
  3 +import org.json.JSONObject;
  4 +
3 5 /**
4 6 * Created by Administrator on 2018/3/9 0009.
5 7 */
6 8  
7 9 public class SchoolBean {
8   - String schoolname;
9   - String SortLetters;
  10 + public String school_name;
  11 + public String school_area;
  12 + public String school_id;
  13 + public String isNew;
10 14  
11   - public String getSchoolname() {
12   - return schoolname;
13   - }
  15 + public SchoolBean(JSONObject data){
  16 + this.school_name=data.optString("school_name");
  17 + this.school_area =data.optString("school_area");
  18 + this.school_id =data.optString("school_id");
  19 + this.isNew =data.optString("isNew");
14 20  
15   - public void setSchoolname(String schoolname) {
16   - this.schoolname = schoolname;
17 21 }
18 22  
19   - public String getSortLetters() {
20   - return SortLetters;
21   - }
22   -
23   - public void setSortLetters(String sortLetters) {
24   - SortLetters = sortLetters;
25   - }
26 23 }
... ...
app/src/main/java/com/shunzhi/parent/bean/SortBean.java 0 → 100644
... ... @@ -0,0 +1,52 @@
  1 +package com.shunzhi.parent.bean;
  2 +
  3 +/**
  4 + * Created by Administrator on 2018/3/9 0009.
  5 + */
  6 +
  7 +public class SortBean {
  8 + String school_name;
  9 + String SortLetters;
  10 + String school_area;
  11 + String school_id;
  12 + String isNew;
  13 +
  14 + public String getSchool_name() {
  15 + return school_name;
  16 + }
  17 +
  18 + public void setSchool_name(String school_name) {
  19 + this.school_name = school_name;
  20 + }
  21 +
  22 + public String getSchool_area() {
  23 + return school_area;
  24 + }
  25 +
  26 + public void setSchool_area(String school_area) {
  27 + this.school_area = school_area;
  28 + }
  29 +
  30 + public String getSchool_id() {
  31 + return school_id;
  32 + }
  33 +
  34 + public void setSchool_id(String school_id) {
  35 + this.school_id = school_id;
  36 + }
  37 +
  38 + public String getIsNew() {
  39 + return isNew;
  40 + }
  41 +
  42 + public void setIsNew(String isNew) {
  43 + this.isNew = isNew;
  44 + }
  45 + public String getSortLetters() {
  46 + return SortLetters;
  47 + }
  48 +
  49 + public void setSortLetters(String sortLetters) {
  50 + SortLetters = sortLetters;
  51 + }
  52 +}
... ...
app/src/main/java/com/shunzhi/parent/bean/UserInfo.java 0 → 100644
... ... @@ -0,0 +1,13 @@
  1 +package com.shunzhi.parent.bean;
  2 +
  3 +import com.share.mvpsdk.base.entity.BaseEntity;
  4 +
  5 +/**
  6 + * Created by Administrator on 2018/3/14 0014.
  7 + */
  8 +
  9 +public class UserInfo extends BaseEntity<CurrentBean> {
  10 +
  11 +
  12 +
  13 +}
... ...
app/src/main/java/com/shunzhi/parent/contract/loginandregister/LoginAndRegisterContract.java
... ... @@ -4,7 +4,7 @@ import com.google.gson.JsonObject;
4 4 import com.share.mvpsdk.base.BasePresenter;
5 5 import com.share.mvpsdk.base.IBaseFragment;
6 6 import com.share.mvpsdk.base.IBaseModel;
7   -import com.shunzhi.parent.bean.CurrentBean;
  7 +import com.shunzhi.parent.bean.UserInfo;
8 8  
9 9 import io.reactivex.Observable;
10 10  
... ... @@ -21,7 +21,7 @@ public interface LoginAndRegisterContract {
21 21  
22 22 public abstract void idCodeResult(String phoneNumber);
23 23  
24   - public abstract void getUserInfo();
  24 + public abstract void getUserInfo(String mobile,int school_id,String captcha);
25 25 }
26 26  
27 27 interface ILoginModel extends IBaseModel{
... ... @@ -32,12 +32,12 @@ public interface LoginAndRegisterContract {
32 32 Observable<JsonObject> getidCodeResult(String phoneNumber);
33 33  
34 34 //获取登录用户信息
35   - Observable<CurrentBean> getUserInfo();
  35 + Observable<UserInfo> getUserInfo(String mobile, int school_id, String captcha);
36 36 }
37 37 interface ILoginView extends IBaseFragment {
38 38  
39 39 //更新用户信息
40   - void getUserInfo();
  40 + void getUserInfo(int type);
41 41  
42 42 }
43 43  
... ...
app/src/main/java/com/shunzhi/parent/contract/mine/MyChildContract.java
1 1 package com.shunzhi.parent.contract.mine;
2 2  
  3 +import com.google.gson.JsonObject;
3 4 import com.share.mvpsdk.base.BasePresenter;
4 5 import com.share.mvpsdk.base.IBaseActivity;
5 6 import com.share.mvpsdk.base.IBaseModel;
6 7 import com.shunzhi.parent.bean.ChildBean;
  8 +import com.shunzhi.parent.bean.UserInfo;
7 9  
8 10 import java.util.List;
9 11  
  12 +import io.reactivex.Observable;
  13 +
10 14 /**
11 15 * Created by Administrator on 2018/3/9 0009.
12 16 */
13 17  
14 18 public interface MyChildContract {
15 19  
16   - abstract class MyChildPresenter extends BasePresenter<IMyChildModel,IMyChildView> {
17   - public abstract void loadChildList();
  20 + abstract class MyChildPresenter extends BasePresenter<IMyChildModel, IMyChildView> {
  21 + public abstract void loadChildList(String mobile, int school_id, String captcha);
  22 + public abstract void addChild(int parentId, boolean mobileFlag,boolean cooperateFlag
  23 + , int schoolId,int classId,int studentId,String studentUserId);
18 24  
19 25 }
20 26  
21   - interface IMyChildModel extends IBaseModel{
  27 + interface IMyChildModel extends IBaseModel {
  28 + Observable<UserInfo> getUserInfo(String mobile, int school_id, String captcha);
  29 + Observable<JsonObject> addChildResult(int parentId, boolean mobileFlag,boolean cooperateFlag
  30 + , int schoolId,int classId,int studentId,String studentUserId);
  31 +
22 32  
23 33 }
24   - interface IMyChildView extends IBaseActivity{
  34 +
  35 + interface IMyChildView extends IBaseActivity {
25 36 void updateChilsList(List<ChildBean> list);
26 37  
27 38 }
... ...
app/src/main/java/com/shunzhi/parent/contract/mine/PersonInfoContract.java
1 1 package com.shunzhi.parent.contract.mine;
2 2  
  3 +import com.google.gson.JsonObject;
3 4 import com.share.mvpsdk.base.BasePresenter;
4 5 import com.share.mvpsdk.base.IBaseActivity;
5 6 import com.share.mvpsdk.base.IBaseModel;
6 7  
  8 +import io.reactivex.Observable;
  9 +
7 10 /**
8 11 * Created by Administrator on 2018/3/10 0010.
9 12 */
10 13  
11 14 public interface PersonInfoContract {
12 15  
13   - abstract class PersonInfoPresenter extends BasePresenter<IPersonInfoModel,IPersonInfoView> {
14   -
  16 + abstract class PersonInfoPresenter extends BasePresenter<IPersonInfoModel, IPersonInfoView> {
  17 + public abstract void ChangeInfoResult(String parentName, int sex, String mobile);
15 18 }
16 19  
17 20  
18 21 interface IPersonInfoModel extends IBaseModel {
19   -
  22 + Observable<JsonObject> getChangeInfoResult(String parentName, int sex, String mobile);
20 23  
21 24 }
22   - interface IPersonInfoView extends IBaseActivity {
23 25  
  26 + interface IPersonInfoView extends IBaseActivity {
  27 + void updateInfo();
24 28  
25 29 }
26 30  
... ...
app/src/main/java/com/shunzhi/parent/contract/mine/SchoolListContract.java 0 → 100644
... ... @@ -0,0 +1,31 @@
  1 +package com.shunzhi.parent.contract.mine;
  2 +
  3 +import com.google.gson.JsonObject;
  4 +import com.share.mvpsdk.base.BasePresenter;
  5 +import com.share.mvpsdk.base.IBaseActivity;
  6 +import com.share.mvpsdk.base.IBaseModel;
  7 +import com.shunzhi.parent.bean.SchoolBean;
  8 +
  9 +import java.util.List;
  10 +
  11 +import io.reactivex.Observable;
  12 +
  13 +/**
  14 + * Created by Administrator on 2018/3/13 0013.
  15 + */
  16 +
  17 +public interface SchoolListContract {
  18 + abstract class SchoolListPrasenter extends BasePresenter<ISchoolListModel,ISchoolListView> {
  19 + public abstract void schoolListResult(String areaName, String key);
  20 + }
  21 +
  22 + interface ISchoolListModel extends IBaseModel {
  23 + Observable<JsonObject> getSchoolListResult(String areaName, String key);
  24 +
  25 +
  26 + }
  27 + interface ISchoolListView extends IBaseActivity {
  28 + void showList(List<SchoolBean> list);
  29 + }
  30 +
  31 +}
... ...
app/src/main/java/com/shunzhi/parent/model/loginandregister/LoginAndRegisterModel.java
... ... @@ -5,7 +5,7 @@ import com.share.mvpsdk.base.BaseModel;
5 5 import com.share.mvpsdk.helper.RetrofitCreateHelper;
6 6 import com.share.mvpsdk.helper.RxHelper;
7 7 import com.shunzhi.parent.api.LoginRegisterApi;
8   -import com.shunzhi.parent.bean.CurrentBean;
  8 +import com.shunzhi.parent.bean.UserInfo;
9 9 import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract;
10 10  
11 11 import io.reactivex.Observable;
... ... @@ -42,9 +42,9 @@ public class LoginAndRegisterModel extends BaseModel implements LoginAndRegiste
42 42 }
43 43  
44 44 @Override
45   - public Observable<CurrentBean> getUserInfo() {
46   - return RetrofitCreateHelper.getInstance().createApi(LoginRegisterApi.class,LoginRegisterApi.url).getUserInfo()
47   - .compose(RxHelper.<CurrentBean>rxSchedulerHelper());
  45 + public Observable<UserInfo> getUserInfo(String mobile, int school_id, String captcha) {
  46 + return RetrofitCreateHelper.getInstance().createApi(LoginRegisterApi.class,LoginRegisterApi.url).getUserInfo(mobile,school_id,captcha)
  47 + .compose(RxHelper.<UserInfo>rxSchedulerHelper());
48 48 }
49 49  
50 50 }
... ...
app/src/main/java/com/shunzhi/parent/model/mine/MyChildModel.java
1 1 package com.shunzhi.parent.model.mine;
2 2  
  3 +import com.google.gson.JsonObject;
3 4 import com.share.mvpsdk.base.BaseModel;
  5 +import com.share.mvpsdk.helper.RetrofitCreateHelper;
  6 +import com.share.mvpsdk.helper.RxHelper;
  7 +import com.shunzhi.parent.api.LoginRegisterApi;
  8 +import com.shunzhi.parent.api.MineApi;
  9 +import com.shunzhi.parent.bean.UserInfo;
4 10 import com.shunzhi.parent.contract.mine.MyChildContract;
5 11  
  12 +import io.reactivex.Observable;
  13 +
6 14 /**
7 15 * Created by Administrator on 2018/3/8 0008.
8 16 */
... ... @@ -11,4 +19,19 @@ public class MyChildModel extends BaseModel implements MyChildContract.IMyChildM
11 19 public static MyChildModel newInstance() {
12 20 return new MyChildModel();
13 21 }
  22 +
  23 + @Override
  24 + public Observable<UserInfo> getUserInfo(String mobile, int school_id, String captcha) {
  25 + return RetrofitCreateHelper.getInstance().createApi(LoginRegisterApi.class,LoginRegisterApi.url).getUserInfo(mobile,school_id,captcha)
  26 + .compose(RxHelper.<UserInfo>rxSchedulerHelper());
  27 + }
  28 +
  29 +
  30 +
  31 + @Override
  32 + public Observable<JsonObject> addChildResult(int parentId, boolean mobileFlag,boolean cooperateFlag
  33 + , int schoolId,int classId,int studentId,String studentUserId) {
  34 + return RetrofitCreateHelper.getInstance().createApi(MineApi.class,MineApi.url).addChildResult(parentId,mobileFlag,cooperateFlag,schoolId
  35 + ,classId,studentId,studentUserId).compose(RxHelper.<JsonObject>rxSchedulerHelper());
  36 + }
14 37 }
... ...
app/src/main/java/com/shunzhi/parent/model/mine/PersonInfoModel.java
1 1 package com.shunzhi.parent.model.mine;
2 2  
  3 +import com.google.gson.JsonObject;
3 4 import com.share.mvpsdk.base.BaseModel;
  5 +import com.share.mvpsdk.helper.RetrofitCreateHelper;
  6 +import com.share.mvpsdk.helper.RxHelper;
  7 +import com.shunzhi.parent.api.MineApi;
4 8 import com.shunzhi.parent.contract.mine.PersonInfoContract;
5 9  
  10 +import io.reactivex.Observable;
  11 +
6 12 /**
7 13 * Created by Administrator on 2018/3/10 0010.
8 14 */
... ... @@ -11,4 +17,10 @@ public class PersonInfoModel extends BaseModel implements PersonInfoContract.IPe
11 17 public static PersonInfoModel newInstance() {
12 18 return new PersonInfoModel();
13 19 }
  20 +
  21 + @Override
  22 + public Observable<JsonObject> getChangeInfoResult(String parentName, int sex, String mobile) {
  23 + return RetrofitCreateHelper.getInstance().createApi(MineApi.class, MineApi.url).getChangeInfoResult(parentName, sex, mobile)
  24 + .compose(RxHelper.<JsonObject>rxSchedulerHelper());
  25 + }
14 26 }
... ...
app/src/main/java/com/shunzhi/parent/model/mine/SchoolListModel.java 0 → 100644
... ... @@ -0,0 +1,26 @@
  1 +package com.shunzhi.parent.model.mine;
  2 +
  3 +import com.google.gson.JsonObject;
  4 +import com.share.mvpsdk.base.BaseModel;
  5 +import com.share.mvpsdk.helper.RetrofitCreateHelper;
  6 +import com.share.mvpsdk.helper.RxHelper;
  7 +import com.shunzhi.parent.api.MineApi;
  8 +import com.shunzhi.parent.contract.mine.SchoolListContract;
  9 +
  10 +import io.reactivex.Observable;
  11 +
  12 +/**
  13 + * Created by Administrator on 2018/3/13 0013.
  14 + */
  15 +
  16 +public class SchoolListModel extends BaseModel implements SchoolListContract.ISchoolListModel {
  17 + public static SchoolListModel newInstance() {
  18 + return new SchoolListModel();
  19 + }
  20 +
  21 + @Override
  22 + public Observable<JsonObject> getSchoolListResult(String areaName, String key) {
  23 + return RetrofitCreateHelper.getInstance().createApi(MineApi.class,MineApi.url).getSchoolListResult(areaName,key)
  24 + .compose(RxHelper.<JsonObject>rxSchedulerHelper());
  25 + }
  26 +}
... ...
app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
... ... @@ -9,8 +9,11 @@ import com.share.mvpsdk.utils.OkHttpExceptionUtil;
9 9 import com.share.mvpsdk.utils.ToastUtils;
10 10 import com.shunzhi.parent.AppConfig;
11 11 import com.shunzhi.parent.AppContext;
  12 +import com.shunzhi.parent.bean.CurrentBean;
  13 +import com.shunzhi.parent.bean.UserInfo;
12 14 import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract;
13 15 import com.shunzhi.parent.model.loginandregister.LoginAndRegisterModel;
  16 +import com.shunzhi.parent.ui.fragment.loginandregistfragment.LoginAndRegistFragment;
14 17  
15 18 import java.util.regex.Matcher;
16 19 import java.util.regex.Pattern;
... ... @@ -45,7 +48,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre
45 48 AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, loginName);
46 49 AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_PWD, loginPwd);
47 50 RetrofitCreateHelper.getInstance().setAuthorization("Bearer " + jsonObject.get("access_token").getAsString());
48   - getUserInfo();
  51 + getUserInfo(loginName, 0, "");
49 52 } else {
50 53 ToastUtils.showToast(jsonObject.get("error").getAsString());
51 54 }
... ... @@ -66,12 +69,14 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre
66 69 }
67 70  
68 71 @Override
69   - public void registerResult(String adminName, String idCode, String password) {
  72 + public void registerResult(final String adminName, String idCode, final String password) {
70 73 if (!isMate(adminName, REGEX_MOBILE)) {
71 74 ToastUtils.showToast("请输入正确的手机号!!");
  75 + LoginAndRegistFragment.progressDialog.dismiss();
72 76 return;
73 77 }
74 78 if (mIModel == null || mIView == null) {
  79 + LoginAndRegistFragment.progressDialog.dismiss();
75 80 return;
76 81 }
77 82  
... ... @@ -80,12 +85,14 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre
80 85 public void accept(JsonObject jsonObject) throws Exception {
81 86 //TODO 注册成功返回
82 87 Log.e("1111", jsonObject.toString());
83   - mIView.getUserInfo();
  88 + AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, adminName);
  89 + AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_PWD, password);
  90 + mIView.getUserInfo(1);
84 91 }
85 92 }, new Consumer<Throwable>() {
86 93 @Override
87 94 public void accept(Throwable throwable) throws Exception {
88   - ToastUtils.showToast(throwable.getMessage());
  95 + LoginAndRegistFragment.progressDialog.dismiss();
89 96 OkHttpExceptionUtil.handOkHttpException((HttpException) throwable);
90 97 }
91 98 }));
... ... @@ -93,7 +100,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre
93 100 }
94 101  
95 102 @Override
96   - public void idCodeResult(String phoneNumber) {
  103 + public void idCodeResult(final String phoneNumber) {
97 104 if (!isMate(phoneNumber, REGEX_MOBILE)) {
98 105 ToastUtils.showToast("请输入正确的手机号!!");
99 106 return;
... ... @@ -110,7 +117,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre
110 117 }, new Consumer<Throwable>() {
111 118 @Override
112 119 public void accept(Throwable throwable) throws Exception {
113   - ToastUtils.showToast(throwable.getMessage());
  120 + OkHttpExceptionUtil.handOkHttpException((HttpException) throwable);
114 121 }
115 122 }));
116 123  
... ... @@ -118,8 +125,32 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre
118 125 }
119 126  
120 127 @Override
121   - public void getUserInfo() {
122   -// Log.d("77777", "getUserInfo=");
  128 +
  129 + public void getUserInfo(final String mobile, int school_id, String captcha) {
  130 + mRxManager.register(mIModel.getUserInfo(mobile, school_id, captcha).subscribe(new Consumer<UserInfo>() {
  131 + @Override
  132 + public void accept(UserInfo userInfo) throws Exception {
  133 +
  134 + if (userInfo != null) {
  135 + CurrentBean currentBean = userInfo.getData();
  136 + AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, currentBean.getMobile());
  137 + AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_NAME, currentBean.getName());
  138 + AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_IMAGE, currentBean.getImage());
  139 + AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_SEX, String.valueOf(currentBean.getSex()));
  140 + mIView.getUserInfo(0);
  141 +
  142 + } else {
  143 + LoginAndRegistFragment.progressDialog.dismiss();
  144 + ToastUtils.showToast("错误");
  145 + }
  146 + }
  147 + }, new Consumer<Throwable>() {
  148 + @Override
  149 + public void accept(Throwable throwable) throws Exception {
  150 + LoginAndRegistFragment.progressDialog.dismiss();
  151 + OkHttpExceptionUtil.handOkHttpException((HttpException) throwable);
  152 + }
  153 + }));
123 154 }
124 155  
125 156  
... ...
app/src/main/java/com/shunzhi/parent/presenter/mine/MyChildPresenter.java
1 1 package com.shunzhi.parent.presenter.mine;
2 2  
  3 +import android.util.Log;
  4 +
  5 +import com.google.gson.JsonObject;
  6 +import com.share.mvpsdk.utils.OkHttpExceptionUtil;
  7 +import com.share.mvpsdk.utils.ToastUtils;
3 8 import com.shunzhi.parent.bean.ChildBean;
  9 +import com.shunzhi.parent.bean.CurrentBean;
  10 +import com.shunzhi.parent.bean.UserInfo;
4 11 import com.shunzhi.parent.contract.mine.MyChildContract;
5 12 import com.shunzhi.parent.model.mine.MyChildModel;
6 13  
7   -import java.util.ArrayList;
8 14 import java.util.List;
9 15  
  16 +import io.reactivex.functions.Consumer;
  17 +import retrofit2.HttpException;
  18 +
10 19 /**
11 20 * Created by Administrator on 2018/3/8 0008.
12 21 */
... ... @@ -24,14 +33,38 @@ public class MyChildPresenter extends MyChildContract.MyChildPresenter {
24 33 }
25 34  
26 35 @Override
27   - public void loadChildList() {
28   - ChildBean c=new ChildBean();
29   - List<ChildBean> l=new ArrayList<>();
30   - l.add(c);
31   - l.add(c);
32   - l.add(c);
33   - l.add(c);
34   - l.add(c);
35   - mIView.updateChilsList(l);
  36 + public void loadChildList(String mobile, int school_id, String captcha) {
  37 + mRxManager.register(mIModel.getUserInfo(mobile, school_id, captcha).subscribe(new Consumer<UserInfo>() {
  38 + @Override
  39 + public void accept(UserInfo userInfo) throws Exception {
  40 + CurrentBean currentBean = userInfo.getData();
  41 + List<ChildBean> list = currentBean.getStudentClass();
  42 + mIView.updateChilsList(list);
  43 + }
  44 + }, new Consumer<Throwable>() {
  45 + @Override
  46 + public void accept(Throwable throwable) throws Exception {
  47 + OkHttpExceptionUtil.handOkHttpException((HttpException) throwable);
  48 + }
  49 + }));
  50 +
  51 + }
  52 +
  53 + @Override
  54 + public void addChild(int parentId, boolean mobileFlag, boolean cooperateFlag, int schoolId, int classId, int studentId, String studentUserId) {
  55 + mRxManager.register(mIModel.addChildResult(parentId, mobileFlag, cooperateFlag, schoolId, classId, studentId, studentUserId).subscribe(new Consumer<JsonObject>() {
  56 + @Override
  57 + public void accept(JsonObject jsonObject) throws Exception {
  58 + ToastUtils.showToast(jsonObject.toString());
  59 + }
  60 + }, new Consumer<Throwable>() {
  61 + @Override
  62 + public void accept(Throwable throwable) throws Exception {
  63 +
  64 + }
  65 + }));
  66 +
  67 +
36 68 }
  69 +
37 70 }
... ...
app/src/main/java/com/shunzhi/parent/presenter/mine/PersonInfoPrasenter.java
1 1 package com.shunzhi.parent.presenter.mine;
2 2  
  3 +import com.google.gson.JsonObject;
  4 +import com.share.mvpsdk.utils.OkHttpExceptionUtil;
  5 +import com.share.mvpsdk.utils.ToastUtils;
  6 +import com.shunzhi.parent.AppConfig;
  7 +import com.shunzhi.parent.AppContext;
3 8 import com.shunzhi.parent.contract.mine.PersonInfoContract;
  9 +import com.shunzhi.parent.model.mine.PersonInfoModel;
  10 +
  11 +import io.reactivex.functions.Consumer;
  12 +import retrofit2.HttpException;
4 13  
5 14 /**
6 15 * Created by Administrator on 2018/3/10 0010.
... ... @@ -9,11 +18,40 @@ import com.shunzhi.parent.contract.mine.PersonInfoContract;
9 18 public class PersonInfoPrasenter extends PersonInfoContract.PersonInfoPresenter {
10 19 @Override
11 20 public PersonInfoContract.IPersonInfoModel getModel() {
12   - return null;
  21 + return PersonInfoModel.newInstance();
13 22 }
14 23  
15 24 @Override
16 25 public void onStart() {
17 26  
18 27 }
  28 +
  29 + @Override
  30 + public void ChangeInfoResult(final String parentName, final int sex, String mobile) {
  31 +
  32 + mRxManager.register(mIModel.getChangeInfoResult(parentName, sex, mobile).subscribe(new Consumer<JsonObject>() {
  33 + @Override
  34 + public void accept(JsonObject jsonObject) throws Exception {
  35 + try {
  36 + if(jsonObject!=null&&jsonObject.get("data").getAsBoolean()) {
  37 + ToastUtils.showToast(jsonObject.toString());
  38 + AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_NAME, parentName);
  39 + AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.USER_SEX, String.valueOf(sex));
  40 + mIView.updateInfo();
  41 + }
  42 + } catch (Exception e) {
  43 + ToastUtils.showToast(e.toString());
  44 + }
  45 +
  46 + }
  47 + }, new Consumer<Throwable>() {
  48 + @Override
  49 + public void accept(Throwable throwable) throws Exception {
  50 + OkHttpExceptionUtil.handOkHttpException((HttpException) throwable);
  51 + mIView.updateInfo();
  52 + }
  53 + }));
  54 +
  55 +
  56 + }
19 57 }
... ...
app/src/main/java/com/shunzhi/parent/presenter/mine/SchoolListPrasenter.java 0 → 100644
... ... @@ -0,0 +1,56 @@
  1 +package com.shunzhi.parent.presenter.mine;
  2 +
  3 +import com.google.gson.Gson;
  4 +import com.google.gson.JsonArray;
  5 +import com.google.gson.JsonObject;
  6 +import com.share.mvpsdk.utils.OkHttpExceptionUtil;
  7 +import com.shunzhi.parent.bean.SchoolBean;
  8 +import com.shunzhi.parent.contract.mine.SchoolListContract;
  9 +import com.shunzhi.parent.model.mine.SchoolListModel;
  10 +
  11 +import java.util.ArrayList;
  12 +import java.util.Iterator;
  13 +import java.util.List;
  14 +
  15 +import io.reactivex.functions.Consumer;
  16 +import retrofit2.HttpException;
  17 +
  18 +/**
  19 + * Created by Administrator on 2018/3/13 0013.
  20 + */
  21 +
  22 +public class SchoolListPrasenter extends SchoolListContract.SchoolListPrasenter {
  23 + @Override
  24 + public SchoolListContract.ISchoolListModel getModel() {
  25 + return SchoolListModel.newInstance();
  26 + }
  27 +
  28 + @Override
  29 + public void onStart() {
  30 +
  31 + }
  32 +
  33 + @Override
  34 + public void schoolListResult(String areaName, String key) {
  35 + mRxManager.register(mIModel.getSchoolListResult(areaName, key).subscribe(new Consumer<JsonObject>() {
  36 + @Override
  37 + public void accept(JsonObject jsonObject) throws Exception {
  38 + List<SchoolBean> list = new ArrayList();
  39 + Gson gson = new Gson();
  40 + JsonArray jsonArray = jsonObject.getAsJsonArray("data");
  41 + Iterator it = jsonArray.iterator(); //Iterator处理
  42 + while (it.hasNext()) { //循环
  43 + SchoolBean person = gson.fromJson(it.next().toString(), SchoolBean.class); //String转化成JavaBean
  44 + list.add(person); //加入Listlist
  45 + }
  46 + mIView.showList(list);
  47 + }
  48 + }, new Consumer<Throwable>() {
  49 + @Override
  50 + public void accept(Throwable throwable) throws Exception {
  51 + OkHttpExceptionUtil.handOkHttpException((HttpException) throwable);
  52 + }
  53 + }));
  54 +
  55 + }
  56 +}
... ...
app/src/main/java/com/shunzhi/parent/ui/MainActivity.java
... ... @@ -5,6 +5,7 @@ import android.support.annotation.NonNull;
5 5 import android.support.design.widget.BottomNavigationView;
6 6 import android.support.v4.app.Fragment;
7 7 import android.support.v4.app.FragmentTransaction;
  8 +import android.util.Log;
8 9 import android.view.MenuItem;
9 10  
10 11 import com.share.mvpsdk.base.activity.BaseCompatActivity;
... ... @@ -17,6 +18,9 @@ import com.shunzhi.parent.ui.fragment.ConsultFragment;
17 18 import com.shunzhi.parent.ui.fragment.MineFragment;
18 19 import com.shunzhi.parent.ui.fragment.ReportFragment;
19 20  
  21 +import java.util.Calendar;
  22 +import java.util.Date;
  23 +
20 24 public class MainActivity extends BaseCompatActivity implements PermissionUtils.PermissionGrant {
21 25  
22 26 BottomNavigationView bottom_navigationView;
... ... @@ -37,6 +41,8 @@ public class MainActivity extends BaseCompatActivity implements PermissionUtils.
37 41  
38 42 @Override
39 43 protected void initView(Bundle savedInstanceState) {
  44 +
  45 +
40 46 PermissionUtils.requestMultiPermissions(this, this);
41 47 bottom_navigationView = findViewById(R.id.bottom_navigationView);
42 48  
... ... @@ -114,4 +120,11 @@ public class MainActivity extends BaseCompatActivity implements PermissionUtils.
114 120 public void onPermissionGranted(int requestCode) {
115 121  
116 122 }
  123 +
  124 + @Override
  125 + protected void onResume() {
  126 + super.onResume();
  127 + Date l= Calendar.getInstance().getTime();
  128 + Log.e("2222--==",l.getTime()+"");
  129 + }
117 130 }
... ...
app/src/main/java/com/shunzhi/parent/ui/activity/MyChildActivity.java
... ... @@ -16,6 +16,8 @@ import android.widget.TextView;
16 16  
17 17 import com.share.mvpsdk.base.BasePresenter;
18 18 import com.share.mvpsdk.base.activity.BaseMVPCompatActivity;
  19 +import com.shunzhi.parent.AppConfig;
  20 +import com.shunzhi.parent.AppContext;
19 21 import com.shunzhi.parent.R;
20 22 import com.shunzhi.parent.adapter.ChildAdapter;
21 23 import com.shunzhi.parent.bean.ChildBean;
... ... @@ -95,7 +97,7 @@ public class MyChildActivity extends BaseMVPCompatActivity&lt;MyChildContract.MyChi
95 97  
96 98 }
97 99 });
98   - mPresenter.loadChildList();
  100 + mPresenter.loadChildList(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME),0,"");
99 101 }
100 102  
101 103 @Override
... ...
app/src/main/java/com/shunzhi/parent/ui/activity/PersonInfoActivity.java
... ... @@ -3,10 +3,18 @@ package com.shunzhi.parent.ui.activity;
3 3  
4 4 import android.os.Bundle;
5 5 import android.support.annotation.NonNull;
  6 +import android.text.TextUtils;
6 7 import android.view.View;
  8 +import android.widget.EditText;
  9 +import android.widget.RadioButton;
  10 +import android.widget.TextView;
7 11  
  12 +import com.bumptech.glide.Glide;
  13 +import com.makeramen.roundedimageview.RoundedImageView;
8 14 import com.share.mvpsdk.base.BasePresenter;
9 15 import com.share.mvpsdk.base.activity.BaseMVPCompatActivity;
  16 +import com.shunzhi.parent.AppConfig;
  17 +import com.shunzhi.parent.AppContext;
10 18 import com.shunzhi.parent.R;
11 19 import com.shunzhi.parent.contract.mine.PersonInfoContract;
12 20 import com.shunzhi.parent.presenter.mine.PersonInfoPrasenter;
... ... @@ -15,8 +23,14 @@ import com.shunzhi.parent.presenter.mine.PersonInfoPrasenter;
15 23 * Created by Administrator on 2018/3/10 0010.
16 24 */
17 25  
18   -public class PersonInfoActivity extends BaseMVPCompatActivity<PersonInfoContract.PersonInfoPresenter,PersonInfoContract.IPersonInfoModel>
19   -implements PersonInfoContract.IPersonInfoView,View.OnClickListener{
  26 +public class PersonInfoActivity extends BaseMVPCompatActivity<PersonInfoContract.PersonInfoPresenter, PersonInfoContract.IPersonInfoModel>
  27 + implements PersonInfoContract.IPersonInfoView, View.OnClickListener {
  28 + RoundedImageView user_image;
  29 + TextView user_name, user_mobile, change_info;
  30 + EditText et_name;
  31 + RadioButton man, women;
  32 +
  33 +
20 34 @NonNull
21 35 @Override
22 36 public BasePresenter initPresenter() {
... ... @@ -25,6 +39,43 @@ implements PersonInfoContract.IPersonInfoView,View.OnClickListener{
25 39  
26 40 @Override
27 41 protected void initView(Bundle savedInstanceState) {
  42 + user_image = findViewById(R.id.user_photo);
  43 + user_name = findViewById(R.id.user_name);
  44 + user_mobile = findViewById(R.id.user_mobile);
  45 + et_name = findViewById(R.id.et_name);
  46 + et_name.setOnClickListener(this);
  47 + man = findViewById(R.id.man);
  48 + women = findViewById(R.id.women);
  49 + change_info = findViewById(R.id.change_info);
  50 + change_info.setOnClickListener(this);
  51 + initInfo();
  52 +
  53 +
  54 + }
  55 +
  56 + private void initInfo() {
  57 + String url = AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_IMAGE);
  58 + if (!TextUtils.isEmpty(url)) {
  59 + Glide.with(this).load(url).asBitmap().error(R.drawable.test).centerCrop().into(user_image);
  60 + } else {
  61 + Glide.with(this).load(R.drawable.test).centerCrop().into(user_image);
  62 + }
  63 + user_image.setCornerRadius(20);
  64 + user_image.setOval(true);
  65 + user_name.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_NAME));
  66 + user_mobile.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME));
  67 + et_name.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_NAME));
  68 + int sex = Integer.parseInt(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_SEX));
  69 + if (sex == 0) {
  70 + man.setChecked(false);
  71 + women.setChecked(false);
  72 + } else if (sex == 1) {
  73 + man.setChecked(true);
  74 + women.setChecked(false);
  75 + } else if (sex == 2) {
  76 + man.setChecked(false);
  77 + women.setChecked(true);
  78 + }
28 79  
29 80 }
30 81  
... ... @@ -35,6 +86,24 @@ implements PersonInfoContract.IPersonInfoView,View.OnClickListener{
35 86  
36 87 @Override
37 88 public void onClick(View v) {
  89 + if (v == et_name) {
38 90  
  91 + } else if (v == change_info) {
  92 + int sex = 0;
  93 + if (man.isChecked()) {
  94 + sex = 1;
  95 + }
  96 + if (women.isChecked()) {
  97 + sex = 2;
  98 + }
  99 +
  100 + mPresenter.ChangeInfoResult(et_name.getText().toString().trim(), sex, user_mobile.getText().toString().trim());
  101 +
  102 + }
  103 + }
  104 +
  105 + @Override
  106 + public void updateInfo() {
  107 + finish();
39 108 }
40 109 }
... ...
app/src/main/java/com/shunzhi/parent/ui/activity/binding/CheckInfoActivity.java
... ... @@ -2,29 +2,88 @@ package com.shunzhi.parent.ui.activity.binding;
2 2  
3 3 import android.os.Bundle;
4 4 import android.support.annotation.NonNull;
  5 +import android.util.Log;
  6 +import android.view.View;
  7 +import android.widget.LinearLayout;
  8 +import android.widget.TextView;
5 9  
6 10 import com.share.mvpsdk.base.BasePresenter;
7 11 import com.share.mvpsdk.base.activity.BaseMVPCompatActivity;
  12 +import com.share.mvpsdk.utils.ToastUtils;
  13 +import com.shunzhi.parent.AppConfig;
  14 +import com.shunzhi.parent.AppContext;
8 15 import com.shunzhi.parent.R;
  16 +import com.shunzhi.parent.bean.ChildBean;
  17 +import com.shunzhi.parent.contract.mine.MyChildContract;
  18 +import com.shunzhi.parent.presenter.mine.MyChildPresenter;
  19 +
  20 +import java.util.List;
9 21  
10 22 /**
11 23 * Created by Administrator on 2018/3/12 0012.
12 24 */
13 25  
14   -public class CheckInfoActivity extends BaseMVPCompatActivity{
  26 +public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyChildPresenter, MyChildContract.IMyChildModel>
  27 + implements MyChildContract.IMyChildView, View.OnClickListener {
  28 + int school_id;
  29 + LinearLayout iphone_layout;
  30 + TextView child_name, child_sex, child_grade, child_class, add_child, user_mobile;
  31 + ChildBean childBean;
  32 +
15 33 @NonNull
16 34 @Override
17 35 public BasePresenter initPresenter() {
18   - return null;
  36 + return new MyChildPresenter();
19 37 }
20 38  
21 39 @Override
22 40 protected void initView(Bundle savedInstanceState) {
  41 + iphone_layout = findViewById(R.id.iphone_layout);
  42 + child_name = findViewById(R.id.child_name);
  43 + child_sex = findViewById(R.id.child_sex);
  44 + child_grade = findViewById(R.id.child_grade);
  45 + child_class = findViewById(R.id.child_class);
  46 + add_child = findViewById(R.id.add_child);
  47 + add_child.setOnClickListener(this);
  48 + user_mobile = findViewById(R.id.user_mobile);
23 49  
  50 +// school_id = getIntent().getIntExtra("school_id", 0);
  51 +// Log.e("aaaa--==",school_id+"");
  52 + mPresenter.loadChildList(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME), 1, "");
24 53 }
25 54  
26 55 @Override
27 56 protected int getLayoutId() {
28 57 return R.layout.activity_check_info;
29 58 }
  59 +
  60 + @Override
  61 + public void onClick(View v) {
  62 + Log.e("qqqq--==",childBean.getStudentUserId());
  63 + mPresenter.addChild(0, true, true, 0, 0, 0, childBean.getStudentUserId());
  64 + }
  65 +
  66 + @Override
  67 + public void updateChilsList(List<ChildBean> list) {
  68 + if (list != null&&list.size()>0) {
  69 + childBean = list.get(0);
  70 + iphone_layout.setVisibility(View.VISIBLE);
  71 + user_mobile.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME));
  72 + child_name.setText(childBean.getStudentName());
  73 + int sex = childBean.getSex();
  74 + String sexStr = "未知";
  75 + if (sex == 1) {
  76 + sexStr = "男";
  77 + } else if (sex == 2) {
  78 +
  79 + sexStr = "女";
  80 + }
  81 + child_sex.setText(sexStr);
  82 + child_grade.setText(childBean.getGradename());
  83 + child_class.setText(childBean.getClassName());
  84 + } else {
  85 +
  86 + ToastUtils.showToast("1111111");
  87 + }
  88 + }
30 89 }
... ...
app/src/main/java/com/shunzhi/parent/ui/activity/binding/CreateChildInfoActivity.java 0 → 100644
... ... @@ -0,0 +1,30 @@
  1 +package com.shunzhi.parent.ui.activity.binding;
  2 +
  3 +import android.os.Bundle;
  4 +import android.support.annotation.NonNull;
  5 +
  6 +import com.share.mvpsdk.base.BasePresenter;
  7 +import com.share.mvpsdk.base.activity.BaseMVPCompatActivity;
  8 +import com.shunzhi.parent.R;
  9 +
  10 +/**
  11 + * Created by Administrator on 2018/3/13 0013.
  12 + */
  13 +
  14 +public class CreateChildInfoActivity extends BaseMVPCompatActivity{
  15 + @NonNull
  16 + @Override
  17 + public BasePresenter initPresenter() {
  18 + return null;
  19 + }
  20 +
  21 + @Override
  22 + protected void initView(Bundle savedInstanceState) {
  23 +
  24 + }
  25 +
  26 + @Override
  27 + protected int getLayoutId() {
  28 + return R.layout.activity_create_childinfo;
  29 + }
  30 +}
... ...
app/src/main/java/com/shunzhi/parent/ui/activity/binding/InviteCodeActivity.java 0 → 100644
... ... @@ -0,0 +1,48 @@
  1 +package com.shunzhi.parent.ui.activity.binding;
  2 +
  3 +import android.os.Bundle;
  4 +import android.support.annotation.NonNull;
  5 +import android.view.View;
  6 +
  7 +import com.share.mvpsdk.base.BasePresenter;
  8 +import com.share.mvpsdk.base.activity.BaseMVPCompatActivity;
  9 +import com.shunzhi.parent.R;
  10 +import com.shunzhi.parent.bean.ChildBean;
  11 +import com.shunzhi.parent.contract.mine.MyChildContract;
  12 +import com.shunzhi.parent.presenter.mine.MyChildPresenter;
  13 +
  14 +import java.util.List;
  15 +
  16 +/**
  17 + * Created by Administrator on 2018/3/14 0014.
  18 + */
  19 +
  20 +public class InviteCodeActivity extends BaseMVPCompatActivity<MyChildContract.MyChildPresenter, MyChildContract.IMyChildModel>
  21 + implements MyChildContract.IMyChildView, View.OnClickListener {
  22 +
  23 + @NonNull
  24 + @Override
  25 + public BasePresenter initPresenter() {
  26 + return new MyChildPresenter();
  27 + }
  28 +
  29 + @Override
  30 + public void updateChilsList(List<ChildBean> list) {
  31 +
  32 + }
  33 +
  34 + @Override
  35 + protected void initView(Bundle savedInstanceState) {
  36 +
  37 + }
  38 +
  39 + @Override
  40 + protected int getLayoutId() {
  41 + return R.layout.activity_invitecode;
  42 + }
  43 +
  44 + @Override
  45 + public void onClick(View v) {
  46 +
  47 + }
  48 +}
... ...
app/src/main/java/com/shunzhi/parent/ui/activity/binding/SelectSchoolActivity.java
... ... @@ -5,14 +5,20 @@ import android.os.Bundle;
5 5 import android.support.annotation.NonNull;
6 6 import android.support.v7.widget.LinearLayoutManager;
7 7 import android.support.v7.widget.RecyclerView;
  8 +import android.util.Log;
8 9 import android.view.View;
9 10 import android.widget.TextView;
10 11  
11 12 import com.share.mvpsdk.base.BasePresenter;
12 13 import com.share.mvpsdk.base.activity.BaseMVPCompatActivity;
  14 +import com.share.mvpsdk.utils.ToastUtils;
  15 +import com.shunzhi.parent.AppContext;
13 16 import com.shunzhi.parent.R;
14 17 import com.shunzhi.parent.adapter.SchoolListAdapter;
15 18 import com.shunzhi.parent.bean.SchoolBean;
  19 +import com.shunzhi.parent.bean.SortBean;
  20 +import com.shunzhi.parent.contract.mine.SchoolListContract;
  21 +import com.shunzhi.parent.presenter.mine.SchoolListPrasenter;
16 22 import com.shunzhi.parent.util.CharacterParser;
17 23 import com.shunzhi.parent.views.SideBar;
18 24  
... ... @@ -25,10 +31,11 @@ import java.util.List;
25 31 * Created by Administrator on 2018/3/12 0012.
26 32 */
27 33  
28   -public class SelectSchoolActivity extends BaseMVPCompatActivity implements View.OnClickListener{
  34 +public class SelectSchoolActivity extends BaseMVPCompatActivity<SchoolListContract.SchoolListPrasenter, SchoolListContract.ISchoolListModel> implements
  35 + View.OnClickListener, SchoolListContract.ISchoolListView {
29 36  
30 37 private SideBar sideBar;
31   - private TextView dialog,go_next;
  38 + private TextView dialog, go_next, tvLocalAddress;
32 39 private RecyclerView schoollist;
33 40 private List<String> list = new ArrayList<>();
34 41 SchoolListAdapter schoolListAdapter;
... ... @@ -36,78 +43,23 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity implements View.
36 43 @NonNull
37 44 @Override
38 45 public BasePresenter initPresenter() {
39   - return null;
  46 + return new SchoolListPrasenter();
40 47 }
41 48  
42 49 @Override
43 50 protected void initView(Bundle savedInstanceState) {
44 51 sideBar = findViewById(R.id.sidrbar);
45 52 dialog = findViewById(R.id.dialog);
46   - go_next=findViewById(R.id.go_next);
  53 + go_next = findViewById(R.id.go_next);
47 54 go_next.setOnClickListener(this);
  55 + tvLocalAddress = findViewById(R.id.tvLocalAddress);
  56 + tvLocalAddress.setText(AppContext.getInstance().cityName);
  57 + setSchoolList();
48 58  
49 59  
50   -
51   -
52   - list.add("阿尔卑斯");
53   - list.add("阿尔卑斯");
54   - list.add("阿尔卑斯");
55   - list.add("贝克街");
56   - list.add("贝克街");
57   - list.add("贝克街");
58   - list.add("贝克街");
59   - list.add("贝克街");
60   - list.add("阿尔卑斯");
61   - list.add("阿尔卑斯");
62   - list.add("贝克街");
63   - list.add("贝克街");
64   - list.add("阿尔卑斯");
65   - list.add("阿尔卑斯");
66   - list.add("阿尔卑斯");
67   - list.add("贝克街");
68   - list.add("贝克街");
69   - list.add("血色城堡");
70   - list.add("血色城堡");
71   - list.add("血色城堡");
72   - list.add("血色城堡");
73   - list.add("贝克街");
74   - list.add("贝克街");
75   - list.add("贝克街");
76   - list.add("贝克街");
77   - list.add("贝克街");
78   - list.add("贝克街");
79   - list.add("贝克街");
80   - list.add("贝克街");
81   - list.add("贝克街");
82   - list.add("血色城堡");
83   - list.add("血色城堡");
84   - list.add("血色城堡");
85   - list.add("血色城堡");
86   - list.add("贝克街");
87   - list.add("贝克街");
88   - list.add("贝克街");
89   - list.add("贝克街");
90   - list.add("贝克街");
91   - list.add("血色城堡");
92   - list.add("贝克街");
93   - list.add("贝克街");
94   - list.add("贝克街");
95   - list.add("贝克街");
96   - list.add("贝克街");
97   - list.add("贝克街");
98   - list.add("贝克街");
99   - list.add("贝克街");
100   - list.add("贝克街");
101   - list.add("血色城堡");
102   - list.add("血色城堡");
103   - list.add("血色城堡");
104   - list.add("血色城堡");
105 60 schoollist = findViewById(R.id.schoollist);
106 61 schoollist.setLayoutManager(new LinearLayoutManager(this));
107   - final List<SchoolBean>schoolList=OrderedSortSmodel(list);
108   - schoolListAdapter = new SchoolListAdapter(this,schoolList);
109   - schoolListAdapter.addAll(schoolList);
110   - schoollist.setAdapter(schoolListAdapter);
  62 +
111 63 sideBar.setOnTouchingLetterChangedListener(new SideBar.OnTouchingLetterChangedListener() {
112 64 @Override
113 65 public void onTouchingLetterChanged(String s) {
... ... @@ -125,21 +77,28 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity implements View.
125 77  
126 78 }
127 79  
  80 + private void setSchoolList() {
  81 + mPresenter.schoolListResult("杭州", "");
  82 + }
  83 +
128 84 @Override
129 85 protected int getLayoutId() {
130 86 return R.layout.activity_select_school;
131 87 }
132 88  
133 89  
134   - List<SchoolBean> OrderedSortSmodel(List<String> list) {
135   - List<SchoolBean> schoolList = new ArrayList<>();
  90 + List<SortBean> OrderedSortSmodel(List<SchoolBean> list) {
  91 + List<SortBean> schoolList = new ArrayList<>();
136 92 CharacterParser characterParser = CharacterParser.getInstance();
137   - for (String c : list) {
138   - SchoolBean s = new SchoolBean();
139   - s.setSchoolname(c);
  93 + for (SchoolBean c : list) {
  94 + SortBean s = new SortBean();
  95 + s.setSchool_name(c.school_name);
  96 + s.setSchool_area(c.school_area);
  97 + s.setSchool_id(c.school_id);
  98 + s.setIsNew(c.isNew);
140 99  
141 100 //汉字转换成拼音
142   - String pinyin = characterParser.getSelling(s.getSchoolname());
  101 + String pinyin = characterParser.getSelling(s.getSchool_name());
143 102 String sortString = "";
144 103 try {
145 104 sortString = pinyin.substring(0, 1).toUpperCase();
... ... @@ -147,7 +106,7 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity implements View.
147 106 continue;
148 107 }
149 108 // 正则表达式,判断首字母是否是英文字母
150   - if (sortString.matches("[A-Z]") ) {
  109 + if (sortString.matches("[A-Z]")) {
151 110 s.setSortLetters(sortString.toUpperCase());
152 111 } else {
153 112 s.setSortLetters("#");
... ... @@ -159,10 +118,10 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity implements View.
159 118 }
160 119  
161 120  
162   - public static List<SchoolBean> orderByNameIndexAndIndentity(List<SchoolBean> sortModels) {
163   - Collections.sort(sortModels, new Comparator<SchoolBean>() {
  121 + public static List<SortBean> orderByNameIndexAndIndentity(List<SortBean> sortModels) {
  122 + Collections.sort(sortModels, new Comparator<SortBean>() {
164 123 @Override
165   - public int compare(SchoolBean o1, SchoolBean o2) {
  124 + public int compare(SortBean o1, SortBean o2) {
166 125 if (o1.getSortLetters().equals("#") && o2.getSortLetters().matches("[A-Z]")) {
167 126 return -1;
168 127 } else if (o1.getSortLetters().equals("#") && !o2.getSortLetters().matches("[A-Z]")) {
... ... @@ -187,10 +146,82 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity implements View.
187 146  
188 147 @Override
189 148 public void onClick(View v) {
190   - if(v==go_next){
191   - startActivity(new Intent().setClass(SelectSchoolActivity.this,CheckInfoActivity.class));
  149 + if (v == go_next) {
  150 + SortBean currentSortBean = schoolListAdapter.getCurrentSortBean();
  151 + if (currentSortBean != null) {
  152 + if (currentSortBean.getIsNew().equals("0")) {
  153 + Log.e("1111-===",currentSortBean.getSchool_id());
  154 + startActivity(new Intent().putExtra("school_id",currentSortBean.getSchool_id()).setClass(SelectSchoolActivity.this, CheckInfoActivity.class));
  155 + } else {
  156 + startActivity(new Intent().setClass(SelectSchoolActivity.this,CreateChildInfoActivity.class));
  157 + }
192 158  
  159 + } else {
  160 + ToastUtils.showToast("请选择学校");
  161 + }
193 162 }
194 163  
195 164 }
  165 +
  166 +
  167 + @Override
  168 + public void showList(List<SchoolBean> list) {
  169 +// list.add("阿尔卑斯");
  170 +// list.add("阿尔卑斯");
  171 +// list.add("阿尔卑斯");
  172 +// list.add("贝克街");
  173 +// list.add("贝克街");
  174 +// list.add("贝克街");
  175 +// list.add("贝克街");
  176 +// list.add("贝克街");
  177 +// list.add("阿尔卑斯");
  178 +// list.add("阿尔卑斯");
  179 +// list.add("贝克街");
  180 +// list.add("贝克街");
  181 +// list.add("阿尔卑斯");
  182 +// list.add("阿尔卑斯");
  183 +// list.add("阿尔卑斯");
  184 +// list.add("贝克街");
  185 +// list.add("贝克街");
  186 +// list.add("血色城堡");
  187 +// list.add("血色城堡");
  188 +// list.add("血色城堡");
  189 +// list.add("血色城堡");
  190 +// list.add("贝克街");
  191 +// list.add("贝克街");
  192 +// list.add("贝克街");
  193 +// list.add("贝克街");
  194 +// list.add("贝克街");
  195 +// list.add("贝克街");
  196 +// list.add("贝克街");
  197 +// list.add("贝克街");
  198 +// list.add("贝克街");
  199 +// list.add("血色城堡");
  200 +// list.add("血色城堡");
  201 +// list.add("血色城堡");
  202 +// list.add("血色城堡");
  203 +// list.add("贝克街");
  204 +// list.add("贝克街");
  205 +// list.add("贝克街");
  206 +// list.add("贝克街");
  207 +// list.add("贝克街");
  208 +// list.add("血色城堡");
  209 +// list.add("贝克街");
  210 +// list.add("贝克街");
  211 +// list.add("贝克街");
  212 +// list.add("贝克街");
  213 +// list.add("贝克街");
  214 +// list.add("贝克街");
  215 +// list.add("贝克街");
  216 +// list.add("贝克街");
  217 +// list.add("贝克街");
  218 +// list.add("血色城堡");
  219 +// list.add("血色城堡");
  220 +// list.add("血色城堡");
  221 +// list.add("血色城堡");
  222 + final List<SortBean> schoolList = OrderedSortSmodel(list);
  223 + schoolListAdapter = new SchoolListAdapter(this, schoolList);
  224 + schoolListAdapter.addAll(schoolList);
  225 + schoollist.setAdapter(schoolListAdapter);
  226 + }
196 227 }
... ...
app/src/main/java/com/shunzhi/parent/ui/fragment/MineFragment.java
... ... @@ -4,11 +4,18 @@ import android.content.Intent;
4 4 import android.os.Bundle;
5 5 import android.support.annotation.NonNull;
6 6 import android.support.annotation.Nullable;
  7 +import android.text.TextUtils;
7 8 import android.view.View;
8 9 import android.widget.LinearLayout;
  10 +import android.widget.TextView;
9 11  
  12 +import com.bumptech.glide.Glide;
  13 +import com.makeramen.roundedimageview.RoundedImageView;
10 14 import com.share.mvpsdk.base.BasePresenter;
11 15 import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment;
  16 +import com.share.mvpsdk.utils.ToastUtils;
  17 +import com.shunzhi.parent.AppConfig;
  18 +import com.shunzhi.parent.AppContext;
12 19 import com.shunzhi.parent.R;
13 20 import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract;
14 21 import com.shunzhi.parent.contract.mine.MineContract;
... ... @@ -18,7 +25,9 @@ import com.shunzhi.parent.ui.activity.PersonInfoActivity;
18 25  
19 26 public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel>
20 27 implements MineContract.IMineView, View.OnClickListener {
21   - LinearLayout childlayout,personinfo;
  28 + LinearLayout childlayout, personinfo;
  29 + RoundedImageView user_photo;
  30 + TextView user_name, user_mobile;
22 31  
23 32 @NonNull
24 33 @Override
... ... @@ -37,6 +46,25 @@ public class MineFragment extends BaseMVPCompatFragment&lt;LoginAndRegisterContract
37 46 personinfo = view.findViewById(R.id.personinfo);
38 47 childlayout.setOnClickListener(this);
39 48 personinfo.setOnClickListener(this);
  49 + user_photo = view.findViewById(R.id.user_photo);
  50 + user_name = view.findViewById(R.id.user_name);
  51 + user_mobile = view.findViewById(R.id.user_mobile);
  52 +
  53 + }
  54 +
  55 + private void setPersonInfo() {
  56 + String url = AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_IMAGE);
  57 + ToastUtils.showToast(url);
  58 + if (!TextUtils.isEmpty(url)) {
  59 + Glide.with(getActivity()).load(url).asBitmap().error(R.drawable.test).centerCrop().into(user_photo);
  60 + } else {
  61 + Glide.with(getActivity()).load(R.drawable.test).centerCrop().into(user_photo);
  62 + user_photo.setCornerRadius(20);
  63 + }
  64 + user_photo.setCornerRadius(20);
  65 + user_photo.setOval(true);
  66 + user_name.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_NAME));
  67 + user_mobile.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME));
40 68  
41 69 }
42 70  
... ... @@ -54,6 +82,11 @@ public class MineFragment extends BaseMVPCompatFragment&lt;LoginAndRegisterContract
54 82 break;
55 83 }
56 84  
  85 + }
57 86  
  87 + @Override
  88 + public void onResume() {
  89 + super.onResume();
  90 + setPersonInfo();
58 91 }
59 92 }
... ...
app/src/main/java/com/shunzhi/parent/ui/fragment/loginandregistfragment/LoginAndRegistFragment.java
1 1 package com.shunzhi.parent.ui.fragment.loginandregistfragment;
2 2  
3 3 import android.content.Intent;
  4 +import android.os.Build;
4 5 import android.os.Bundle;
5 6 import android.support.annotation.NonNull;
6 7 import android.support.annotation.Nullable;
  8 +import android.support.annotation.RequiresApi;
7 9 import android.text.Editable;
8 10 import android.text.TextUtils;
9 11 import android.text.TextWatcher;
  12 +import android.util.Log;
10 13 import android.view.Gravity;
11 14 import android.view.LayoutInflater;
12 15 import android.view.View;
... ... @@ -20,12 +23,17 @@ import android.widget.TextView;
20 23 import com.makeramen.roundedimageview.RoundedImageView;
21 24 import com.share.mvpsdk.base.BasePresenter;
22 25 import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment;
23   -import com.share.mvpsdk.utils.ToastUtils;
  26 +import com.shunzhi.parent.AppConfig;
  27 +import com.shunzhi.parent.AppContext;
24 28 import com.shunzhi.parent.R;
25 29 import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract;
26 30 import com.shunzhi.parent.presenter.loginandregister.LoginAndRegisterPresenter;
27 31 import com.shunzhi.parent.ui.MainActivity;
28 32 import com.shunzhi.parent.ui.activity.LoginAndRegistActivity;
  33 +import com.shunzhi.parent.views.MyProcessDialog;
  34 +
  35 +import java.util.Calendar;
  36 +import java.util.Date;
29 37  
30 38  
31 39 public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel>
... ... @@ -34,10 +42,11 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment&lt;LoginAndRegist
34 42 public RoundedImageView roundedImageView;
35 43 public EditText phoneNumber, idCode, password;
36 44 public TextView get_idCode, loginAndRegister, tv_info, tv_goto;
37   - public LinearLayout phoneLayout, idCodeLayout, passwordLayout,main_login;
  45 + public LinearLayout phoneLayout, idCodeLayout, passwordLayout, main_login;
38 46 public ImageView img_eye;
39 47 public static String typepage;
40 48 public boolean open = false;
  49 + public static MyProcessDialog progressDialog;
41 50  
42 51  
43 52 public static LoginAndRegistFragment getInstance(String type) {
... ... @@ -60,6 +69,7 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment&lt;LoginAndRegist
60 69  
61 70 @Override
62 71 public void initUI(View view, @Nullable Bundle savedInstanceState) {
  72 + progressDialog = new MyProcessDialog(getActivity());
63 73 main_login = view.findViewById(R.id.main_login);
64 74 roundedImageView = view.findViewById(R.id.photoImage);
65 75 phoneNumber = view.findViewById(R.id.et_phoneNumber);
... ... @@ -80,6 +90,7 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment&lt;LoginAndRegist
80 90 phoneNumber.addTextChangedListener(textWatcher);
81 91 idCode.addTextChangedListener(textWatcher);
82 92 password.addTextChangedListener(textWatcher);
  93 + mPresenter.loginResult("18358585335", "123456");
83 94 if ("登录".equals(typepage)) {
84 95 idCodeLayout.setVisibility(View.GONE);
85 96 loginAndRegister.setText("登录");
... ... @@ -102,32 +113,59 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment&lt;LoginAndRegist
102 113  
103 114  
104 115 @Override
105   - public void getUserInfo() {
106   - PopupWindow popupWindow=new PopupWindow();
107   - popupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT);
108   - popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
109   - View view= LayoutInflater.from(getActivity()).inflate(R.layout.dialog_view,null);
110   - popupWindow.setContentView(view);
111   - popupWindow.showAtLocation(main_login, Gravity.CENTER,0,0);
  116 + public void getUserInfo(int type) {
  117 + progressDialog.dismiss();
  118 + if (type == 0) {
  119 + startActivity(new Intent().setClass(getActivity(), MainActivity.class));
  120 + getActivity().finish();
  121 + } else if (type == 1) {
  122 + PopupWindow popupWindow = new PopupWindow();
  123 + popupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT);
  124 + popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
  125 + View view = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_view, null);
  126 + TextView right_btn = view.findViewById(R.id.right_btn);
  127 + right_btn.setOnClickListener(new View.OnClickListener() {
  128 + @Override
  129 + public void onClick(View v) {
  130 + progressDialog.show();
  131 + mPresenter.loginResult(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME),AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_PWD));
  132 + }
  133 + });
  134 + TextView cancel_btn = view.findViewById(R.id.cancel_btn);
  135 + cancel_btn.setOnClickListener(new View.OnClickListener() {
  136 + @Override
  137 + public void onClick(View v) {
  138 + startActivity(new Intent().putExtra("type", "登录").setClass(getActivity(), LoginAndRegistActivity.class));
  139 + phoneNumber.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME));
  140 + password.setFocusable(true);
  141 + }
  142 + });
  143 +
  144 + popupWindow.setContentView(view);
  145 + popupWindow.showAtLocation(main_login, Gravity.CENTER, 0, 0);
  146 + }
112 147  
113 148  
114 149  
115 150 }
116 151  
  152 + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
117 153 @Override
118 154 public void onClick(View v) {
119 155 if (v == loginAndRegister) {
120   - ToastUtils.showToast("onClick");
  156 + progressDialog.show();
  157 + Date l = Calendar.getInstance().getTime();
  158 +
  159 + Log.e("1111--==", l.getTime() + "");
121 160 if (loginAndRegister.getText().toString().trim().equals("登录")) {
122   - mPresenter.loginResult(phoneNumber.getText().toString(), password.getText().toString());
  161 + mPresenter.loginResult(phoneNumber.getText().toString(), password.getText().toString());
123 162 } else if (loginAndRegister.getText().toString().trim().equals("注册")) {
124   - mPresenter.registerResult(phoneNumber.getText().toString(), idCode.getText().toString(), password.getText().toString());
  163 + mPresenter.registerResult(phoneNumber.getText().toString(), idCode.getText().toString(), password.getText().toString());
125 164 }
126 165  
127 166 } else if (v == tv_goto) {
128 167 if (tv_goto.getText().toString().equals("登录")) {
129 168 startActivity(new Intent().putExtra("type", "登录").setClass(getActivity(), LoginAndRegistActivity.class));
130   -
131 169 } else if (tv_goto.getText().toString().equals("注册")) {
132 170 startActivity(new Intent().putExtra("type", "注册").setClass(getActivity(), LoginAndRegistActivity.class));
133 171 }
... ... @@ -147,6 +185,7 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment&lt;LoginAndRegist
147 185 password.setSelection(password.getText().toString().length());
148 186 }
149 187 }
  188 +
150 189 TextWatcher textWatcher = new TextWatcher() {
151 190 @Override
152 191 public void beforeTextChanged(CharSequence s, int start, int count, int after) {
... ...
app/src/main/java/com/shunzhi/parent/views/MyProcessDialog.java 0 → 100644
... ... @@ -0,0 +1,25 @@
  1 +package com.shunzhi.parent.views;
  2 +
  3 +
  4 +import android.app.Dialog;
  5 +import android.content.Context;
  6 +import android.widget.TextView;
  7 +
  8 +import com.shunzhi.parent.R;
  9 +
  10 +
  11 +public class MyProcessDialog extends Dialog {
  12 + private TextView txt_info;
  13 +
  14 + public MyProcessDialog(Context context) {
  15 + super(context, R.style.MyProgressDialog);
  16 + this.setContentView(R.layout.ui_progress_dialog);
  17 + txt_info = (TextView)this.findViewById(R.id.txt_wait);
  18 + }
  19 +
  20 + public void setMsg(String msg){
  21 + if(null != txt_info){
  22 + txt_info.setText(msg);
  23 + }
  24 + }
  25 +}
... ...
app/src/main/java/com/shunzhi/parent/views/ProgressView.java
... ... @@ -55,7 +55,7 @@ public class ProgressView extends View {
55 55 super.onDraw(canvas);
56 56 initPaint();
57 57 RectF rectBlackBg = new RectF(20, 20, mWidth - 20, mHeight - 20);
58   - canvas.drawArc(rectBlackBg, 0, 275, false, mPaint);
  58 + canvas.drawArc(rectBlackBg, 0, 270, false, mPaint);
59 59 mPaint.setColor(getColor(score));
60 60 canvas.drawText(score + "%", mWidth / 2, mHeight / 2, mTextPaint);
61 61 mTextPaint.setTextSize(40);
... ... @@ -70,7 +70,7 @@ public class ProgressView extends View {
70 70 mPaint.setShader(sweepGradient);
71 71 mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_ATOP));
72 72 mPaint.setStyle(Style.STROKE);
73   - canvas.drawArc(rectBlackBg, 135, section * 275, false, mPaint);
  73 + canvas.drawArc(rectBlackBg, 135, section * 270, false, mPaint);
74 74 }
75 75  
76 76  
... ...
app/src/main/res/drawable-xhdpi/ic_loading_white.png 0 → 100644

1.56 KB

app/src/main/res/drawable/ic_progressbar.xml 0 → 100644
... ... @@ -0,0 +1,13 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
  3 + <item>
  4 + <rotate
  5 + android:drawable="@drawable/ic_loading_white"
  6 + android:duration="1000"
  7 + android:fromDegrees="0.0"
  8 + android:interpolator="@android:anim/linear_interpolator"
  9 + android:pivotX="50.0%"
  10 + android:pivotY="50.0%"
  11 + android:toDegrees="360.0" />
  12 + </item>
  13 +</layer-list>
0 14 \ No newline at end of file
... ...
app/src/main/res/layout/activity_check_info.xml
... ... @@ -28,6 +28,7 @@
28 28 android:textSize="@dimen/sp_18" />
29 29  
30 30 <TextView
  31 + android:id="@+id/user_mobile"
31 32 android:layout_width="match_parent"
32 33 android:layout_height="wrap_content"
33 34 android:layout_marginTop="10dp"
... ... @@ -57,7 +58,8 @@
57 58 android:text="孩子姓名:"
58 59 android:textSize="@dimen/sp_16" />
59 60  
60   - <EditText
  61 + <TextView
  62 + android:id="@+id/child_name"
61 63 android:layout_width="wrap_content"
62 64 android:layout_height="match_parent"
63 65 android:layout_weight="1"
... ... @@ -78,10 +80,11 @@
78 80 <TextView
79 81 android:layout_width="wrap_content"
80 82 android:layout_height="wrap_content"
81   - android:text="性 别:"
  83 + android:text="性 别:"
82 84 android:textSize="@dimen/sp_16" />
83 85  
84   - <EditText
  86 + <TextView
  87 + android:id="@+id/child_sex"
85 88 android:layout_width="wrap_content"
86 89 android:layout_height="match_parent"
87 90 android:layout_weight="1"
... ... @@ -102,10 +105,11 @@
102 105 <TextView
103 106 android:layout_width="wrap_content"
104 107 android:layout_height="wrap_content"
105   - android:text="年 级:"
  108 + android:text="年 级:"
106 109 android:textSize="@dimen/sp_16" />
107 110  
108   - <EditText
  111 + <TextView
  112 + android:id="@+id/child_grade"
109 113 android:layout_width="wrap_content"
110 114 android:layout_height="match_parent"
111 115 android:layout_weight="1"
... ... @@ -126,10 +130,11 @@
126 130 <TextView
127 131 android:layout_width="wrap_content"
128 132 android:layout_height="wrap_content"
129   - android:text="班 级:"
  133 + android:text="班 级:"
130 134 android:textSize="@dimen/sp_16" />
131 135  
132   - <EditText
  136 + <TextView
  137 + android:id="@+id/child_class"
133 138 android:layout_width="wrap_content"
134 139 android:layout_height="match_parent"
135 140 android:layout_weight="1"
... ...
app/src/main/res/layout/activity_create_childinfo.xml
... ... @@ -63,7 +63,7 @@
63 63 <TextView
64 64 android:layout_width="wrap_content"
65 65 android:layout_height="wrap_content"
66   - android:text="性 别:"
  66 + android:text="性 别:"
67 67 android:textSize="@dimen/sp_16" />
68 68  
69 69 <EditText
... ... @@ -88,7 +88,7 @@
88 88 <TextView
89 89 android:layout_width="wrap_content"
90 90 android:layout_height="wrap_content"
91   - android:text="年 级:"
  91 + android:text="年 级:"
92 92 android:textSize="@dimen/sp_16" />
93 93  
94 94 <EditText
... ... @@ -113,7 +113,7 @@
113 113 <TextView
114 114 android:layout_width="wrap_content"
115 115 android:layout_height="wrap_content"
116   - android:text="班 级:"
  116 + android:text="班 级:"
117 117 android:textSize="@dimen/sp_16" />
118 118  
119 119 <EditText
... ...
app/src/main/res/layout/activity_personinfo.xml
... ... @@ -48,10 +48,13 @@
48 48 android:layout_centerInParent="true">
49 49  
50 50 <com.makeramen.roundedimageview.RoundedImageView
  51 + android:id="@+id/user_photo"
51 52 android:layout_width="100dp"
52 53 android:layout_height="100dp"
53 54 android:src="@color/white"
54   - app:riv_corner_radius="20dp" />
  55 + app:riv_corner_radius="20dp"
  56 + app:riv_oval="false"
  57 + />
55 58 </FrameLayout>
56 59  
57 60 <LinearLayout
... ... @@ -65,12 +68,14 @@
65 68 android:orientation="vertical">
66 69  
67 70 <TextView
  71 + android:id="@+id/user_name"
68 72 android:layout_width="wrap_content"
69 73 android:layout_height="wrap_content"
70 74 android:text="马铂骞"
71 75 android:textSize="@dimen/txtsize_title" />
72 76  
73 77 <TextView
  78 + android:id="@+id/user_mobile"
74 79 android:layout_width="wrap_content"
75 80 android:layout_height="wrap_content"
76 81 android:text="账号:12345678991"
... ... @@ -95,6 +100,8 @@
95 100 android:layout_width="match_parent"
96 101 android:layout_height="wrap_content"
97 102 android:background="@color/white"
  103 + android:focusable="true"
  104 + android:focusableInTouchMode="true"
98 105 android:orientation="vertical">
99 106  
100 107 <LinearLayout
... ... @@ -126,7 +133,6 @@
126 133 android:layout_gravity="center_vertical"
127 134 android:layout_marginRight="15dp"
128 135 android:background="@null"
129   - android:focusable="false"
130 136 android:text="马铂骞"
131 137 android:textColor="@color/text_color"
132 138 android:textSize="@dimen/txtsize_title" />
... ... @@ -168,6 +174,7 @@
168 174 android:orientation="horizontal">
169 175  
170 176 <RadioButton
  177 + android:id="@+id/man"
171 178 android:layout_width="wrap_content"
172 179 android:layout_height="wrap_content"
173 180 android:button="@null"
... ... @@ -178,6 +185,7 @@
178 185 android:textSize="@dimen/txtsize_title" />
179 186  
180 187 <RadioButton
  188 + android:id="@+id/women"
181 189 android:layout_width="wrap_content"
182 190 android:layout_height="wrap_content"
183 191 android:layout_marginLeft="10dp"
... ... @@ -203,6 +211,7 @@
203 211 </LinearLayout>
204 212  
205 213 <TextView
  214 + android:id="@+id/change_info"
206 215 android:layout_width="match_parent"
207 216 android:layout_height="40dp"
208 217 android:layout_margin="20dp"
... ...
app/src/main/res/layout/fragment_login_and_regist.xml
... ... @@ -44,6 +44,7 @@
44 44 android:layout_height="50dp"
45 45 android:background="@null"
46 46 android:hint="请输入手机号码"
  47 + android:text="18358585335"
47 48 android:maxLength="11"
48 49 android:textColorHint="@color/hintTextColor"
49 50 android:textSize="@dimen/sp_16" />
... ... @@ -116,6 +117,7 @@
116 117 android:layout_weight="1"
117 118 android:background="@null"
118 119 android:hint="请设置密码:6~16个字符"
  120 + android:text="123456"
119 121 android:maxLength="16"
120 122 android:inputType="textPassword"
121 123 android:textColorHint="@color/hintTextColor"
... ... @@ -197,7 +199,6 @@
197 199 android:layout_height="wrap_content"
198 200 android:layout_marginTop="30dp"
199 201 android:gravity="center"
200   - android:visibility="gone"
201 202 android:orientation="horizontal">
202 203  
203 204 <TextView
... ... @@ -222,6 +223,7 @@
222 223 android:id="@+id/denglu"
223 224 android:layout_width="match_parent"
224 225 android:layout_height="wrap_content"
  226 + android:visibility="gone"
225 227 android:layout_marginTop="30dp"
226 228 android:orientation="horizontal">
227 229  
... ... @@ -240,6 +242,17 @@
240 242 android:text="注册"
241 243 android:textColor="#acc9fc"
242 244 android:textSize="@dimen/sp_16" />
  245 + <TextView
  246 + android:layout_width="0dp"
  247 + android:layout_height="wrap_content"
  248 + android:layout_weight="1"
  249 + />
  250 + <TextView
  251 + android:layout_width="wrap_content"
  252 + android:layout_height="wrap_content"
  253 + android:text="忘记密码"
  254 + android:textColor="#acc9fc"
  255 + android:textSize="@dimen/sp_16" />
243 256  
244 257  
245 258 </LinearLayout>
... ...
app/src/main/res/layout/fragment_mine.xml
... ... @@ -36,6 +36,7 @@
36 36 android:orientation="horizontal">
37 37  
38 38 <com.makeramen.roundedimageview.RoundedImageView
  39 + android:id="@+id/user_photo"
39 40 android:layout_width="60dp"
40 41 android:layout_height="60dp"
41 42 android:layout_margin="20dp"
... ... @@ -50,6 +51,7 @@
50 51 android:orientation="vertical">
51 52  
52 53 <TextView
  54 + android:id="@+id/user_name"
53 55 android:layout_width="wrap_content"
54 56 android:layout_height="wrap_content"
55 57 android:text="马铂賽"
... ... @@ -57,6 +59,7 @@
57 59 android:textSize="@dimen/txtsize_headline" />
58 60  
59 61 <TextView
  62 + android:id="@+id/user_mobile"
60 63 android:layout_width="wrap_content"
61 64 android:layout_height="wrap_content"
62 65 android:text="账号:12345678991"
... ...
app/src/main/res/layout/item_school.xml
... ... @@ -19,6 +19,7 @@
19 19 android:textColor="#454545" />
20 20 </LinearLayout>
21 21 <RelativeLayout
  22 + android:id="@+id/item_view"
22 23 android:layout_width="match_parent"
23 24 android:layout_height="wrap_content">
24 25  
... ... @@ -38,6 +39,7 @@
38 39 android:layout_width="20dp"
39 40 android:layout_height="40dp"
40 41 android:layout_marginRight="40dp"
  42 + android:visibility="invisible"
41 43 android:gravity="center_vertical"
42 44 android:src="@drawable/select_ok" />
43 45 </RelativeLayout>
... ...
app/src/main/res/layout/ui_progress_dialog.xml 0 → 100644
... ... @@ -0,0 +1,30 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="fill_parent"
  4 + android:layout_height="fill_parent"
  5 + android:background="@drawable/progress_bg"
  6 + android:layout_gravity="center"
  7 + android:gravity="center"
  8 + android:orientation="vertical">
  9 +
  10 + <ProgressBar
  11 + android:layout_width="wrap_content"
  12 + android:layout_height="wrap_content"
  13 + android:layout_gravity="center"
  14 + android:focusable="false"
  15 + android:indeterminateDrawable="@drawable/ic_progressbar"
  16 + />
  17 +
  18 + <TextView
  19 + android:id="@+id/txt_wait"
  20 + android:layout_width="wrap_content"
  21 + android:layout_height="wrap_content"
  22 + android:layout_gravity="center"
  23 + android:layout_marginTop="8.0dip"
  24 + android:focusable="false"
  25 + android:singleLine="true"
  26 + android:textColor="@color/white"
  27 + android:text="加载中..."
  28 + android:textSize="12.0sp" />
  29 +
  30 +</LinearLayout>
0 31 \ No newline at end of file
... ...
app/src/main/res/values/colors.xml
... ... @@ -19,4 +19,5 @@
19 19 <color name="huodong_blue">#ACD1FB</color>
20 20 <color name="text_color">#757575</color>
21 21 <color name="textGreen">#5FB762</color>
  22 + <color name="transparent">#00000000</color>
22 23 </resources>
... ...
app/src/main/res/values/styles.xml
... ... @@ -32,5 +32,13 @@
32 32 <item name="android:layout_height">match_parent</item>
33 33 <item name="android:textSize">@dimen/textSize16</item>
34 34 </style>
  35 + <style name="MyProgressDialog" parent="@android:style/Theme.Dialog">
  36 + <item name="android:windowBackground">@color/transparent</item>
  37 + <item name="android:windowFrame">@color/transparent</item>
  38 + <item name="android:windowNoTitle">true</item>
  39 + <item name="android:windowIsFloating">true</item>
  40 + <item name="android:windowIsTranslucent">true</item>
  41 + <item name="android:backgroundDimEnabled">true</item>
  42 + </style>
35 43  
36 44 </resources>
... ...
mvpsdk/src/main/java/com/share/mvpsdk/helper/RetrofitCreateHelper.java
1 1 package com.share.mvpsdk.helper;
2 2  
3 3  
4   -import android.util.Log;
5   -
6 4 import com.share.mvpsdk.helper.okhttp.CacheInterceptor;
7   -import com.share.mvpsdk.helper.okhttp.HttpCache;
8   -import com.share.mvpsdk.helper.okhttp.TrustManager;
9 5 import com.share.mvpsdk.utils.StringUtils;
10   -import com.share.mvpsdk.utils.ToastUtils;
11 6  
12 7 import java.io.IOException;
13 8 import java.util.concurrent.TimeUnit;
... ...
mvpsdk/src/main/java/com/share/mvpsdk/utils/OkHttpExceptionUtil.java
1 1 package com.share.mvpsdk.utils;
2 2  
3 3 import android.support.annotation.NonNull;
4   -import android.util.Log;
5 4  
6 5 import org.json.JSONObject;
7 6  
... ... @@ -21,7 +20,7 @@ public class OkHttpExceptionUtil {
21 20 if (responseBody==null)return;
22 21 try {
23 22 JSONObject json = new JSONObject(responseBody.string());
24   - ToastUtils.showToast(json.optString("error"));
  23 + ToastUtils.showToast(json.optString("message"));
25 24 } catch (Exception e1) {
26 25 e1.printStackTrace();
27 26 }
... ...