Commit b181dda45a87176934426edec17cfb129d4e5e17
Exists in
yxb_dev
and in
2 other branches
no message
Showing
19 changed files
with
283 additions
and
74 deletions
Show diff stats
app/src/main/AndroidManifest.xml
@@ -84,6 +84,9 @@ | @@ -84,6 +84,9 @@ | ||
84 | android:name=".ui.activity.StartActivity" | 84 | android:name=".ui.activity.StartActivity" |
85 | android:screenOrientation="portrait" /> | 85 | android:screenOrientation="portrait" /> |
86 | <activity | 86 | <activity |
87 | + android:name=".ui.activity.ChildDetialActivity" | ||
88 | + android:screenOrientation="portrait" /> | ||
89 | + <activity | ||
87 | android:name=".ui.activity.binding.CreateChildInfoActivity" | 90 | android:name=".ui.activity.binding.CreateChildInfoActivity" |
88 | android:screenOrientation="portrait" | 91 | android:screenOrientation="portrait" |
89 | android:windowSoftInputMode="adjustPan|stateHidden" /> | 92 | android:windowSoftInputMode="adjustPan|stateHidden" /> |
app/src/main/java/com/shunzhi/parent/adapter/ChildAdapter.java
@@ -2,50 +2,61 @@ package com.shunzhi.parent.adapter; | @@ -2,50 +2,61 @@ package com.shunzhi.parent.adapter; | ||
2 | 2 | ||
3 | 3 | ||
4 | import android.content.Context; | 4 | import android.content.Context; |
5 | +import android.content.Intent; | ||
5 | import android.view.LayoutInflater; | 6 | import android.view.LayoutInflater; |
6 | import android.view.View; | 7 | import android.view.View; |
7 | import android.view.ViewGroup; | 8 | import android.view.ViewGroup; |
8 | import android.widget.TextView; | 9 | import android.widget.TextView; |
9 | 10 | ||
11 | +import com.google.gson.Gson; | ||
10 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; | 12 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; |
11 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; | 13 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; |
12 | import com.shunzhi.parent.R; | 14 | import com.shunzhi.parent.R; |
13 | import com.shunzhi.parent.bean.ChildBean; | 15 | import com.shunzhi.parent.bean.ChildBean; |
16 | +import com.shunzhi.parent.ui.activity.ChildDetialActivity; | ||
14 | 17 | ||
15 | /** | 18 | /** |
16 | * Created by Administrator on 2018/3/9 0009. | 19 | * Created by Administrator on 2018/3/9 0009. |
17 | */ | 20 | */ |
18 | 21 | ||
19 | -public class ChildAdapter extends BaseRecyclerViewAdapter<ChildBean>{ | 22 | +public class ChildAdapter extends BaseRecyclerViewAdapter<ChildBean> { |
20 | 23 | ||
21 | Context context; | 24 | Context context; |
22 | - public ChildAdapter(Context context){ | ||
23 | - this.context=context; | 25 | + |
26 | + public ChildAdapter(Context context) { | ||
27 | + this.context = context; | ||
24 | } | 28 | } |
25 | 29 | ||
26 | 30 | ||
27 | @Override | 31 | @Override |
28 | public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | 32 | public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { |
29 | - View view= LayoutInflater.from(context).inflate(R.layout.item_childlist,null); | 33 | + View view = LayoutInflater.from(context).inflate(R.layout.item_childlist, null); |
30 | return new MyViewHolder(view); | 34 | return new MyViewHolder(view); |
31 | } | 35 | } |
32 | 36 | ||
33 | - private class MyViewHolder extends BaseRecyclerViewHolder<ChildBean>{ | 37 | + private class MyViewHolder extends BaseRecyclerViewHolder<ChildBean> { |
34 | 38 | ||
35 | - TextView txt_childname,txt_childclass; | 39 | + TextView txt_childname, txt_childclass; |
36 | 40 | ||
37 | 41 | ||
38 | public MyViewHolder(View view) { | 42 | public MyViewHolder(View view) { |
39 | super(view); | 43 | super(view); |
40 | - txt_childname=view.findViewById(R.id.txt_childname); | ||
41 | - txt_childclass=view.findViewById(R.id.txt_childclass); | 44 | + txt_childname = view.findViewById(R.id.txt_childname); |
45 | + txt_childclass = view.findViewById(R.id.txt_childclass); | ||
42 | } | 46 | } |
43 | 47 | ||
44 | @Override | 48 | @Override |
45 | - public void onBindViewHolder(ChildBean object, int position) { | 49 | + public void onBindViewHolder(final ChildBean object, int position) { |
46 | txt_childname.setText(object.getStudentName()); | 50 | txt_childname.setText(object.getStudentName()); |
47 | - txt_childclass.setText(object.getSchoolName()+" "+object.getClassName()); | ||
48 | - | 51 | + txt_childclass.setText(object.getSchoolName() + " " + object.getClassName()); |
52 | + itemView.setOnClickListener(new View.OnClickListener() { | ||
53 | + @Override | ||
54 | + public void onClick(View v) { | ||
55 | + Gson g = new Gson(); | ||
56 | + String jsonString = g.toJson(object, ChildBean.class).toString(); | ||
57 | + context.startActivity(new Intent().putExtra("childJson", jsonString).setClass(context, ChildDetialActivity.class)); | ||
58 | + } | ||
59 | + }); | ||
49 | } | 60 | } |
50 | 61 | ||
51 | } | 62 | } |
app/src/main/java/com/shunzhi/parent/api/MineApi.java
@@ -37,5 +37,9 @@ public interface MineApi { | @@ -37,5 +37,9 @@ public interface MineApi { | ||
37 | 37 | ||
38 | @GET("/api/ParentHelper/GetClassOrGrade") | 38 | @GET("/api/ParentHelper/GetClassOrGrade") |
39 | Observable<GradeBean>getGradeAndClass(@Query("state") int state,@Query("schoolid") int schoolId,@Query("gradeid") int gradeId); | 39 | Observable<GradeBean>getGradeAndClass(@Query("state") int state,@Query("schoolid") int schoolId,@Query("gradeid") int gradeId); |
40 | + | ||
41 | + | ||
42 | + @GET("/api/ParentHelper/UnBindStudent") | ||
43 | + Observable<JsonObject>unBinding(@Query("parentId") int parentId,@Query("studentId") int studentId); | ||
40 | } | 44 | } |
41 | 45 |
app/src/main/java/com/shunzhi/parent/bean/ChildBean.java
@@ -6,8 +6,8 @@ import java.io.Serializable; | @@ -6,8 +6,8 @@ import java.io.Serializable; | ||
6 | * Created by Administrator on 2018/3/9 0009. | 6 | * Created by Administrator on 2018/3/9 0009. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | -public class ChildBean implements Serializable{ | ||
10 | - private String studentUserId; | 9 | +public class ChildBean implements Serializable { |
10 | + private String studentUserId; | ||
11 | private int parentMobile; | 11 | private int parentMobile; |
12 | private int parentId; | 12 | private int parentId; |
13 | private boolean mobileFlag; | 13 | private boolean mobileFlag; |
@@ -17,13 +17,33 @@ public class ChildBean implements Serializable{ | @@ -17,13 +17,33 @@ public class ChildBean implements Serializable{ | ||
17 | private String schoolName; | 17 | private String schoolName; |
18 | private int grade; | 18 | private int grade; |
19 | private String gradename; | 19 | private String gradename; |
20 | + private String areaName; | ||
21 | + private String studentCode; | ||
20 | private int classId; | 22 | private int classId; |
21 | private String className; | 23 | private String className; |
22 | private int studentId; | 24 | private int studentId; |
23 | private String studentName; | 25 | private String studentName; |
24 | private String photo; | 26 | private String photo; |
27 | + private String cityName; | ||
25 | private int sex; | 28 | private int sex; |
26 | 29 | ||
30 | + | ||
31 | + public String getAreaName() { | ||
32 | + return areaName; | ||
33 | + } | ||
34 | + | ||
35 | + public void setAreaName(String areaName) { | ||
36 | + this.areaName = areaName; | ||
37 | + } | ||
38 | + | ||
39 | + public String getStudentCode() { | ||
40 | + return studentCode; | ||
41 | + } | ||
42 | + | ||
43 | + public void setStudentCode(String studentCode) { | ||
44 | + this.studentCode = studentCode; | ||
45 | + } | ||
46 | + | ||
27 | public String getStudentName() { | 47 | public String getStudentName() { |
28 | return studentName; | 48 | return studentName; |
29 | } | 49 | } |
@@ -128,7 +148,7 @@ public class ChildBean implements Serializable{ | @@ -128,7 +148,7 @@ public class ChildBean implements Serializable{ | ||
128 | this.studentId = studentId; | 148 | this.studentId = studentId; |
129 | } | 149 | } |
130 | 150 | ||
131 | - public String getStudentUserId() { | 151 | + public String getStudentUserId() { |
132 | return studentUserId; | 152 | return studentUserId; |
133 | } | 153 | } |
134 | 154 | ||
@@ -170,6 +190,8 @@ public class ChildBean implements Serializable{ | @@ -170,6 +190,8 @@ public class ChildBean implements Serializable{ | ||
170 | ",studentName='" + studentName + '\'' + | 190 | ",studentName='" + studentName + '\'' + |
171 | ",studentUserId='" + studentUserId + '\'' + | 191 | ",studentUserId='" + studentUserId + '\'' + |
172 | ",photo='" + photo + '\'' + | 192 | ",photo='" + photo + '\'' + |
193 | + ",studentCode='" + studentCode + '\'' + | ||
194 | + ",areaName='" + areaName + '\'' + | ||
173 | ", sex=" + sex + | 195 | ", sex=" + sex + |
174 | "}"; | 196 | "}"; |
175 | } | 197 | } |
app/src/main/java/com/shunzhi/parent/contract/mine/MyChildContract.java
@@ -25,6 +25,8 @@ public interface MyChildContract { | @@ -25,6 +25,8 @@ public interface MyChildContract { | ||
25 | , int schoolId,int classId,int studentId,String studentUserId); | 25 | , int schoolId,int classId,int studentId,String studentUserId); |
26 | public abstract void gradeAndClassResult(int state, int schooId,int gradeId); | 26 | public abstract void gradeAndClassResult(int state, int schooId,int gradeId); |
27 | 27 | ||
28 | + public abstract void unBinndingResult(int parentId,int studentId); | ||
29 | + | ||
28 | } | 30 | } |
29 | 31 | ||
30 | interface IMyChildModel extends IBaseModel { | 32 | interface IMyChildModel extends IBaseModel { |
@@ -32,12 +34,13 @@ public interface MyChildContract { | @@ -32,12 +34,13 @@ public interface MyChildContract { | ||
32 | Observable<JsonObject> addChildResult(int parentId, boolean mobileFlag,boolean cooperateFlag | 34 | Observable<JsonObject> addChildResult(int parentId, boolean mobileFlag,boolean cooperateFlag |
33 | , int schoolId,int classId,int studentId,String studentUserId); | 35 | , int schoolId,int classId,int studentId,String studentUserId); |
34 | Observable<GradeBean> getGradeAndClass(int state, int schooId,int gradeId); | 36 | Observable<GradeBean> getGradeAndClass(int state, int schooId,int gradeId); |
37 | + Observable<JsonObject>unBinnding(int parentId,int studentId); | ||
35 | 38 | ||
36 | 39 | ||
37 | } | 40 | } |
38 | 41 | ||
39 | interface IMyChildView extends IBaseActivity { | 42 | interface IMyChildView extends IBaseActivity { |
40 | - void updateChilsList(CurrentBean currentBean); | 43 | + void updateChildList(CurrentBean currentBean); |
41 | void addChildSuccess(); | 44 | void addChildSuccess(); |
42 | void showClass(List<ChildClass>list); | 45 | void showClass(List<ChildClass>list); |
43 | void showError(String error); | 46 | void showError(String error); |
app/src/main/java/com/shunzhi/parent/model/mine/MyChildModel.java
@@ -40,4 +40,9 @@ public class MyChildModel extends BaseModel implements MyChildContract.IMyChildM | @@ -40,4 +40,9 @@ public class MyChildModel extends BaseModel implements MyChildContract.IMyChildM | ||
40 | public Observable<GradeBean> getGradeAndClass(int state, int schooId, int gradeId) { | 40 | public Observable<GradeBean> getGradeAndClass(int state, int schooId, int gradeId) { |
41 | return RetrofitCreateHelper.getInstance().createApi(MineApi.class,MineApi.url).getGradeAndClass(state,schooId,gradeId).compose(RxHelper.<GradeBean>rxSchedulerHelper()); | 41 | return RetrofitCreateHelper.getInstance().createApi(MineApi.class,MineApi.url).getGradeAndClass(state,schooId,gradeId).compose(RxHelper.<GradeBean>rxSchedulerHelper()); |
42 | } | 42 | } |
43 | + | ||
44 | + @Override | ||
45 | + public Observable<JsonObject> unBinnding(int parentId, int studentId) { | ||
46 | + return RetrofitCreateHelper.getInstance().createApi(MineApi.class,MineApi.url).unBinding(parentId,studentId).compose(RxHelper.<JsonObject>rxSchedulerHelper()); | ||
47 | + } | ||
43 | } | 48 | } |
app/src/main/java/com/shunzhi/parent/presenter/mine/MyChildPresenter.java
@@ -10,10 +10,14 @@ import com.shunzhi.parent.bean.UserInfo; | @@ -10,10 +10,14 @@ import com.shunzhi.parent.bean.UserInfo; | ||
10 | import com.shunzhi.parent.contract.mine.MyChildContract; | 10 | import com.shunzhi.parent.contract.mine.MyChildContract; |
11 | import com.shunzhi.parent.model.mine.MyChildModel; | 11 | import com.shunzhi.parent.model.mine.MyChildModel; |
12 | 12 | ||
13 | +import org.json.JSONObject; | ||
14 | + | ||
13 | import java.util.List; | 15 | import java.util.List; |
14 | 16 | ||
15 | import io.reactivex.functions.Consumer; | 17 | import io.reactivex.functions.Consumer; |
18 | +import okhttp3.ResponseBody; | ||
16 | import retrofit2.HttpException; | 19 | import retrofit2.HttpException; |
20 | +import retrofit2.Response; | ||
17 | 21 | ||
18 | /** | 22 | /** |
19 | * Created by Administrator on 2018/3/8 0008. | 23 | * Created by Administrator on 2018/3/8 0008. |
@@ -38,13 +42,22 @@ public class MyChildPresenter extends MyChildContract.MyChildPresenter { | @@ -38,13 +42,22 @@ public class MyChildPresenter extends MyChildContract.MyChildPresenter { | ||
38 | public void accept(UserInfo userInfo) throws Exception { | 42 | public void accept(UserInfo userInfo) throws Exception { |
39 | CurrentBean currentBean = userInfo.getData(); | 43 | CurrentBean currentBean = userInfo.getData(); |
40 | // List<ChildBean> list = currentBean.getStudentClass(); | 44 | // List<ChildBean> list = currentBean.getStudentClass(); |
41 | - mIView.updateChilsList(currentBean); | 45 | + mIView.updateChildList(currentBean); |
42 | } | 46 | } |
43 | }, new Consumer<Throwable>() { | 47 | }, new Consumer<Throwable>() { |
44 | @Override | 48 | @Override |
45 | public void accept(Throwable throwable) throws Exception { | 49 | public void accept(Throwable throwable) throws Exception { |
46 | - OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | ||
47 | - mIView.showError("邀请码错误"); | 50 | + Response response = ((HttpException)throwable).response(); |
51 | + if (response==null)return; | ||
52 | + ResponseBody responseBody = response.errorBody(); | ||
53 | + if (responseBody==null)return; | ||
54 | + try { | ||
55 | + JSONObject json = new JSONObject(responseBody.string()); | ||
56 | + mIView.showError(json.optString("message")); | ||
57 | + } catch (Exception e1) { | ||
58 | + e1.printStackTrace(); | ||
59 | + } | ||
60 | + | ||
48 | } | 61 | } |
49 | })); | 62 | })); |
50 | 63 | ||
@@ -73,7 +86,7 @@ public class MyChildPresenter extends MyChildContract.MyChildPresenter { | @@ -73,7 +86,7 @@ public class MyChildPresenter extends MyChildContract.MyChildPresenter { | ||
73 | mRxManager.register(mIModel.getGradeAndClass(state, schooId, gradeId).subscribe(new Consumer<GradeBean>() { | 86 | mRxManager.register(mIModel.getGradeAndClass(state, schooId, gradeId).subscribe(new Consumer<GradeBean>() { |
74 | @Override | 87 | @Override |
75 | public void accept(GradeBean gradeBean) throws Exception { | 88 | public void accept(GradeBean gradeBean) throws Exception { |
76 | - List<ChildClass> list=gradeBean.getData(); | 89 | + List<ChildClass> list = gradeBean.getData(); |
77 | mIView.showClass(list); | 90 | mIView.showClass(list); |
78 | } | 91 | } |
79 | }, new Consumer<Throwable>() { | 92 | }, new Consumer<Throwable>() { |
@@ -84,4 +97,20 @@ public class MyChildPresenter extends MyChildContract.MyChildPresenter { | @@ -84,4 +97,20 @@ public class MyChildPresenter extends MyChildContract.MyChildPresenter { | ||
84 | })); | 97 | })); |
85 | } | 98 | } |
86 | 99 | ||
100 | + @Override | ||
101 | + public void unBinndingResult(int parentId, int studentId) { | ||
102 | + mRxManager.register(mIModel.unBinnding(parentId, studentId).subscribe(new Consumer<JsonObject>() { | ||
103 | + @Override | ||
104 | + public void accept(JsonObject jsonObject) throws Exception { | ||
105 | + ToastUtils.showToast(jsonObject.toString()); | ||
106 | + mIView.showError("123"); | ||
107 | + } | ||
108 | + }, new Consumer<Throwable>() { | ||
109 | + @Override | ||
110 | + public void accept(Throwable throwable) throws Exception { | ||
111 | + OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | ||
112 | + } | ||
113 | + })); | ||
114 | + } | ||
115 | + | ||
87 | } | 116 | } |
app/src/main/java/com/shunzhi/parent/ui/activity/ChildDetialActivity.java
0 → 100644
@@ -0,0 +1,56 @@ | @@ -0,0 +1,56 @@ | ||
1 | +package com.shunzhi.parent.ui.activity; | ||
2 | + | ||
3 | +import android.os.Bundle; | ||
4 | +import android.text.TextUtils; | ||
5 | +import android.view.View; | ||
6 | +import android.widget.TextView; | ||
7 | + | ||
8 | +import com.google.gson.Gson; | ||
9 | +import com.share.mvpsdk.base.activity.BaseCompatActivity; | ||
10 | +import com.shunzhi.parent.R; | ||
11 | +import com.shunzhi.parent.bean.ChildBean; | ||
12 | + | ||
13 | +/** | ||
14 | + * Created by Administrator on 2018/3/16 0016. | ||
15 | + */ | ||
16 | + | ||
17 | +public class ChildDetialActivity extends BaseCompatActivity { | ||
18 | + TextView child_name, child_school, child_class, school_area, student_code,center_title,back; | ||
19 | + | ||
20 | + @Override | ||
21 | + protected void initView(Bundle savedInstanceState) { | ||
22 | + String childJson=getIntent().getStringExtra("childJson"); | ||
23 | + child_name = findViewById(R.id.child_name); | ||
24 | + child_school = findViewById(R.id.child_school); | ||
25 | + child_class = findViewById(R.id.child_class); | ||
26 | + school_area = findViewById(R.id.school_area); | ||
27 | + student_code = findViewById(R.id.student_code); | ||
28 | + center_title = findViewById(R.id.center_title); | ||
29 | + center_title.setText("我的孩子"); | ||
30 | + back = findViewById(R.id.back_top); | ||
31 | + back.setOnClickListener(new View.OnClickListener() { | ||
32 | + @Override | ||
33 | + public void onClick(View v) { | ||
34 | + finish(); | ||
35 | + } | ||
36 | + }); | ||
37 | + if(!TextUtils.isEmpty(childJson)) | ||
38 | + initChild(childJson); | ||
39 | + } | ||
40 | + | ||
41 | + private void initChild(String childJson) { | ||
42 | + Gson g=new Gson(); | ||
43 | + ChildBean childBean=g.fromJson(childJson, ChildBean.class); | ||
44 | + child_name.setText(childBean.getStudentName()); | ||
45 | + child_school.setText(childBean.getSchoolName()); | ||
46 | + child_class.setText(childBean.getClassName()); | ||
47 | + school_area.setText(childBean.getAreaName()); | ||
48 | + student_code.setText(childBean.getStudentCode()); | ||
49 | + | ||
50 | + } | ||
51 | + | ||
52 | + @Override | ||
53 | + protected int getLayoutId() { | ||
54 | + return R.layout.activity_child_detail; | ||
55 | + } | ||
56 | +} |
app/src/main/java/com/shunzhi/parent/ui/activity/MyChildActivity.java
@@ -25,7 +25,6 @@ import com.shunzhi.parent.bean.ChildClass; | @@ -25,7 +25,6 @@ import com.shunzhi.parent.bean.ChildClass; | ||
25 | import com.shunzhi.parent.bean.CurrentBean; | 25 | import com.shunzhi.parent.bean.CurrentBean; |
26 | import com.shunzhi.parent.contract.mine.MyChildContract; | 26 | import com.shunzhi.parent.contract.mine.MyChildContract; |
27 | import com.shunzhi.parent.presenter.mine.MyChildPresenter; | 27 | import com.shunzhi.parent.presenter.mine.MyChildPresenter; |
28 | -import com.shunzhi.parent.ui.MainActivity; | ||
29 | import com.shunzhi.parent.ui.activity.binding.SelectSchoolActivity; | 28 | import com.shunzhi.parent.ui.activity.binding.SelectSchoolActivity; |
30 | import com.yanzhenjie.recyclerview.swipe.SwipeMenu; | 29 | import com.yanzhenjie.recyclerview.swipe.SwipeMenu; |
31 | import com.yanzhenjie.recyclerview.swipe.SwipeMenuBridge; | 30 | import com.yanzhenjie.recyclerview.swipe.SwipeMenuBridge; |
@@ -34,6 +33,7 @@ import com.yanzhenjie.recyclerview.swipe.SwipeMenuItem; | @@ -34,6 +33,7 @@ import com.yanzhenjie.recyclerview.swipe.SwipeMenuItem; | ||
34 | import com.yanzhenjie.recyclerview.swipe.SwipeMenuItemClickListener; | 33 | import com.yanzhenjie.recyclerview.swipe.SwipeMenuItemClickListener; |
35 | import com.yanzhenjie.recyclerview.swipe.SwipeMenuRecyclerView; | 34 | import com.yanzhenjie.recyclerview.swipe.SwipeMenuRecyclerView; |
36 | 35 | ||
36 | +import java.util.ArrayList; | ||
37 | import java.util.List; | 37 | import java.util.List; |
38 | 38 | ||
39 | /** | 39 | /** |
@@ -45,6 +45,7 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | @@ -45,6 +45,7 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | ||
45 | SwipeMenuRecyclerView child_recycle; | 45 | SwipeMenuRecyclerView child_recycle; |
46 | TextView back, center_title, add_child; | 46 | TextView back, center_title, add_child; |
47 | ChildAdapter childAdapter; | 47 | ChildAdapter childAdapter; |
48 | + List<ChildBean> currlist = new ArrayList<>(); | ||
48 | 49 | ||
49 | @NonNull | 50 | @NonNull |
50 | @Override | 51 | @Override |
@@ -72,7 +73,7 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | @@ -72,7 +73,7 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | ||
72 | child_recycle.setSwipeMenuCreator(swipeMenuCreator); | 73 | child_recycle.setSwipeMenuCreator(swipeMenuCreator); |
73 | child_recycle.setSwipeMenuItemClickListener(new SwipeMenuItemClickListener() { | 74 | child_recycle.setSwipeMenuItemClickListener(new SwipeMenuItemClickListener() { |
74 | @Override | 75 | @Override |
75 | - public void onItemClick(SwipeMenuBridge menuBridge) { | 76 | + public void onItemClick(final SwipeMenuBridge menuBridge) { |
76 | final PopupWindow popupWindow = new PopupWindow(); | 77 | final PopupWindow popupWindow = new PopupWindow(); |
77 | popupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT); | 78 | popupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT); |
78 | popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); | 79 | popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); |
@@ -92,7 +93,9 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | @@ -92,7 +93,9 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | ||
92 | btn_right.setOnClickListener(new View.OnClickListener() { | 93 | btn_right.setOnClickListener(new View.OnClickListener() { |
93 | @Override | 94 | @Override |
94 | public void onClick(View v) { | 95 | public void onClick(View v) { |
95 | - | 96 | + popupWindow.dismiss(); |
97 | + mPresenter.unBinndingResult(Integer.parseInt(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.PARENT_ID)) | ||
98 | + , currlist.get(menuBridge.getPosition()).getStudentId()); | ||
96 | } | 99 | } |
97 | }); | 100 | }); |
98 | popupWindow.setContentView(view); | 101 | popupWindow.setContentView(view); |
@@ -100,7 +103,7 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | @@ -100,7 +103,7 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | ||
100 | 103 | ||
101 | } | 104 | } |
102 | }); | 105 | }); |
103 | - mPresenter.loadChildList(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME),0,""); | 106 | + mPresenter.loadChildList(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME), 0, ""); |
104 | } | 107 | } |
105 | 108 | ||
106 | @Override | 109 | @Override |
@@ -111,7 +114,7 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | @@ -111,7 +114,7 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | ||
111 | @Override | 114 | @Override |
112 | public void onClick(View v) { | 115 | public void onClick(View v) { |
113 | if (v == back) { | 116 | if (v == back) { |
114 | - startActivity(new Intent().setClass(MyChildActivity.this, MainActivity.class)); | 117 | +// startActivity(new Intent().setClass(MyChildActivity.this, MainActivity.class)); |
115 | finish(); | 118 | finish(); |
116 | } else if (v == add_child) { | 119 | } else if (v == add_child) { |
117 | startActivity(new Intent().setClass(MyChildActivity.this, SelectSchoolActivity.class)); | 120 | startActivity(new Intent().setClass(MyChildActivity.this, SelectSchoolActivity.class)); |
@@ -119,9 +122,12 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | @@ -119,9 +122,12 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | ||
119 | } | 122 | } |
120 | 123 | ||
121 | @Override | 124 | @Override |
122 | - public void updateChilsList(CurrentBean currentBean) { | ||
123 | - List<ChildBean>list=currentBean.getStudentClass(); | ||
124 | - childAdapter = new ChildAdapter(this); | 125 | + public void updateChildList(CurrentBean currentBean) { |
126 | + List<ChildBean> list = currentBean.getStudentClass(); | ||
127 | + currlist.addAll(list); | ||
128 | + if (childAdapter == null) { | ||
129 | + childAdapter = new ChildAdapter(this); | ||
130 | + } | ||
125 | childAdapter.addAll(list); | 131 | childAdapter.addAll(list); |
126 | child_recycle.setAdapter(childAdapter); | 132 | child_recycle.setAdapter(childAdapter); |
127 | 133 | ||
@@ -139,7 +145,8 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | @@ -139,7 +145,8 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | ||
139 | 145 | ||
140 | @Override | 146 | @Override |
141 | public void showError(String error) { | 147 | public void showError(String error) { |
142 | - | 148 | + if (error.equals("解绑成功")) ; |
149 | + mPresenter.loadChildList(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME), 0, ""); | ||
143 | } | 150 | } |
144 | 151 | ||
145 | private SwipeMenuCreator swipeMenuCreator = new SwipeMenuCreator() { | 152 | private SwipeMenuCreator swipeMenuCreator = new SwipeMenuCreator() { |
@@ -160,11 +167,9 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | @@ -160,11 +167,9 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | ||
160 | }; | 167 | }; |
161 | 168 | ||
162 | 169 | ||
163 | - | ||
164 | - public void backgroundAlpha(float bgAlpha) | ||
165 | - { | 170 | + public void backgroundAlpha(float bgAlpha) { |
166 | WindowManager.LayoutParams lp = getWindow().getAttributes(); | 171 | WindowManager.LayoutParams lp = getWindow().getAttributes(); |
167 | - lp.alpha = bgAlpha; //0.0-1.0 | 172 | + lp.alpha = bgAlpha; //0.0-1.0 |
168 | getWindow().setAttributes(lp); | 173 | getWindow().setAttributes(lp); |
169 | } | 174 | } |
170 | 175 |
app/src/main/java/com/shunzhi/parent/ui/activity/binding/CheckInfoActivity.java
@@ -50,6 +50,12 @@ public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyC | @@ -50,6 +50,12 @@ public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyC | ||
50 | protected void initView(Bundle savedInstanceState) { | 50 | protected void initView(Bundle savedInstanceState) { |
51 | iphone_layout = findViewById(R.id.iphone_layout); | 51 | iphone_layout = findViewById(R.id.iphone_layout); |
52 | back = findViewById(R.id.back_top); | 52 | back = findViewById(R.id.back_top); |
53 | + back.setOnClickListener(new View.OnClickListener() { | ||
54 | + @Override | ||
55 | + public void onClick(View v) { | ||
56 | + finish(); | ||
57 | + } | ||
58 | + }); | ||
53 | center_title = findViewById(R.id.center_title); | 59 | center_title = findViewById(R.id.center_title); |
54 | center_title.setText("信息核对"); | 60 | center_title.setText("信息核对"); |
55 | child_name = findViewById(R.id.child_name); | 61 | child_name = findViewById(R.id.child_name); |
@@ -111,7 +117,7 @@ public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyC | @@ -111,7 +117,7 @@ public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyC | ||
111 | } | 117 | } |
112 | 118 | ||
113 | @Override | 119 | @Override |
114 | - public void updateChilsList(CurrentBean currentBean) { | 120 | + public void updateChildList(CurrentBean currentBean) { |
115 | List<ChildBean> list = currentBean.getStudentClass(); | 121 | List<ChildBean> list = currentBean.getStudentClass(); |
116 | isNew = currentBean.isNew(); | 122 | isNew = currentBean.isNew(); |
117 | user_mobile.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME)); | 123 | user_mobile.setText(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME)); |
app/src/main/java/com/shunzhi/parent/ui/activity/binding/CreateChildInfoActivity.java
@@ -55,6 +55,12 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | @@ -55,6 +55,12 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | ||
55 | center_title = findViewById(R.id.center_title); | 55 | center_title = findViewById(R.id.center_title); |
56 | center_title.setText("填写孩子信息"); | 56 | center_title.setText("填写孩子信息"); |
57 | back = findViewById(R.id.back_top); | 57 | back = findViewById(R.id.back_top); |
58 | + back.setOnClickListener(new View.OnClickListener() { | ||
59 | + @Override | ||
60 | + public void onClick(View v) { | ||
61 | + finish(); | ||
62 | + } | ||
63 | + }); | ||
58 | add_child = findViewById(R.id.add_child); | 64 | add_child = findViewById(R.id.add_child); |
59 | child_name = findViewById(R.id.child_name); | 65 | child_name = findViewById(R.id.child_name); |
60 | select_sex = findViewById(R.id.select_sex); | 66 | select_sex = findViewById(R.id.select_sex); |
@@ -116,7 +122,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | @@ -116,7 +122,7 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | ||
116 | } | 122 | } |
117 | 123 | ||
118 | @Override | 124 | @Override |
119 | - public void updateChilsList(CurrentBean currentBean) { | 125 | + public void updateChildList(CurrentBean currentBean) { |
120 | 126 | ||
121 | } | 127 | } |
122 | 128 |
app/src/main/java/com/shunzhi/parent/ui/activity/binding/SelectSchoolActivity.java
@@ -58,6 +58,12 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity<SchoolListContra | @@ -58,6 +58,12 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity<SchoolListContra | ||
58 | dialog = findViewById(R.id.dialog); | 58 | dialog = findViewById(R.id.dialog); |
59 | go_next = findViewById(R.id.go_next); | 59 | go_next = findViewById(R.id.go_next); |
60 | back = findViewById(R.id.back_top); | 60 | back = findViewById(R.id.back_top); |
61 | + back.setOnClickListener(new View.OnClickListener() { | ||
62 | + @Override | ||
63 | + public void onClick(View v) { | ||
64 | + finish(); | ||
65 | + } | ||
66 | + }); | ||
61 | center_title = findViewById(R.id.center_title); | 67 | center_title = findViewById(R.id.center_title); |
62 | center_title.setText("选择孩子学校"); | 68 | center_title.setText("选择孩子学校"); |
63 | go_next.setOnClickListener(this); | 69 | go_next.setOnClickListener(this); |
app/src/main/java/com/shunzhi/parent/ui/fragment/loginandregistfragment/LoginAndRegistFragment.java
1 | package com.shunzhi.parent.ui.fragment.loginandregistfragment; | 1 | package com.shunzhi.parent.ui.fragment.loginandregistfragment; |
2 | 2 | ||
3 | import android.content.Intent; | 3 | import android.content.Intent; |
4 | -import android.os.Build; | ||
5 | import android.os.Bundle; | 4 | import android.os.Bundle; |
6 | import android.support.annotation.NonNull; | 5 | import android.support.annotation.NonNull; |
7 | import android.support.annotation.Nullable; | 6 | import android.support.annotation.Nullable; |
8 | -import android.support.annotation.RequiresApi; | ||
9 | import android.text.Editable; | 7 | import android.text.Editable; |
10 | import android.text.TextUtils; | 8 | import android.text.TextUtils; |
11 | import android.text.TextWatcher; | 9 | import android.text.TextWatcher; |
12 | -import android.util.Log; | ||
13 | import android.view.Gravity; | 10 | import android.view.Gravity; |
14 | import android.view.LayoutInflater; | 11 | import android.view.LayoutInflater; |
15 | import android.view.View; | 12 | import android.view.View; |
@@ -41,13 +38,15 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | @@ -41,13 +38,15 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | ||
41 | implements LoginAndRegisterContract.ILoginView, View.OnClickListener { | 38 | implements LoginAndRegisterContract.ILoginView, View.OnClickListener { |
42 | 39 | ||
43 | public RoundedImageView roundedImageView; | 40 | public RoundedImageView roundedImageView; |
44 | - public EditText phoneNumber, idCode, password; | ||
45 | - public TextView get_idCode, loginAndRegister, tv_info, tv_goto; | ||
46 | - public LinearLayout phoneLayout, idCodeLayout, passwordLayout, main_login; | ||
47 | - public ImageView img_eye; | 41 | + public EditText phoneNumber, idCode, password, et_password_new; |
42 | + public TextView get_idCode, loginAndRegister, tv_info, tv_goto, tv_goto_zhuce, tv_goto_mima; | ||
43 | + public LinearLayout phoneLayout, idCodeLayout, passwordLayout, main_login, passwordLayout_new; | ||
44 | + public ImageView img_eye, img_eye_new, back_login; | ||
48 | public static String typepage; | 45 | public static String typepage; |
49 | public boolean open = false; | 46 | public boolean open = false; |
47 | + public boolean opennew = false; | ||
50 | public static MyProcessDialog progressDialog; | 48 | public static MyProcessDialog progressDialog; |
49 | + LinearLayout denglu, zhuce; | ||
51 | 50 | ||
52 | 51 | ||
53 | public static LoginAndRegistFragment getInstance(String type) { | 52 | public static LoginAndRegistFragment getInstance(String type) { |
@@ -71,6 +70,11 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | @@ -71,6 +70,11 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | ||
71 | @Override | 70 | @Override |
72 | public void initUI(View view, @Nullable Bundle savedInstanceState) { | 71 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
73 | progressDialog = new MyProcessDialog(getActivity()); | 72 | progressDialog = new MyProcessDialog(getActivity()); |
73 | + tv_goto_zhuce = view.findViewById(R.id.tv_goto_zhuce); | ||
74 | + tv_goto_mima = view.findViewById(R.id.tv_goto_mima); | ||
75 | + back_login = view.findViewById(R.id.back_login); | ||
76 | + denglu = view.findViewById(R.id.denglu); | ||
77 | + zhuce = view.findViewById(R.id.zhuce); | ||
74 | main_login = view.findViewById(R.id.main_login); | 78 | main_login = view.findViewById(R.id.main_login); |
75 | roundedImageView = view.findViewById(R.id.photoImage); | 79 | roundedImageView = view.findViewById(R.id.photoImage); |
76 | phoneNumber = view.findViewById(R.id.et_phoneNumber); | 80 | phoneNumber = view.findViewById(R.id.et_phoneNumber); |
@@ -84,24 +88,45 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | @@ -84,24 +88,45 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | ||
84 | idCodeLayout = view.findViewById(R.id.idCodeLayout); | 88 | idCodeLayout = view.findViewById(R.id.idCodeLayout); |
85 | passwordLayout = view.findViewById(R.id.passwordLayout); | 89 | passwordLayout = view.findViewById(R.id.passwordLayout); |
86 | img_eye = view.findViewById(R.id.img_eye); | 90 | img_eye = view.findViewById(R.id.img_eye); |
91 | + img_eye_new = view.findViewById(R.id.img_eye_new); | ||
87 | get_idCode.setOnClickListener(this); | 92 | get_idCode.setOnClickListener(this); |
93 | + tv_goto_zhuce.setOnClickListener(this); | ||
94 | + tv_goto_mima.setOnClickListener(this); | ||
88 | tv_goto.setOnClickListener(this); | 95 | tv_goto.setOnClickListener(this); |
89 | loginAndRegister.setOnClickListener(this); | 96 | loginAndRegister.setOnClickListener(this); |
90 | img_eye.setOnClickListener(this); | 97 | img_eye.setOnClickListener(this); |
98 | + img_eye_new.setOnClickListener(this); | ||
99 | + back_login.setOnClickListener(this); | ||
91 | phoneNumber.addTextChangedListener(textWatcher); | 100 | phoneNumber.addTextChangedListener(textWatcher); |
92 | idCode.addTextChangedListener(textWatcher); | 101 | idCode.addTextChangedListener(textWatcher); |
93 | password.addTextChangedListener(textWatcher); | 102 | password.addTextChangedListener(textWatcher); |
94 | mPresenter.loginResult("18358585335", "575335"); | 103 | mPresenter.loginResult("18358585335", "575335"); |
104 | + | ||
105 | + passwordLayout_new = view.findViewById(R.id.passwordLayout_new); | ||
106 | + et_password_new = view.findViewById(R.id.et_password_new); | ||
107 | + et_password_new.addTextChangedListener(textWatcher); | ||
108 | + | ||
95 | if ("登录".equals(typepage)) { | 109 | if ("登录".equals(typepage)) { |
96 | idCodeLayout.setVisibility(View.GONE); | 110 | idCodeLayout.setVisibility(View.GONE); |
111 | + passwordLayout_new.setVisibility(View.GONE); | ||
97 | loginAndRegister.setText("登录"); | 112 | loginAndRegister.setText("登录"); |
98 | - tv_info.setText("还没有账号"); | ||
99 | - tv_goto.setText("注册"); | 113 | + denglu.setVisibility(View.VISIBLE); |
114 | + zhuce.setVisibility(View.GONE); | ||
115 | + back_login.setVisibility(View.INVISIBLE); | ||
100 | } else if ("注册".equals(typepage)) { | 116 | } else if ("注册".equals(typepage)) { |
101 | idCodeLayout.setVisibility(View.VISIBLE); | 117 | idCodeLayout.setVisibility(View.VISIBLE); |
118 | + passwordLayout_new.setVisibility(View.GONE); | ||
102 | loginAndRegister.setText("注册"); | 119 | loginAndRegister.setText("注册"); |
103 | - tv_info.setText("已注册,直接登录"); | ||
104 | - tv_goto.setText("登录"); | 120 | + denglu.setVisibility(View.GONE); |
121 | + zhuce.setVisibility(View.VISIBLE); | ||
122 | + back_login.setVisibility(View.INVISIBLE); | ||
123 | + } else if ("找回密码".equals(typepage)) { | ||
124 | + idCodeLayout.setVisibility(View.VISIBLE); | ||
125 | + passwordLayout_new.setVisibility(View.VISIBLE); | ||
126 | + loginAndRegister.setText("确定"); | ||
127 | + denglu.setVisibility(View.GONE); | ||
128 | + zhuce.setVisibility(View.GONE); | ||
129 | + back_login.setVisibility(View.VISIBLE); | ||
105 | } | 130 | } |
106 | 131 | ||
107 | roundedImageView.setOnClickListener(new View.OnClickListener() { | 132 | roundedImageView.setOnClickListener(new View.OnClickListener() { |
@@ -124,12 +149,15 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | @@ -124,12 +149,15 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | ||
124 | popupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT); | 149 | popupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT); |
125 | popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); | 150 | popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); |
126 | View view = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_view, null); | 151 | View view = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_view, null); |
152 | + TextView dialogInfo = view.findViewById(R.id.dialog_info); | ||
153 | + dialogInfo.setText("注册成功"); | ||
127 | TextView right_btn = view.findViewById(R.id.right_btn); | 154 | TextView right_btn = view.findViewById(R.id.right_btn); |
155 | + right_btn.setText("进入首页"); | ||
128 | right_btn.setOnClickListener(new View.OnClickListener() { | 156 | right_btn.setOnClickListener(new View.OnClickListener() { |
129 | @Override | 157 | @Override |
130 | public void onClick(View v) { | 158 | public void onClick(View v) { |
131 | progressDialog.show(); | 159 | progressDialog.show(); |
132 | - mPresenter.loginResult(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME),AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_PWD)); | 160 | + mPresenter.loginResult(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_NAME), AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.LOGIN_PWD)); |
133 | } | 161 | } |
134 | }); | 162 | }); |
135 | TextView cancel_btn = view.findViewById(R.id.cancel_btn); | 163 | TextView cancel_btn = view.findViewById(R.id.cancel_btn); |
@@ -147,28 +175,29 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | @@ -147,28 +175,29 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | ||
147 | } | 175 | } |
148 | 176 | ||
149 | 177 | ||
150 | - | ||
151 | } | 178 | } |
152 | 179 | ||
153 | - @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) | ||
154 | @Override | 180 | @Override |
155 | public void onClick(View v) { | 181 | public void onClick(View v) { |
156 | if (v == loginAndRegister) { | 182 | if (v == loginAndRegister) { |
157 | progressDialog.show(); | 183 | progressDialog.show(); |
158 | - Date l = Calendar.getInstance().getTime(); | ||
159 | // Log.e("1111--==", l.getTime() + ""); | 184 | // Log.e("1111--==", l.getTime() + ""); |
160 | if (loginAndRegister.getText().toString().trim().equals("登录")) { | 185 | if (loginAndRegister.getText().toString().trim().equals("登录")) { |
161 | mPresenter.loginResult(phoneNumber.getText().toString(), password.getText().toString()); | 186 | mPresenter.loginResult(phoneNumber.getText().toString(), password.getText().toString()); |
162 | } else if (loginAndRegister.getText().toString().trim().equals("注册")) { | 187 | } else if (loginAndRegister.getText().toString().trim().equals("注册")) { |
163 | mPresenter.registerResult(phoneNumber.getText().toString(), idCode.getText().toString(), password.getText().toString()); | 188 | mPresenter.registerResult(phoneNumber.getText().toString(), idCode.getText().toString(), password.getText().toString()); |
189 | + } else if (loginAndRegister.getText().toString().trim().equals("确定")) { | ||
190 | + //修改密码 | ||
164 | } | 191 | } |
165 | 192 | ||
166 | } else if (v == tv_goto) { | 193 | } else if (v == tv_goto) { |
167 | - if (tv_goto.getText().toString().equals("登录")) { | ||
168 | - startActivity(new Intent().putExtra("type", "登录").setClass(getActivity(), LoginAndRegistActivity.class)); | ||
169 | - } else if (tv_goto.getText().toString().equals("注册")) { | ||
170 | - startActivity(new Intent().putExtra("type", "注册").setClass(getActivity(), LoginAndRegistActivity.class)); | ||
171 | - } | 194 | + startActivity(new Intent().putExtra("type", "登录").setClass(getActivity(), LoginAndRegistActivity.class)); |
195 | + getActivity().finish(); | ||
196 | + } else if (v == tv_goto_zhuce) { | ||
197 | + startActivity(new Intent().putExtra("type", "注册").setClass(getActivity(), LoginAndRegistActivity.class)); | ||
198 | + getActivity().finish(); | ||
199 | + } else if (v == tv_goto_mima) { | ||
200 | + startActivity(new Intent().putExtra("type", "找回密码").setClass(getActivity(), LoginAndRegistActivity.class)); | ||
172 | getActivity().finish(); | 201 | getActivity().finish(); |
173 | } else if (v == get_idCode) { | 202 | } else if (v == get_idCode) { |
174 | mPresenter.idCodeResult(phoneNumber.getText().toString()); | 203 | mPresenter.idCodeResult(phoneNumber.getText().toString()); |
@@ -183,6 +212,19 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | @@ -183,6 +212,19 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | ||
183 | open = true; | 212 | open = true; |
184 | } | 213 | } |
185 | password.setSelection(password.getText().toString().length()); | 214 | password.setSelection(password.getText().toString().length()); |
215 | + } else if (v == img_eye_new) { | ||
216 | + if (opennew) { | ||
217 | + img_eye_new.setImageResource(R.drawable.eye_close); | ||
218 | + et_password_new.setInputType(0x81); | ||
219 | + opennew = false; | ||
220 | + } else { | ||
221 | + img_eye_new.setImageResource(R.drawable.eye_open); | ||
222 | + et_password_new.setInputType(0x90); | ||
223 | + opennew = true; | ||
224 | + } | ||
225 | + } else if (v == back_login) { | ||
226 | + startActivity(new Intent().putExtra("type", "登录").setClass(getActivity(), LoginAndRegistActivity.class)); | ||
227 | + getActivity().finish(); | ||
186 | } | 228 | } |
187 | } | 229 | } |
188 | 230 | ||
@@ -210,6 +252,14 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | @@ -210,6 +252,14 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | ||
210 | loginAndRegister.setEnabled(false); | 252 | loginAndRegister.setEnabled(false); |
211 | loginAndRegister.setBackgroundResource(R.drawable.rudiobtn_unclick); | 253 | loginAndRegister.setBackgroundResource(R.drawable.rudiobtn_unclick); |
212 | } | 254 | } |
255 | + } else if (loginAndRegister.getText().toString().trim().equals("确定")) { | ||
256 | + if (!TextUtils.isEmpty(phoneNumber.getText().toString()) && !TextUtils.isEmpty(idCode.getText().toString()) && !TextUtils.isEmpty(password.getText().toString()) && !TextUtils.isEmpty(et_password_new.getText().toString())) { | ||
257 | + loginAndRegister.setEnabled(true); | ||
258 | + loginAndRegister.setBackgroundResource(R.drawable.rudiobtn); | ||
259 | + } else { | ||
260 | + loginAndRegister.setEnabled(false); | ||
261 | + loginAndRegister.setBackgroundResource(R.drawable.rudiobtn_unclick); | ||
262 | + } | ||
213 | } | 263 | } |
214 | } | 264 | } |
215 | 265 |
app/src/main/res/drawable-xhdpi/arrow_left.png
app/src/main/res/drawable-xhdpi/arrow_right.png
app/src/main/res/layout/activity_child_detail.xml
@@ -38,7 +38,7 @@ | @@ -38,7 +38,7 @@ | ||
38 | <TextView | 38 | <TextView |
39 | android:layout_width="wrap_content" | 39 | android:layout_width="wrap_content" |
40 | android:layout_height="wrap_content" | 40 | android:layout_height="wrap_content" |
41 | - android:text="孩子姓名:" | 41 | + android:text=" 孩子姓名:" |
42 | android:textSize="@dimen/sp_16" /> | 42 | android:textSize="@dimen/sp_16" /> |
43 | 43 | ||
44 | <TextView | 44 | <TextView |
@@ -62,7 +62,7 @@ | @@ -62,7 +62,7 @@ | ||
62 | <TextView | 62 | <TextView |
63 | android:layout_width="wrap_content" | 63 | android:layout_width="wrap_content" |
64 | android:layout_height="wrap_content" | 64 | android:layout_height="wrap_content" |
65 | - android:text="学 校:" | 65 | + android:text=" 学 校:" |
66 | android:textSize="@dimen/sp_16" /> | 66 | android:textSize="@dimen/sp_16" /> |
67 | 67 | ||
68 | <TextView | 68 | <TextView |
@@ -88,7 +88,7 @@ | @@ -88,7 +88,7 @@ | ||
88 | <TextView | 88 | <TextView |
89 | android:layout_width="wrap_content" | 89 | android:layout_width="wrap_content" |
90 | android:layout_height="wrap_content" | 90 | android:layout_height="wrap_content" |
91 | - android:text="班 级:" | 91 | + android:text=" 班 级:" |
92 | android:textSize="@dimen/sp_16" /> | 92 | android:textSize="@dimen/sp_16" /> |
93 | 93 | ||
94 | <TextView | 94 | <TextView |
@@ -134,30 +134,19 @@ | @@ -134,30 +134,19 @@ | ||
134 | <TextView | 134 | <TextView |
135 | android:layout_width="wrap_content" | 135 | android:layout_width="wrap_content" |
136 | android:layout_height="wrap_content" | 136 | android:layout_height="wrap_content" |
137 | - android:text="学生账号:" | 137 | + android:text=" 学生账号:" |
138 | android:textSize="@dimen/sp_16" /> | 138 | android:textSize="@dimen/sp_16" /> |
139 | 139 | ||
140 | <TextView | 140 | <TextView |
141 | - android:id="@+id/" | 141 | + android:id="@+id/student_code" |
142 | android:layout_width="wrap_content" | 142 | android:layout_width="wrap_content" |
143 | android:layout_height="match_parent" | 143 | android:layout_height="match_parent" |
144 | android:layout_weight="1" | 144 | android:layout_weight="1" |
145 | android:background="@drawable/rudio_bord" | 145 | android:background="@drawable/rudio_bord" |
146 | android:gravity="center" | 146 | android:gravity="center" |
147 | android:textColor="@color/textColor" /> | 147 | android:textColor="@color/textColor" /> |
148 | - | ||
149 | </LinearLayout> | 148 | </LinearLayout> |
150 | - <TextView | ||
151 | - android:id="@+id/add_child" | ||
152 | - android:layout_width="220dp" | ||
153 | - android:layout_height="40dp" | ||
154 | - android:layout_gravity="center_horizontal" | ||
155 | - android:layout_marginTop="20dp" | ||
156 | - android:background="@drawable/rudiobtn" | ||
157 | - android:gravity="center" | ||
158 | - android:text="确定" | ||
159 | - android:textColor="@color/white" | ||
160 | - android:textSize="@dimen/txtsize_title" /> | 149 | + |
161 | </LinearLayout> | 150 | </LinearLayout> |
162 | 151 | ||
163 | 152 |
app/src/main/res/layout/fragment_login_and_regist.xml
@@ -11,6 +11,18 @@ | @@ -11,6 +11,18 @@ | ||
11 | android:layout_width="match_parent" | 11 | android:layout_width="match_parent" |
12 | android:layout_height="match_parent" | 12 | android:layout_height="match_parent" |
13 | android:orientation="vertical"> | 13 | android:orientation="vertical"> |
14 | + <LinearLayout | ||
15 | + android:layout_width="match_parent" | ||
16 | + android:layout_height="wrap_content"> | ||
17 | + <ImageView | ||
18 | + android:layout_marginTop="10dp" | ||
19 | + android:id="@+id/back_login" | ||
20 | + android:layout_width="60dp" | ||
21 | + android:layout_height="20dp" | ||
22 | + android:visibility="invisible" | ||
23 | + android:src="@drawable/arrow_left" | ||
24 | + /> | ||
25 | + </LinearLayout> | ||
14 | 26 | ||
15 | <com.makeramen.roundedimageview.RoundedImageView | 27 | <com.makeramen.roundedimageview.RoundedImageView |
16 | android:id="@+id/photoImage" | 28 | android:id="@+id/photoImage" |
@@ -235,7 +247,7 @@ | @@ -235,7 +247,7 @@ | ||
235 | android:textSize="@dimen/sp_16" /> | 247 | android:textSize="@dimen/sp_16" /> |
236 | 248 | ||
237 | <TextView | 249 | <TextView |
238 | - android:id="@+id/tv_goto_login" | 250 | + android:id="@+id/tv_goto_zhuce" |
239 | android:layout_width="wrap_content" | 251 | android:layout_width="wrap_content" |
240 | android:layout_height="wrap_content" | 252 | android:layout_height="wrap_content" |
241 | android:text="注册" | 253 | android:text="注册" |
@@ -247,6 +259,7 @@ | @@ -247,6 +259,7 @@ | ||
247 | android:layout_weight="1" | 259 | android:layout_weight="1" |
248 | /> | 260 | /> |
249 | <TextView | 261 | <TextView |
262 | + android:id="@+id/tv_goto_mima" | ||
250 | android:layout_width="wrap_content" | 263 | android:layout_width="wrap_content" |
251 | android:layout_height="wrap_content" | 264 | android:layout_height="wrap_content" |
252 | android:text="忘记密码" | 265 | android:text="忘记密码" |
app/src/main/res/layout/fragment_mine.xml
@@ -71,8 +71,8 @@ | @@ -71,8 +71,8 @@ | ||
71 | </LinearLayout> | 71 | </LinearLayout> |
72 | 72 | ||
73 | <ImageView | 73 | <ImageView |
74 | - android:layout_width="40dp" | ||
75 | - android:layout_height="40dp" | 74 | + android:layout_width="30dp" |
75 | + android:layout_height="30dp" | ||
76 | android:layout_marginRight="20dp" | 76 | android:layout_marginRight="20dp" |
77 | android:layout_gravity="center_vertical" | 77 | android:layout_gravity="center_vertical" |
78 | android:src="@drawable/arrow_right" /> | 78 | android:src="@drawable/arrow_right" /> |
app/src/main/res/layout/item_childlist.xml
@@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
4 | android:layout_height="wrap_content"> | 4 | android:layout_height="wrap_content"> |
5 | 5 | ||
6 | <LinearLayout | 6 | <LinearLayout |
7 | + android:id="@+id/item_view" | ||
7 | android:layout_margin="10dp" | 8 | android:layout_margin="10dp" |
8 | android:layout_width="match_parent" | 9 | android:layout_width="match_parent" |
9 | android:layout_height="wrap_content"> | 10 | android:layout_height="wrap_content"> |