Commit 067374b8a09f9f2d73758e2d4be4fb8b0eb4a977
Exists in
yxb_dev
and in
2 other branches
Merge branch 'yxb_dev' of http://git.shunzhi.net/taohd/parentwork into developer
# Conflicts: # app/src/main/AndroidManifest.xml # app/src/main/java/com/shunzhi/parent/ui/fragment/ReportFragment.java # app/src/main/res/layout/fragment_report.xml # mvpsdk/src/main/java/com/share/mvpsdk/base/activity/BaseCompatActivity.java # mvpsdk/src/main/java/com/share/mvpsdk/utils/OkHttpExceptionUtil.java
Showing
50 changed files
with
2331 additions
and
63 deletions
Show diff stats
app/src/main/AndroidManifest.xml
@@ -64,7 +64,7 @@ | @@ -64,7 +64,7 @@ | ||
64 | android:name="com.amap.api.v2.apikey" | 64 | android:name="com.amap.api.v2.apikey" |
65 | android:value="1d130afb822d8a1019e6592cbaf10bcc" /> | 65 | android:value="1d130afb822d8a1019e6592cbaf10bcc" /> |
66 | 66 | ||
67 | - <activity android:name=".ui.MainActivity"> | 67 | + <activity android:name=".ui.activity.LoginAndRegistActivity"> |
68 | <intent-filter> | 68 | <intent-filter> |
69 | <action android:name="android.intent.action.MAIN" /> | 69 | <action android:name="android.intent.action.MAIN" /> |
70 | 70 | ||
@@ -72,14 +72,31 @@ | @@ -72,14 +72,31 @@ | ||
72 | </intent-filter> | 72 | </intent-filter> |
73 | </activity> | 73 | </activity> |
74 | <!-- <activity android:name=".ui.activity.LoginAndRegistActivity" /> --> | 74 | <!-- <activity android:name=".ui.activity.LoginAndRegistActivity" /> --> |
75 | - <activity android:name=".ui.activity.StartActivity" /> | ||
76 | - <activity | ||
77 | - android:name=".ui.activity.LoginAndRegistActivity" | ||
78 | - android:screenOrientation="portrait" /> | ||
79 | <activity | 75 | <activity |
80 | android:name=".ui.activity.MyChildActivity" | 76 | android:name=".ui.activity.MyChildActivity" |
81 | android:screenOrientation="portrait" /> | 77 | android:screenOrientation="portrait" /> |
82 | <activity android:name=".ui.activity.consult.ConsultOneLevelActivity"></activity> | 78 | <activity android:name=".ui.activity.consult.ConsultOneLevelActivity"></activity> |
79 | + <!--<activity android:name=".ui.activity.LoginAndRegistActivity" />--> | ||
80 | + <activity android:name=".ui.activity.StartActivity" | ||
81 | + android:screenOrientation="portrait" | ||
82 | + ></activity> | ||
83 | + <activity android:name=".ui.activity.binding.SelectSchoolActivity" | ||
84 | + android:screenOrientation="portrait" | ||
85 | + android:windowSoftInputMode="adjustPan|stateHidden" | ||
86 | + ></activity> | ||
87 | + <!--<activity android:name=".ui.activity.LoginAndRegistActivity"--> | ||
88 | + <!--android:screenOrientation="portrait"--> | ||
89 | + <!--/>--> | ||
90 | + <activity android:name=".ui.activity.PersonInfoActivity" | ||
91 | + android:screenOrientation="portrait" | ||
92 | + | ||
93 | + android:windowSoftInputMode="adjustPan|stateHidden" | ||
94 | + /> | ||
95 | + <activity android:name=".ui.activity.binding.CheckInfoActivity" | ||
96 | + android:screenOrientation="portrait" | ||
97 | + | ||
98 | + android:windowSoftInputMode="adjustPan|stateHidden" | ||
99 | + /> | ||
83 | </application> | 100 | </application> |
84 | 101 | ||
85 | </manifest> | 102 | </manifest> |
86 | \ No newline at end of file | 103 | \ No newline at end of file |
app/src/main/java/com/shunzhi/parent/adapter/ReportAdapter.java
0 → 100644
@@ -0,0 +1,52 @@ | @@ -0,0 +1,52 @@ | ||
1 | +package com.shunzhi.parent.adapter; | ||
2 | + | ||
3 | + | ||
4 | +import android.content.Context; | ||
5 | +import android.view.LayoutInflater; | ||
6 | +import android.view.View; | ||
7 | +import android.view.ViewGroup; | ||
8 | + | ||
9 | +import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; | ||
10 | +import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; | ||
11 | +import com.shunzhi.parent.R; | ||
12 | +import com.shunzhi.parent.bean.ReportBean; | ||
13 | +import com.shunzhi.parent.views.ProgressView; | ||
14 | + | ||
15 | +/** | ||
16 | + * Created by Administrator on 2018/3/9 0009. | ||
17 | + */ | ||
18 | + | ||
19 | +public class ReportAdapter extends BaseRecyclerViewAdapter<ReportBean> { | ||
20 | + | ||
21 | + Context context; | ||
22 | + | ||
23 | + public ReportAdapter(Context context) { | ||
24 | + this.context = context; | ||
25 | + } | ||
26 | + | ||
27 | + | ||
28 | + @Override | ||
29 | + public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
30 | + View view = LayoutInflater.from(context).inflate(R.layout.item_report, null); | ||
31 | + return new MyViewHolder(view); | ||
32 | + } | ||
33 | + | ||
34 | + private class MyViewHolder extends BaseRecyclerViewHolder<ReportBean> { | ||
35 | + | ||
36 | + ProgressView ringView; | ||
37 | + | ||
38 | + | ||
39 | + public MyViewHolder(View view) { | ||
40 | + super(view); | ||
41 | + ringView = view.findViewById(R.id.ring); | ||
42 | + } | ||
43 | + | ||
44 | + @Override | ||
45 | + public void onBindViewHolder(ReportBean object, int position) { | ||
46 | + ringView.setMaxCount(100.0f); | ||
47 | + ringView.setCurrentCount(100); | ||
48 | + ringView.setScore(100); | ||
49 | + } | ||
50 | + | ||
51 | + } | ||
52 | +} |
app/src/main/java/com/shunzhi/parent/adapter/SchoolListAdapter.java
0 → 100644
@@ -0,0 +1,96 @@ | @@ -0,0 +1,96 @@ | ||
1 | +package com.shunzhi.parent.adapter; | ||
2 | + | ||
3 | + | ||
4 | +import android.content.Context; | ||
5 | +import android.view.LayoutInflater; | ||
6 | +import android.view.View; | ||
7 | +import android.view.ViewGroup; | ||
8 | +import android.widget.ImageView; | ||
9 | +import android.widget.TextView; | ||
10 | + | ||
11 | +import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; | ||
12 | +import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; | ||
13 | +import com.shunzhi.parent.R; | ||
14 | +import com.shunzhi.parent.bean.SchoolBean; | ||
15 | + | ||
16 | +import java.util.List; | ||
17 | + | ||
18 | +/** | ||
19 | + * Created by Administrator on 2018/3/9 0009. | ||
20 | + */ | ||
21 | + | ||
22 | +public class SchoolListAdapter extends BaseRecyclerViewAdapter<SchoolBean> { | ||
23 | + | ||
24 | + Context context; | ||
25 | + List<SchoolBean>list; | ||
26 | + | ||
27 | + public SchoolListAdapter(Context context,List<SchoolBean>list) { | ||
28 | + this.context = context; | ||
29 | + this.list=list; | ||
30 | + } | ||
31 | + | ||
32 | + | ||
33 | + @Override | ||
34 | + public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
35 | + View view = LayoutInflater.from(context).inflate(R.layout.item_school, null); | ||
36 | + return new MyViewHolder(view); | ||
37 | + } | ||
38 | + | ||
39 | + private class MyViewHolder extends BaseRecyclerViewHolder<SchoolBean> { | ||
40 | + TextView school_name; | ||
41 | + ImageView select_school; | ||
42 | + TextView tvLetter; | ||
43 | + | ||
44 | + public MyViewHolder(View view) { | ||
45 | + super(view); | ||
46 | + school_name = view.findViewById(R.id.school_name); | ||
47 | + select_school = view.findViewById(R.id.select_school); | ||
48 | + tvLetter = view.findViewById(R.id.uiPPLetter); | ||
49 | + } | ||
50 | + | ||
51 | + @Override | ||
52 | + public void onBindViewHolder(SchoolBean object, int position) { | ||
53 | + int section = getSectionForPosition(position); | ||
54 | + //如果当前位置等于该分类首字母的Char的位置 ,则认为是第一次出现,并且不是老师 | ||
55 | + if (position == getPositionForSection(section)) { | ||
56 | + tvLetter.setVisibility(View.VISIBLE); | ||
57 | + tvLetter.setText(object.getSortLetters()); | ||
58 | + if (object.getSortLetters().equals("#")) { | ||
59 | + tvLetter.setVisibility(View.GONE); | ||
60 | + } | ||
61 | + } else { | ||
62 | + tvLetter.setVisibility(View.GONE); | ||
63 | + } | ||
64 | + | ||
65 | + school_name.setText(object.getSchoolname()); | ||
66 | + | ||
67 | + | ||
68 | + } | ||
69 | + | ||
70 | + | ||
71 | + | ||
72 | + | ||
73 | + } | ||
74 | + public int getPositionForSection(int section) { | ||
75 | + 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; | ||
80 | + } | ||
81 | + } | ||
82 | + | ||
83 | + return -1; | ||
84 | + } | ||
85 | + public int getCount() { | ||
86 | + return list.size(); | ||
87 | + } | ||
88 | + | ||
89 | + public int getSectionForPosition(int position) { | ||
90 | + | ||
91 | + return list.get(position).getSortLetters().charAt(0); | ||
92 | + | ||
93 | + } | ||
94 | + | ||
95 | + | ||
96 | +} |
app/src/main/java/com/shunzhi/parent/api/LoginRegisterApi.java
@@ -5,6 +5,7 @@ import com.google.gson.JsonObject; | @@ -5,6 +5,7 @@ import com.google.gson.JsonObject; | ||
5 | import io.reactivex.Observable; | 5 | import io.reactivex.Observable; |
6 | import retrofit2.http.Field; | 6 | import retrofit2.http.Field; |
7 | import retrofit2.http.FormUrlEncoded; | 7 | import retrofit2.http.FormUrlEncoded; |
8 | +import retrofit2.http.GET; | ||
8 | import retrofit2.http.POST; | 9 | import retrofit2.http.POST; |
9 | 10 | ||
10 | /** | 11 | /** |
@@ -12,7 +13,8 @@ import retrofit2.http.POST; | @@ -12,7 +13,8 @@ import retrofit2.http.POST; | ||
12 | */ | 13 | */ |
13 | 14 | ||
14 | public interface LoginRegisterApi { | 15 | public interface LoginRegisterApi { |
15 | - String url="http://campus.myjxt.com/"; | 16 | +// String url="http://campus.myjxt.com/"; |
17 | + String url="http://60.190.202.57:1000/"; | ||
16 | 18 | ||
17 | 19 | ||
18 | @FormUrlEncoded | 20 | @FormUrlEncoded |
@@ -22,10 +24,15 @@ public interface LoginRegisterApi { | @@ -22,10 +24,15 @@ public interface LoginRegisterApi { | ||
22 | , @Field("password") String password); | 24 | , @Field("password") String password); |
23 | 25 | ||
24 | @FormUrlEncoded | 26 | @FormUrlEncoded |
25 | - @POST("api/Account/CurrentInfo") | 27 | + @POST("/api/ParentHelper/ParentRegister") |
26 | Observable<JsonObject> registerResult( | 28 | Observable<JsonObject> registerResult( |
27 | - @Field("grant_type") String grant_type, @Field("username") String username | ||
28 | - , @Field("idcode") String idCode,@Field("password") String password); | 29 | + @Field("mobile") String username, @Field("captcha") String idCode,@Field("password") String password); |
30 | + | ||
31 | + | ||
32 | + | ||
33 | + @GET("api/Account/ChangePhoneCaptcha") | ||
34 | + Observable<JsonObject> getidCodeResult( | ||
35 | + @Field("mobile") String username); | ||
29 | 36 | ||
30 | @FormUrlEncoded | 37 | @FormUrlEncoded |
31 | @POST("api/Account/CurrentInfo") | 38 | @POST("api/Account/CurrentInfo") |
app/src/main/java/com/shunzhi/parent/bean/ReportBean.java
0 → 100644
app/src/main/java/com/shunzhi/parent/bean/SchoolBean.java
0 → 100644
@@ -0,0 +1,26 @@ | @@ -0,0 +1,26 @@ | ||
1 | +package com.shunzhi.parent.bean; | ||
2 | + | ||
3 | +/** | ||
4 | + * Created by Administrator on 2018/3/9 0009. | ||
5 | + */ | ||
6 | + | ||
7 | +public class SchoolBean { | ||
8 | + String schoolname; | ||
9 | + String SortLetters; | ||
10 | + | ||
11 | + public String getSchoolname() { | ||
12 | + return schoolname; | ||
13 | + } | ||
14 | + | ||
15 | + public void setSchoolname(String schoolname) { | ||
16 | + this.schoolname = schoolname; | ||
17 | + } | ||
18 | + | ||
19 | + public String getSortLetters() { | ||
20 | + return SortLetters; | ||
21 | + } | ||
22 | + | ||
23 | + public void setSortLetters(String sortLetters) { | ||
24 | + SortLetters = sortLetters; | ||
25 | + } | ||
26 | +} |
app/src/main/java/com/shunzhi/parent/contract/mine/PersonInfoContract.java
0 → 100644
@@ -0,0 +1,27 @@ | @@ -0,0 +1,27 @@ | ||
1 | +package com.shunzhi.parent.contract.mine; | ||
2 | + | ||
3 | +import com.share.mvpsdk.base.BasePresenter; | ||
4 | +import com.share.mvpsdk.base.IBaseActivity; | ||
5 | +import com.share.mvpsdk.base.IBaseModel; | ||
6 | + | ||
7 | +/** | ||
8 | + * Created by Administrator on 2018/3/10 0010. | ||
9 | + */ | ||
10 | + | ||
11 | +public interface PersonInfoContract { | ||
12 | + | ||
13 | + abstract class PersonInfoPresenter extends BasePresenter<IPersonInfoModel,IPersonInfoView> { | ||
14 | + | ||
15 | + } | ||
16 | + | ||
17 | + | ||
18 | + interface IPersonInfoModel extends IBaseModel { | ||
19 | + | ||
20 | + | ||
21 | + } | ||
22 | + interface IPersonInfoView extends IBaseActivity { | ||
23 | + | ||
24 | + | ||
25 | + } | ||
26 | + | ||
27 | +} |
app/src/main/java/com/shunzhi/parent/model/loginandregister/LoginAndRegisterModel.java
@@ -8,7 +8,6 @@ import com.shunzhi.parent.api.LoginRegisterApi; | @@ -8,7 +8,6 @@ import com.shunzhi.parent.api.LoginRegisterApi; | ||
8 | import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract; | 8 | import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract; |
9 | 9 | ||
10 | import io.reactivex.Observable; | 10 | import io.reactivex.Observable; |
11 | -import okhttp3.RequestBody; | ||
12 | 11 | ||
13 | /** | 12 | /** |
14 | * Created by Administrator on 2018/3/6 0006. | 13 | * Created by Administrator on 2018/3/6 0006. |
@@ -31,13 +30,14 @@ public class LoginAndRegisterModel extends BaseModel implements LoginAndRegiste | @@ -31,13 +30,14 @@ public class LoginAndRegisterModel extends BaseModel implements LoginAndRegiste | ||
31 | 30 | ||
32 | @Override | 31 | @Override |
33 | public Observable<JsonObject> getRegisterResult(String adminName, String idCode, String password) { | 32 | public Observable<JsonObject> getRegisterResult(String adminName, String idCode, String password) { |
34 | - return RetrofitCreateHelper.getInstance().createApi(LoginRegisterApi.class,LoginRegisterApi.url).registerResult("idcode",adminName,idCode,password) | 33 | + return RetrofitCreateHelper.getInstance().createApi(LoginRegisterApi.class,LoginRegisterApi.url).registerResult(adminName,idCode,password) |
35 | .compose(RxHelper.<JsonObject>rxSchedulerHelper()); | 34 | .compose(RxHelper.<JsonObject>rxSchedulerHelper()); |
36 | } | 35 | } |
37 | 36 | ||
38 | @Override | 37 | @Override |
39 | public Observable<JsonObject> getidCodeResult(String phoneNumber) { | 38 | public Observable<JsonObject> getidCodeResult(String phoneNumber) { |
40 | - return null; | 39 | + return RetrofitCreateHelper.getInstance().createApi(LoginRegisterApi.class,LoginRegisterApi.url).getidCodeResult(phoneNumber) |
40 | + .compose(RxHelper.<JsonObject>rxSchedulerHelper()); | ||
41 | } | 41 | } |
42 | 42 | ||
43 | } | 43 | } |
app/src/main/java/com/shunzhi/parent/model/mine/PersonInfoModel.java
0 → 100644
@@ -0,0 +1,14 @@ | @@ -0,0 +1,14 @@ | ||
1 | +package com.shunzhi.parent.model.mine; | ||
2 | + | ||
3 | +import com.share.mvpsdk.base.BaseModel; | ||
4 | +import com.shunzhi.parent.contract.mine.PersonInfoContract; | ||
5 | + | ||
6 | +/** | ||
7 | + * Created by Administrator on 2018/3/10 0010. | ||
8 | + */ | ||
9 | + | ||
10 | +public class PersonInfoModel extends BaseModel implements PersonInfoContract.IPersonInfoModel { | ||
11 | + public static PersonInfoModel newInstance() { | ||
12 | + return new PersonInfoModel(); | ||
13 | + } | ||
14 | +} |
app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
@@ -42,23 +42,23 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -42,23 +42,23 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
42 | try { | 42 | try { |
43 | if (jsonObject != null && !TextUtils.isEmpty(jsonObject.get("access_token").getAsString())) { | 43 | if (jsonObject != null && !TextUtils.isEmpty(jsonObject.get("access_token").getAsString())) { |
44 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.ACCESS_TOKEN, jsonObject.get("access_token").getAsString()); | 44 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.ACCESS_TOKEN, jsonObject.get("access_token").getAsString()); |
45 | - AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME,loginName); | 45 | + AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_NAME, loginName); |
46 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_PWD, loginPwd); | 46 | AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.LOGIN_PWD, loginPwd); |
47 | - RetrofitCreateHelper.getInstance().setAuthorization("Bearer "+jsonObject.get("access_token").getAsString()); | 47 | + RetrofitCreateHelper.getInstance().setAuthorization("Bearer " + jsonObject.get("access_token").getAsString()); |
48 | getUserInfo(); | 48 | getUserInfo(); |
49 | } else { | 49 | } else { |
50 | ToastUtils.showToast(jsonObject.get("error").getAsString()); | 50 | ToastUtils.showToast(jsonObject.get("error").getAsString()); |
51 | } | 51 | } |
52 | - }catch (Exception e){ | 52 | + } catch (Exception e) { |
53 | e.printStackTrace(); | 53 | e.printStackTrace(); |
54 | - ToastUtils.showToast("登录失败:"+e.toString()); | 54 | + ToastUtils.showToast("登录失败:" + e.toString()); |
55 | } | 55 | } |
56 | } | 56 | } |
57 | }, new Consumer<Throwable>() { | 57 | }, new Consumer<Throwable>() { |
58 | @Override | 58 | @Override |
59 | public void accept(Throwable throwable) throws Exception { | 59 | public void accept(Throwable throwable) throws Exception { |
60 | - if (null!=throwable) | ||
61 | - OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | 60 | + if (null != throwable) |
61 | + OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | ||
62 | // ToastUtils.showToast(throwable.getMessage()); | 62 | // ToastUtils.showToast(throwable.getMessage()); |
63 | } | 63 | } |
64 | })); | 64 | })); |
@@ -74,18 +74,19 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -74,18 +74,19 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
74 | if (mIModel == null || mIView == null) { | 74 | if (mIModel == null || mIView == null) { |
75 | return; | 75 | return; |
76 | } | 76 | } |
77 | - mIView.getUserInfo(); | 77 | + |
78 | mRxManager.register(mIModel.getRegisterResult(adminName, idCode, password).subscribe(new Consumer<JsonObject>() { | 78 | mRxManager.register(mIModel.getRegisterResult(adminName, idCode, password).subscribe(new Consumer<JsonObject>() { |
79 | @Override | 79 | @Override |
80 | public void accept(JsonObject jsonObject) throws Exception { | 80 | public void accept(JsonObject jsonObject) throws Exception { |
81 | //TODO 注册成功返回 | 81 | //TODO 注册成功返回 |
82 | - | ||
83 | - | 82 | + Log.e("1111", jsonObject.toString()); |
83 | + mIView.getUserInfo(); | ||
84 | } | 84 | } |
85 | }, new Consumer<Throwable>() { | 85 | }, new Consumer<Throwable>() { |
86 | @Override | 86 | @Override |
87 | public void accept(Throwable throwable) throws Exception { | 87 | public void accept(Throwable throwable) throws Exception { |
88 | ToastUtils.showToast(throwable.getMessage()); | 88 | ToastUtils.showToast(throwable.getMessage()); |
89 | + OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | ||
89 | } | 90 | } |
90 | })); | 91 | })); |
91 | 92 | ||
@@ -104,8 +105,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -104,8 +105,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
104 | @Override | 105 | @Override |
105 | public void accept(JsonObject jsonObject) throws Exception { | 106 | public void accept(JsonObject jsonObject) throws Exception { |
106 | //TODO 获取验证码返回 | 107 | //TODO 获取验证码返回 |
107 | - | ||
108 | - | 108 | + Log.e("111", jsonObject.toString()); |
109 | } | 109 | } |
110 | }, new Consumer<Throwable>() { | 110 | }, new Consumer<Throwable>() { |
111 | @Override | 111 | @Override |
@@ -119,7 +119,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -119,7 +119,7 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
119 | 119 | ||
120 | @Override | 120 | @Override |
121 | public void getUserInfo() { | 121 | public void getUserInfo() { |
122 | - Log.d("77777","getUserInfo="); | 122 | + Log.d("77777", "getUserInfo="); |
123 | } | 123 | } |
124 | 124 | ||
125 | 125 |
app/src/main/java/com/shunzhi/parent/presenter/mine/PersonInfoPrasenter.java
0 → 100644
@@ -0,0 +1,19 @@ | @@ -0,0 +1,19 @@ | ||
1 | +package com.shunzhi.parent.presenter.mine; | ||
2 | + | ||
3 | +import com.shunzhi.parent.contract.mine.PersonInfoContract; | ||
4 | + | ||
5 | +/** | ||
6 | + * Created by Administrator on 2018/3/10 0010. | ||
7 | + */ | ||
8 | + | ||
9 | +public class PersonInfoPrasenter extends PersonInfoContract.PersonInfoPresenter { | ||
10 | + @Override | ||
11 | + public PersonInfoContract.IPersonInfoModel getModel() { | ||
12 | + return null; | ||
13 | + } | ||
14 | + | ||
15 | + @Override | ||
16 | + public void onStart() { | ||
17 | + | ||
18 | + } | ||
19 | +} |
app/src/main/java/com/shunzhi/parent/ui/activity/MyChildActivity.java
1 | package com.shunzhi.parent.ui.activity; | 1 | package com.shunzhi.parent.ui.activity; |
2 | 2 | ||
3 | import android.annotation.SuppressLint; | 3 | import android.annotation.SuppressLint; |
4 | +import android.content.Intent; | ||
4 | import android.graphics.Color; | 5 | import android.graphics.Color; |
5 | import android.os.Bundle; | 6 | import android.os.Bundle; |
6 | import android.support.annotation.NonNull; | 7 | import android.support.annotation.NonNull; |
7 | import android.support.v7.widget.LinearLayoutManager; | 8 | import android.support.v7.widget.LinearLayoutManager; |
9 | +import android.view.Gravity; | ||
10 | +import android.view.LayoutInflater; | ||
8 | import android.view.View; | 11 | import android.view.View; |
9 | import android.view.ViewGroup; | 12 | import android.view.ViewGroup; |
13 | +import android.view.WindowManager; | ||
14 | +import android.widget.PopupWindow; | ||
10 | import android.widget.TextView; | 15 | import android.widget.TextView; |
11 | 16 | ||
12 | import com.share.mvpsdk.base.BasePresenter; | 17 | import com.share.mvpsdk.base.BasePresenter; |
@@ -16,6 +21,7 @@ import com.shunzhi.parent.adapter.ChildAdapter; | @@ -16,6 +21,7 @@ import com.shunzhi.parent.adapter.ChildAdapter; | ||
16 | import com.shunzhi.parent.bean.ChildBean; | 21 | import com.shunzhi.parent.bean.ChildBean; |
17 | import com.shunzhi.parent.contract.mine.MyChildContract; | 22 | import com.shunzhi.parent.contract.mine.MyChildContract; |
18 | import com.shunzhi.parent.presenter.mine.MyChildPresenter; | 23 | import com.shunzhi.parent.presenter.mine.MyChildPresenter; |
24 | +import com.shunzhi.parent.ui.activity.binding.SelectSchoolActivity; | ||
19 | import com.yanzhenjie.recyclerview.swipe.SwipeMenu; | 25 | import com.yanzhenjie.recyclerview.swipe.SwipeMenu; |
20 | import com.yanzhenjie.recyclerview.swipe.SwipeMenuBridge; | 26 | import com.yanzhenjie.recyclerview.swipe.SwipeMenuBridge; |
21 | import com.yanzhenjie.recyclerview.swipe.SwipeMenuCreator; | 27 | import com.yanzhenjie.recyclerview.swipe.SwipeMenuCreator; |
@@ -32,7 +38,7 @@ import java.util.List; | @@ -32,7 +38,7 @@ import java.util.List; | ||
32 | public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChildPresenter, MyChildContract.IMyChildModel> | 38 | public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChildPresenter, MyChildContract.IMyChildModel> |
33 | implements MyChildContract.IMyChildView, View.OnClickListener { | 39 | implements MyChildContract.IMyChildView, View.OnClickListener { |
34 | SwipeMenuRecyclerView child_recycle; | 40 | SwipeMenuRecyclerView child_recycle; |
35 | - TextView back; | 41 | + TextView back, center_title, add_child; |
36 | ChildAdapter childAdapter; | 42 | ChildAdapter childAdapter; |
37 | 43 | ||
38 | @NonNull | 44 | @NonNull |
@@ -44,8 +50,12 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | @@ -44,8 +50,12 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | ||
44 | @SuppressLint("WrongViewCast") | 50 | @SuppressLint("WrongViewCast") |
45 | @Override | 51 | @Override |
46 | protected void initView(Bundle savedInstanceState) { | 52 | protected void initView(Bundle savedInstanceState) { |
53 | + add_child = findViewById(R.id.add_child); | ||
47 | child_recycle = findViewById(R.id.child_recycle); | 54 | child_recycle = findViewById(R.id.child_recycle); |
48 | back = findViewById(R.id.back_top); | 55 | back = findViewById(R.id.back_top); |
56 | + center_title = findViewById(R.id.center_title); | ||
57 | + center_title.setText("我的孩子"); | ||
58 | + add_child.setOnClickListener(this); | ||
49 | back.setOnClickListener(this); | 59 | back.setOnClickListener(this); |
50 | initRecyclerView(); | 60 | initRecyclerView(); |
51 | 61 | ||
@@ -58,11 +68,33 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | @@ -58,11 +68,33 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | ||
58 | child_recycle.setSwipeMenuItemClickListener(new SwipeMenuItemClickListener() { | 68 | child_recycle.setSwipeMenuItemClickListener(new SwipeMenuItemClickListener() { |
59 | @Override | 69 | @Override |
60 | public void onItemClick(SwipeMenuBridge menuBridge) { | 70 | public void onItemClick(SwipeMenuBridge menuBridge) { |
61 | - int adapterPosition = menuBridge.getAdapterPosition(); | ||
62 | - childAdapter.remove(adapterPosition); | 71 | + final PopupWindow popupWindow = new PopupWindow(); |
72 | + popupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT); | ||
73 | + popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); | ||
74 | + backgroundAlpha(0.5f); | ||
75 | + View view = LayoutInflater.from(MyChildActivity.this).inflate(R.layout.dialog_view, null); | ||
76 | + TextView tv = view.findViewById(R.id.dialog_info); | ||
77 | + tv.setText("是否解除绑定?"); | ||
78 | + TextView btn_cancel = view.findViewById(R.id.cancel_btn); | ||
79 | + btn_cancel.setOnClickListener(new View.OnClickListener() { | ||
80 | + @Override | ||
81 | + public void onClick(View v) { | ||
82 | + popupWindow.dismiss(); | ||
83 | + backgroundAlpha(1f); | ||
84 | + } | ||
85 | + }); | ||
86 | + TextView btn_right = view.findViewById(R.id.right_btn); | ||
87 | + btn_right.setOnClickListener(new View.OnClickListener() { | ||
88 | + @Override | ||
89 | + public void onClick(View v) { | ||
90 | + | ||
91 | + } | ||
92 | + }); | ||
93 | + popupWindow.setContentView(view); | ||
94 | + popupWindow.showAtLocation(child_recycle, Gravity.CENTER, 0, 0); | ||
95 | + | ||
63 | } | 96 | } |
64 | }); | 97 | }); |
65 | - | ||
66 | mPresenter.loadChildList(); | 98 | mPresenter.loadChildList(); |
67 | } | 99 | } |
68 | 100 | ||
@@ -73,7 +105,11 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | @@ -73,7 +105,11 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | ||
73 | 105 | ||
74 | @Override | 106 | @Override |
75 | public void onClick(View v) { | 107 | public void onClick(View v) { |
76 | - finish(); | 108 | + if (v == back) { |
109 | + finish(); | ||
110 | + } else if (v == add_child) { | ||
111 | + startActivity(new Intent().setClass(MyChildActivity.this, SelectSchoolActivity.class)); | ||
112 | + } | ||
77 | } | 113 | } |
78 | 114 | ||
79 | @Override | 115 | @Override |
@@ -102,4 +138,13 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | @@ -102,4 +138,13 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | ||
102 | }; | 138 | }; |
103 | 139 | ||
104 | 140 | ||
141 | + | ||
142 | + public void backgroundAlpha(float bgAlpha) | ||
143 | + { | ||
144 | + WindowManager.LayoutParams lp = getWindow().getAttributes(); | ||
145 | + lp.alpha = bgAlpha; //0.0-1.0 | ||
146 | + getWindow().setAttributes(lp); | ||
147 | + } | ||
148 | + | ||
149 | + | ||
105 | } | 150 | } |
app/src/main/java/com/shunzhi/parent/ui/activity/PersonInfoActivity.java
0 → 100644
@@ -0,0 +1,40 @@ | @@ -0,0 +1,40 @@ | ||
1 | +package com.shunzhi.parent.ui.activity; | ||
2 | + | ||
3 | + | ||
4 | +import android.os.Bundle; | ||
5 | +import android.support.annotation.NonNull; | ||
6 | +import android.view.View; | ||
7 | + | ||
8 | +import com.share.mvpsdk.base.BasePresenter; | ||
9 | +import com.share.mvpsdk.base.activity.BaseMVPCompatActivity; | ||
10 | +import com.shunzhi.parent.R; | ||
11 | +import com.shunzhi.parent.contract.mine.PersonInfoContract; | ||
12 | +import com.shunzhi.parent.presenter.mine.PersonInfoPrasenter; | ||
13 | + | ||
14 | +/** | ||
15 | + * Created by Administrator on 2018/3/10 0010. | ||
16 | + */ | ||
17 | + | ||
18 | +public class PersonInfoActivity extends BaseMVPCompatActivity<PersonInfoContract.PersonInfoPresenter,PersonInfoContract.IPersonInfoModel> | ||
19 | +implements PersonInfoContract.IPersonInfoView,View.OnClickListener{ | ||
20 | + @NonNull | ||
21 | + @Override | ||
22 | + public BasePresenter initPresenter() { | ||
23 | + return new PersonInfoPrasenter(); | ||
24 | + } | ||
25 | + | ||
26 | + @Override | ||
27 | + protected void initView(Bundle savedInstanceState) { | ||
28 | + | ||
29 | + } | ||
30 | + | ||
31 | + @Override | ||
32 | + protected int getLayoutId() { | ||
33 | + return R.layout.activity_personinfo; | ||
34 | + } | ||
35 | + | ||
36 | + @Override | ||
37 | + public void onClick(View v) { | ||
38 | + | ||
39 | + } | ||
40 | +} |
app/src/main/java/com/shunzhi/parent/ui/activity/binding/CheckInfoActivity.java
0 → 100644
@@ -0,0 +1,30 @@ | @@ -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/12 0012. | ||
12 | + */ | ||
13 | + | ||
14 | +public class CheckInfoActivity 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_check_info; | ||
29 | + } | ||
30 | +} |
app/src/main/java/com/shunzhi/parent/ui/activity/binding/SelectSchoolActivity.java
0 → 100644
@@ -0,0 +1,196 @@ | @@ -0,0 +1,196 @@ | ||
1 | +package com.shunzhi.parent.ui.activity.binding; | ||
2 | + | ||
3 | +import android.content.Intent; | ||
4 | +import android.os.Bundle; | ||
5 | +import android.support.annotation.NonNull; | ||
6 | +import android.support.v7.widget.LinearLayoutManager; | ||
7 | +import android.support.v7.widget.RecyclerView; | ||
8 | +import android.view.View; | ||
9 | +import android.widget.TextView; | ||
10 | + | ||
11 | +import com.share.mvpsdk.base.BasePresenter; | ||
12 | +import com.share.mvpsdk.base.activity.BaseMVPCompatActivity; | ||
13 | +import com.shunzhi.parent.R; | ||
14 | +import com.shunzhi.parent.adapter.SchoolListAdapter; | ||
15 | +import com.shunzhi.parent.bean.SchoolBean; | ||
16 | +import com.shunzhi.parent.util.CharacterParser; | ||
17 | +import com.shunzhi.parent.views.SideBar; | ||
18 | + | ||
19 | +import java.util.ArrayList; | ||
20 | +import java.util.Collections; | ||
21 | +import java.util.Comparator; | ||
22 | +import java.util.List; | ||
23 | + | ||
24 | +/** | ||
25 | + * Created by Administrator on 2018/3/12 0012. | ||
26 | + */ | ||
27 | + | ||
28 | +public class SelectSchoolActivity extends BaseMVPCompatActivity implements View.OnClickListener{ | ||
29 | + | ||
30 | + private SideBar sideBar; | ||
31 | + private TextView dialog,go_next; | ||
32 | + private RecyclerView schoollist; | ||
33 | + private List<String> list = new ArrayList<>(); | ||
34 | + SchoolListAdapter schoolListAdapter; | ||
35 | + | ||
36 | + @NonNull | ||
37 | + @Override | ||
38 | + public BasePresenter initPresenter() { | ||
39 | + return null; | ||
40 | + } | ||
41 | + | ||
42 | + @Override | ||
43 | + protected void initView(Bundle savedInstanceState) { | ||
44 | + sideBar = findViewById(R.id.sidrbar); | ||
45 | + dialog = findViewById(R.id.dialog); | ||
46 | + go_next=findViewById(R.id.go_next); | ||
47 | + go_next.setOnClickListener(this); | ||
48 | + | ||
49 | + | ||
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 | + schoollist = findViewById(R.id.schoollist); | ||
106 | + 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); | ||
111 | + sideBar.setOnTouchingLetterChangedListener(new SideBar.OnTouchingLetterChangedListener() { | ||
112 | + @Override | ||
113 | + public void onTouchingLetterChanged(String s) { | ||
114 | + //该字母首次出现的位置 | ||
115 | + int position = -1; | ||
116 | + if (schoolListAdapter != null && schoolListAdapter.getCount() > 0) { | ||
117 | + | ||
118 | + position = schoolListAdapter.getPositionForSection(s.charAt(0)); | ||
119 | + } | ||
120 | + if (position != -1 && position != 0) { | ||
121 | + schoollist.smoothScrollToPosition(position); | ||
122 | + } | ||
123 | + } | ||
124 | + }); | ||
125 | + | ||
126 | + } | ||
127 | + | ||
128 | + @Override | ||
129 | + protected int getLayoutId() { | ||
130 | + return R.layout.activity_select_school; | ||
131 | + } | ||
132 | + | ||
133 | + | ||
134 | + List<SchoolBean> OrderedSortSmodel(List<String> list) { | ||
135 | + List<SchoolBean> schoolList = new ArrayList<>(); | ||
136 | + CharacterParser characterParser = CharacterParser.getInstance(); | ||
137 | + for (String c : list) { | ||
138 | + SchoolBean s = new SchoolBean(); | ||
139 | + s.setSchoolname(c); | ||
140 | + | ||
141 | + //汉字转换成拼音 | ||
142 | + String pinyin = characterParser.getSelling(s.getSchoolname()); | ||
143 | + String sortString = ""; | ||
144 | + try { | ||
145 | + sortString = pinyin.substring(0, 1).toUpperCase(); | ||
146 | + } catch (Exception err) { | ||
147 | + continue; | ||
148 | + } | ||
149 | + // 正则表达式,判断首字母是否是英文字母 | ||
150 | + if (sortString.matches("[A-Z]") ) { | ||
151 | + s.setSortLetters(sortString.toUpperCase()); | ||
152 | + } else { | ||
153 | + s.setSortLetters("#"); | ||
154 | + } | ||
155 | + schoolList.add(s); | ||
156 | + } | ||
157 | + | ||
158 | + return orderByNameIndexAndIndentity(schoolList); | ||
159 | + } | ||
160 | + | ||
161 | + | ||
162 | + public static List<SchoolBean> orderByNameIndexAndIndentity(List<SchoolBean> sortModels) { | ||
163 | + Collections.sort(sortModels, new Comparator<SchoolBean>() { | ||
164 | + @Override | ||
165 | + public int compare(SchoolBean o1, SchoolBean o2) { | ||
166 | + if (o1.getSortLetters().equals("#") && o2.getSortLetters().matches("[A-Z]")) { | ||
167 | + return -1; | ||
168 | + } else if (o1.getSortLetters().equals("#") && !o2.getSortLetters().matches("[A-Z]")) { | ||
169 | + | ||
170 | + return 0; | ||
171 | + } else if (!o1.getSortLetters().equals("#") && o2.getSortLetters().matches("[A-Z]")) { | ||
172 | + return o1.getSortLetters().compareTo(o2.getSortLetters()); | ||
173 | + } else if (!o1.getSortLetters().equals("#") && !o2.getSortLetters().matches("[A-Z]")) { | ||
174 | + return 1; | ||
175 | + } | ||
176 | + return o1.getSortLetters().compareTo(o2.getSortLetters()); | ||
177 | + } | ||
178 | + | ||
179 | + @Override | ||
180 | + public boolean equals(Object o) { | ||
181 | + return super.equals(o); | ||
182 | + } | ||
183 | + }); | ||
184 | + return sortModels; | ||
185 | + | ||
186 | + } | ||
187 | + | ||
188 | + @Override | ||
189 | + public void onClick(View v) { | ||
190 | + if(v==go_next){ | ||
191 | + startActivity(new Intent().setClass(SelectSchoolActivity.this,CheckInfoActivity.class)); | ||
192 | + | ||
193 | + } | ||
194 | + | ||
195 | + } | ||
196 | +} |
app/src/main/java/com/shunzhi/parent/ui/fragment/MineFragment.java
@@ -14,10 +14,11 @@ import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract; | @@ -14,10 +14,11 @@ import com.shunzhi.parent.contract.loginandregister.LoginAndRegisterContract; | ||
14 | import com.shunzhi.parent.contract.mine.MineContract; | 14 | import com.shunzhi.parent.contract.mine.MineContract; |
15 | import com.shunzhi.parent.presenter.mine.MinePresenter; | 15 | import com.shunzhi.parent.presenter.mine.MinePresenter; |
16 | import com.shunzhi.parent.ui.activity.MyChildActivity; | 16 | import com.shunzhi.parent.ui.activity.MyChildActivity; |
17 | +import com.shunzhi.parent.ui.activity.PersonInfoActivity; | ||
17 | 18 | ||
18 | public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel> | 19 | public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract.LoginPresenter, LoginAndRegisterContract.ILoginModel> |
19 | implements MineContract.IMineView, View.OnClickListener { | 20 | implements MineContract.IMineView, View.OnClickListener { |
20 | - LinearLayout childlayout; | 21 | + LinearLayout childlayout,personinfo; |
21 | 22 | ||
22 | @NonNull | 23 | @NonNull |
23 | @Override | 24 | @Override |
@@ -33,7 +34,9 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -33,7 +34,9 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
33 | @Override | 34 | @Override |
34 | public void initUI(View view, @Nullable Bundle savedInstanceState) { | 35 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
35 | childlayout = view.findViewById(R.id.childlayout); | 36 | childlayout = view.findViewById(R.id.childlayout); |
37 | + personinfo = view.findViewById(R.id.personinfo); | ||
36 | childlayout.setOnClickListener(this); | 38 | childlayout.setOnClickListener(this); |
39 | + personinfo.setOnClickListener(this); | ||
37 | 40 | ||
38 | } | 41 | } |
39 | 42 | ||
@@ -44,6 +47,9 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | @@ -44,6 +47,9 @@ public class MineFragment extends BaseMVPCompatFragment<LoginAndRegisterContract | ||
44 | case R.id.childlayout: | 47 | case R.id.childlayout: |
45 | startActivity(new Intent().setClass(getActivity(), MyChildActivity.class)); | 48 | startActivity(new Intent().setClass(getActivity(), MyChildActivity.class)); |
46 | break; | 49 | break; |
50 | + case R.id.personinfo: | ||
51 | + startActivity(new Intent().setClass(getActivity(), PersonInfoActivity.class)); | ||
52 | + break; | ||
47 | default: | 53 | default: |
48 | break; | 54 | break; |
49 | } | 55 | } |
app/src/main/java/com/shunzhi/parent/ui/fragment/ReportFragment.java
@@ -24,7 +24,7 @@ public class ReportFragment extends BaseMVPCompatFragment { | @@ -24,7 +24,7 @@ public class ReportFragment extends BaseMVPCompatFragment { | ||
24 | 24 | ||
25 | @Override | 25 | @Override |
26 | public void initUI(View view, @Nullable Bundle savedInstanceState) { | 26 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
27 | - | 27 | + |
28 | } | 28 | } |
29 | 29 | ||
30 | 30 |
app/src/main/java/com/shunzhi/parent/ui/fragment/loginandregistfragment/LoginAndRegistFragment.java
@@ -7,8 +7,8 @@ import android.support.annotation.Nullable; | @@ -7,8 +7,8 @@ import android.support.annotation.Nullable; | ||
7 | import android.text.Editable; | 7 | import android.text.Editable; |
8 | import android.text.TextUtils; | 8 | import android.text.TextUtils; |
9 | import android.text.TextWatcher; | 9 | import android.text.TextWatcher; |
10 | -import android.util.Log; | ||
11 | import android.view.Gravity; | 10 | import android.view.Gravity; |
11 | +import android.view.LayoutInflater; | ||
12 | import android.view.View; | 12 | import android.view.View; |
13 | import android.view.ViewGroup; | 13 | import android.view.ViewGroup; |
14 | import android.widget.EditText; | 14 | import android.widget.EditText; |
@@ -95,13 +95,11 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | @@ -95,13 +95,11 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | ||
95 | 95 | ||
96 | @Override | 96 | @Override |
97 | public void getUserInfo() { | 97 | public void getUserInfo() { |
98 | - Log.e("sss","sss"); | ||
99 | PopupWindow popupWindow=new PopupWindow(); | 98 | PopupWindow popupWindow=new PopupWindow(); |
100 | popupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT); | 99 | popupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT); |
101 | popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); | 100 | popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); |
102 | - TextView textView=new TextView(getActivity()); | ||
103 | - textView.setText("注册成功"); | ||
104 | - popupWindow.setContentView(textView); | 101 | + View view= LayoutInflater.from(getActivity()).inflate(R.layout.dialog_view,null); |
102 | + popupWindow.setContentView(view); | ||
105 | popupWindow.showAtLocation(main_login, Gravity.CENTER,0,0); | 103 | popupWindow.showAtLocation(main_login, Gravity.CENTER,0,0); |
106 | 104 | ||
107 | 105 |
app/src/main/java/com/shunzhi/parent/util/CharacterParser.java
0 → 100644
@@ -0,0 +1,138 @@ | @@ -0,0 +1,138 @@ | ||
1 | +package com.shunzhi.parent.util; | ||
2 | + | ||
3 | +/** | ||
4 | + * Created by xf on 2015/9/22. | ||
5 | + */ | ||
6 | +/** | ||
7 | + * Java汉字转换为拼音 | ||
8 | + * | ||
9 | + */ | ||
10 | +public class CharacterParser { | ||
11 | + private static int[] pyvalue = new int[] {-20319, -20317, -20304, -20295, -20292, -20283, -20265, -20257, -20242, -20230, -20051, -20036, -20032, | ||
12 | + -20026, -20002, -19990, -19986, -19982, -19976, -19805, -19784, -19775, -19774, -19763, -19756, -19751, -19746, -19741, -19739, -19728, | ||
13 | + -19725, -19715, -19540, -19531, -19525, -19515, -19500, -19484, -19479, -19467, -19289, -19288, -19281, -19275, -19270, -19263, -19261, | ||
14 | + -19249, -19243, -19242, -19238, -19235, -19227, -19224, -19218, -19212, -19038, -19023, -19018, -19006, -19003, -18996, -18977, -18961, | ||
15 | + -18952, -18783, -18774, -18773, -18763, -18756, -18741, -18735, -18731, -18722, -18710, -18697, -18696, -18526, -18518, -18501, -18490, | ||
16 | + -18478, -18463, -18448, -18447, -18446, -18239, -18237, -18231, -18220, -18211, -18201, -18184, -18183, -18181, -18012, -17997, -17988, | ||
17 | + -17970, -17964, -17961, -17950, -17947, -17931, -17928, -17922, -17759, -17752, -17733, -17730, -17721, -17703, -17701, -17697, -17692, | ||
18 | + -17683, -17676, -17496, -17487, -17482, -17468, -17454, -17433, -17427, -17417, -17202, -17185, -16983, -16970, -16942, -16915, -16733, | ||
19 | + -16708, -16706, -16689, -16664, -16657, -16647, -16474, -16470, -16465, -16459, -16452, -16448, -16433, -16429, -16427, -16423, -16419, | ||
20 | + -16412, -16407, -16403, -16401, -16393, -16220, -16216, -16212, -16205, -16202, -16187, -16180, -16171, -16169, -16158, -16155, -15959, | ||
21 | + -15958, -15944, -15933, -15920, -15915, -15903, -15889, -15878, -15707, -15701, -15681, -15667, -15661, -15659, -15652, -15640, -15631, | ||
22 | + -15625, -15454, -15448, -15436, -15435, -15419, -15416, -15408, -15394, -15385, -15377, -15375, -15369, -15363, -15362, -15183, -15180, | ||
23 | + -15165, -15158, -15153, -15150, -15149, -15144, -15143, -15141, -15140, -15139, -15128, -15121, -15119, -15117, -15110, -15109, -14941, | ||
24 | + -14937, -14933, -14930, -14929, -14928, -14926, -14922, -14921, -14914, -14908, -14902, -14894, -14889, -14882, -14873, -14871, -14857, | ||
25 | + -14678, -14674, -14670, -14668, -14663, -14654, -14645, -14630, -14594, -14429, -14407, -14399, -14384, -14379, -14368, -14355, -14353, | ||
26 | + -14345, -14170, -14159, -14151, -14149, -14145, -14140, -14137, -14135, -14125, -14123, -14122, -14112, -14109, -14099, -14097, -14094, | ||
27 | + -14092, -14090, -14087, -14083, -13917, -13914, -13910, -13907, -13906, -13905, -13896, -13894, -13878, -13870, -13859, -13847, -13831, | ||
28 | + -13658, -13611, -13601, -13406, -13404, -13400, -13398, -13395, -13391, -13387, -13383, -13367, -13359, -13356, -13343, -13340, -13329, | ||
29 | + -13326, -13318, -13147, -13138, -13120, -13107, -13096, -13095, -13091, -13076, -13068, -13063, -13060, -12888, -12875, -12871, -12860, | ||
30 | + -12858, -12852, -12849, -12838, -12831, -12829, -12812, -12802, -12607, -12597, -12594, -12585, -12556, -12359, -12346, -12320, -12300, | ||
31 | + -12120, -12099, -12089, -12074, -12067, -12058, -12039, -11867, -11861, -11847, -11831, -11798, -11781, -11604, -11589, -11536, -11358, | ||
32 | + -11340, -11339, -11324, -11303, -11097, -11077, -11067, -11055, -11052, -11045, -11041, -11038, -11024, -11020, -11019, -11018, -11014, | ||
33 | + -10838, -10832, -10815, -10800, -10790, -10780, -10764, -10587, -10544, -10533, -10519, -10331, -10329, -10328, -10322, -10315, -10309, | ||
34 | + -10307, -10296, -10281, -10274, -10270, -10262, -10260, -10256, -10254}; | ||
35 | + public static String[] pystr = new String[] {"a", "ai", "an", "ang", "ao", "ba", "bai", "ban", "bang", "bao", "bei", "ben", "beng", "bi", "bian", | ||
36 | + "biao", "bie", "bin", "bing", "bo", "bu", "ca", "cai", "can", "cang", "cao", "ce", "ceng", "cha", "chai", "chan", "chang", "chao", "che", | ||
37 | + "chen", "cheng", "chi", "chong", "chou", "chu", "chuai", "chuan", "chuang", "chui", "chun", "chuo", "ci", "cong", "cou", "cu", "cuan", | ||
38 | + "cui", "cun", "cuo", "da", "dai", "dan", "dang", "dao", "de", "deng", "di", "dian", "diao", "die", "ding", "diu", "dong", "dou", "du", | ||
39 | + "duan", "dui", "dun", "duo", "e", "en", "er", "fa", "fan", "fang", "fei", "fen", "feng", "fo", "fou", "fu", "ga", "gai", "gan", "gang", | ||
40 | + "gao", "ge", "gei", "gen", "geng", "gong", "gou", "gu", "gua", "guai", "guan", "guang", "gui", "gun", "guo", "ha", "hai", "han", "hang", | ||
41 | + "hao", "he", "hei", "hen", "heng", "hong", "hou", "hu", "hua", "huai", "huan", "huang", "hui", "hun", "huo", "ji", "jia", "jian", | ||
42 | + "jiang", "jiao", "jie", "jin", "jing", "jiong", "jiu", "ju", "juan", "jue", "jun", "ka", "kai", "kan", "kang", "kao", "ke", "ken", | ||
43 | + "keng", "kong", "kou", "ku", "kua", "kuai", "kuan", "kuang", "kui", "kun", "kuo", "la", "lai", "lan", "lang", "lao", "le", "lei", "leng", | ||
44 | + "li", "lia", "lian", "liang", "liao", "lie", "lin", "ling", "liu", "long", "lou", "lu", "lv", "luan", "lue", "lun", "luo", "ma", "mai", | ||
45 | + "man", "mang", "mao", "me", "mei", "men", "meng", "mi", "mian", "miao", "mie", "min", "ming", "miu", "mo", "mou", "mu", "na", "nai", | ||
46 | + "nan", "nang", "nao", "ne", "nei", "nen", "neng", "ni", "nian", "niang", "niao", "nie", "nin", "ning", "niu", "nong", "nu", "nv", "nuan", | ||
47 | + "nue", "nuo", "o", "ou", "pa", "pai", "pan", "pang", "pao", "pei", "pen", "peng", "pi", "pian", "piao", "pie", "pin", "ping", "po", "pu", | ||
48 | + "qi", "qia", "qian", "qiang", "qiao", "qie", "qin", "qing", "qiong", "qiu", "qu", "quan", "que", "qun", "ran", "rang", "rao", "re", | ||
49 | + "ren", "reng", "ri", "rong", "rou", "ru", "ruan", "rui", "run", "ruo", "sa", "sai", "san", "sang", "sao", "se", "sen", "seng", "sha", | ||
50 | + "shai", "shan", "shang", "shao", "she", "shen", "sheng", "shi", "shou", "shu", "shua", "shuai", "shuan", "shuang", "shui", "shun", | ||
51 | + "shuo", "si", "song", "sou", "su", "suan", "sui", "sun", "suo", "ta", "tai", "tan", "tang", "tao", "te", "teng", "ti", "tian", "tiao", | ||
52 | + "tie", "ting", "tong", "tou", "tu", "tuan", "tui", "tun", "tuo", "wa", "wai", "wan", "wang", "wei", "wen", "weng", "wo", "wu", "xi", | ||
53 | + "xia", "xian", "xiang", "xiao", "xie", "xin", "xing", "xiong", "xiu", "xu", "xuan", "xue", "xun", "ya", "yan", "yang", "yao", "ye", "yi", | ||
54 | + "yin", "ying", "yo", "yong", "you", "yu", "yuan", "yue", "yun", "za", "zai", "zan", "zang", "zao", "ze", "zei", "zen", "zeng", "zha", | ||
55 | + "zhai", "zhan", "zhang", "zhao", "zhe", "zhen", "zheng", "zhi", "zhong", "zhou", "zhu", "zhua", "zhuai", "zhuan", "zhuang", "zhui", | ||
56 | + "zhun", "zhuo", "zi", "zong", "zou", "zu", "zuan", "zui", "zun", "zuo"}; | ||
57 | + private StringBuilder buffer; | ||
58 | + private String resource; | ||
59 | + | ||
60 | + | ||
61 | + private static class InstanceHolder{ | ||
62 | + private static final CharacterParser characterParser = new CharacterParser(); | ||
63 | + } | ||
64 | + public static CharacterParser getInstance() { | ||
65 | + return InstanceHolder.characterParser; | ||
66 | + } | ||
67 | + | ||
68 | + public String getResource() { | ||
69 | + return resource; | ||
70 | + } | ||
71 | + | ||
72 | + public void setResource(String resource) { | ||
73 | + this.resource = resource; | ||
74 | + } | ||
75 | + | ||
76 | + /** * 汉字转成ASCII码 * * @param chs * @return */ | ||
77 | + private int getChsAscii(String chs) { | ||
78 | + int asc = 0; | ||
79 | + try { | ||
80 | + byte[] bytes = chs.getBytes("gb2312"); | ||
81 | + if (bytes == null || bytes.length > 2 || bytes.length <= 0) { | ||
82 | + throw new RuntimeException("illegal resource string"); | ||
83 | + } | ||
84 | + if (bytes.length == 1) { | ||
85 | + asc = bytes[0]; | ||
86 | + } | ||
87 | + if (bytes.length == 2) { | ||
88 | + int hightByte = 256 + bytes[0]; | ||
89 | + int lowByte = 256 + bytes[1]; | ||
90 | + asc = (256 * hightByte + lowByte) - 256 * 256; | ||
91 | + } | ||
92 | + } catch (Exception e) { | ||
93 | + System.out.println("ERROR:ChineseSpelling.class-getChsAscii(String chs)" + e); | ||
94 | + } | ||
95 | + return asc; | ||
96 | + } | ||
97 | + | ||
98 | + /** * 单字解析 * * @param str * @return */ | ||
99 | + public String convert(String str) { | ||
100 | + String result = null; | ||
101 | + int ascii = getChsAscii(str); | ||
102 | + if (ascii > 0 && ascii < 160) { | ||
103 | + result = String.valueOf((char) ascii); | ||
104 | + } else { | ||
105 | + for (int i = (pyvalue.length - 1); i >= 0; i--) { | ||
106 | + if (pyvalue[i] <= ascii) { | ||
107 | + result = pystr[i]; | ||
108 | + break; | ||
109 | + } | ||
110 | + } | ||
111 | + } | ||
112 | + return result; | ||
113 | + } | ||
114 | + | ||
115 | + /** * 词组解析 * * @param chs * @return */ | ||
116 | + public String getSelling(String chs) { | ||
117 | + String key, value; | ||
118 | + buffer = new StringBuilder(); | ||
119 | + for (int i = 0; i < chs.length(); i++) { | ||
120 | + key = chs.substring(i, i + 1); | ||
121 | + if (key.getBytes().length >= 2) { | ||
122 | + value = (String) convert(key); | ||
123 | + if (value == null) { | ||
124 | + value = "unknown"; | ||
125 | + } | ||
126 | + } else { | ||
127 | + value = key; | ||
128 | + } | ||
129 | + buffer.append(value); | ||
130 | + } | ||
131 | + return buffer.toString(); | ||
132 | + } | ||
133 | + | ||
134 | + public String getSpelling() { | ||
135 | + return this.getSelling(this.getResource()); | ||
136 | + } | ||
137 | + | ||
138 | +} |
app/src/main/java/com/shunzhi/parent/views/ProgressView.java
0 → 100644
@@ -0,0 +1,181 @@ | @@ -0,0 +1,181 @@ | ||
1 | +package com.shunzhi.parent.views; | ||
2 | + | ||
3 | +import android.content.Context; | ||
4 | +import android.graphics.Canvas; | ||
5 | +import android.graphics.Color; | ||
6 | +import android.graphics.Matrix; | ||
7 | +import android.graphics.Paint; | ||
8 | +import android.graphics.Paint.Cap; | ||
9 | +import android.graphics.Paint.Style; | ||
10 | +import android.graphics.PorterDuff; | ||
11 | +import android.graphics.PorterDuffXfermode; | ||
12 | +import android.graphics.RectF; | ||
13 | +import android.graphics.SweepGradient; | ||
14 | +import android.util.AttributeSet; | ||
15 | +import android.view.View; | ||
16 | + | ||
17 | +/*** | ||
18 | + * 自定义圆弧进度条 | ||
19 | + * | ||
20 | + * @author liujing | ||
21 | + */ | ||
22 | +public class ProgressView extends View { | ||
23 | + | ||
24 | + //分段颜色 | ||
25 | + private static final int[] SECTION_COLORS = {Color.RED, Color.YELLOW,Color.GREEN}; | ||
26 | + private static final String[] ALARM_LEVEL = {"", "", "", ""}; | ||
27 | + private float maxCount; | ||
28 | + private float currentCount; | ||
29 | + private int score; | ||
30 | + private String crrentLevel; | ||
31 | + private Paint mPaint; | ||
32 | + private Paint mTextPaint; | ||
33 | + private int mWidth, mHeight; | ||
34 | + | ||
35 | + public ProgressView(Context context, AttributeSet attrs, int defStyleAttr) { | ||
36 | + super(context, attrs, defStyleAttr); | ||
37 | + init(context); | ||
38 | + } | ||
39 | + | ||
40 | + public ProgressView(Context context, AttributeSet attrs) { | ||
41 | + this(context, attrs, 0); | ||
42 | + } | ||
43 | + | ||
44 | + public ProgressView(Context context) { | ||
45 | + this(context, null); | ||
46 | + } | ||
47 | + | ||
48 | + private void init(Context context) { | ||
49 | + mPaint = new Paint(); | ||
50 | + mTextPaint = new Paint(); | ||
51 | + } | ||
52 | + | ||
53 | + @Override | ||
54 | + protected void onDraw(Canvas canvas) { | ||
55 | + super.onDraw(canvas); | ||
56 | + initPaint(); | ||
57 | + RectF rectBlackBg = new RectF(20, 20, mWidth - 20, mHeight - 20); | ||
58 | + canvas.drawArc(rectBlackBg, 0, 275, false, mPaint); | ||
59 | + mPaint.setColor(getColor(score)); | ||
60 | + canvas.drawText(score + "%", mWidth / 2, mHeight / 2, mTextPaint); | ||
61 | + mTextPaint.setTextSize(40); | ||
62 | + | ||
63 | + SweepGradient sweepGradient = new SweepGradient(mWidth / 2, mWidth / 2, SECTION_COLORS, null); | ||
64 | + Matrix matrix = new Matrix(); | ||
65 | + matrix.setRotate(120, this.mWidth / 2, mWidth / 2); | ||
66 | + sweepGradient.setLocalMatrix(matrix); | ||
67 | + float section = currentCount / maxCount; | ||
68 | + mPaint.setShader(sweepGradient); | ||
69 | + | ||
70 | + mPaint.setShader(sweepGradient); | ||
71 | + mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_ATOP)); | ||
72 | + mPaint.setStyle(Style.STROKE); | ||
73 | + canvas.drawArc(rectBlackBg, 135, section * 275, false, mPaint); | ||
74 | + } | ||
75 | + | ||
76 | + | ||
77 | + private void initPaint() { | ||
78 | + mPaint.setAntiAlias(true); | ||
79 | + mPaint.setStrokeWidth((float) 40.0); | ||
80 | + mPaint.setStyle(Style.STROKE); | ||
81 | + mPaint.setStrokeCap(Cap.ROUND); | ||
82 | + mPaint.setColor(Color.TRANSPARENT); | ||
83 | + mTextPaint.setAntiAlias(true); | ||
84 | + mTextPaint.setStrokeWidth((float) 3.0); | ||
85 | + mTextPaint.setTextAlign(Paint.Align.CENTER); | ||
86 | + mTextPaint.setTextSize(50); | ||
87 | + mTextPaint.setColor(Color.BLACK); | ||
88 | + | ||
89 | + } | ||
90 | + | ||
91 | + private int dipToPx(int dip) { | ||
92 | + float scale = getContext().getResources().getDisplayMetrics().density; | ||
93 | + return (int) (dip * scale + 0.5f * (dip >= 0 ? 1 : -1)); | ||
94 | + } | ||
95 | + | ||
96 | + public int getScore() { | ||
97 | + return score; | ||
98 | + } | ||
99 | + | ||
100 | + public String getCrrentLevel() { | ||
101 | + return crrentLevel; | ||
102 | + } | ||
103 | + | ||
104 | + public void setCrrentLevel(String crrentLevel) { | ||
105 | + this.crrentLevel = crrentLevel; | ||
106 | + } | ||
107 | + | ||
108 | + public float getMaxCount() { | ||
109 | + return maxCount; | ||
110 | + } | ||
111 | + | ||
112 | + public float getCurrentCount() { | ||
113 | + return currentCount; | ||
114 | + } | ||
115 | + | ||
116 | + public void setScore(int score) { | ||
117 | + this.score = score; | ||
118 | + if (score == 100) { | ||
119 | + this.crrentLevel = ALARM_LEVEL[0]; | ||
120 | + } else if (score >= 70 && score < 100) { | ||
121 | + this.crrentLevel = ALARM_LEVEL[1]; | ||
122 | + } else if (score >= 30 && score < 70) { | ||
123 | + this.crrentLevel = ALARM_LEVEL[2]; | ||
124 | + } else { | ||
125 | + this.crrentLevel = ALARM_LEVEL[3]; | ||
126 | + } | ||
127 | + invalidate(); | ||
128 | + } | ||
129 | + public int getColor(int score) { | ||
130 | + this.score = score; | ||
131 | + if (score > 60 && score <= 100) { | ||
132 | + return SECTION_COLORS[2]; | ||
133 | + } else if (score >= 30 && score <= 60) { | ||
134 | + return SECTION_COLORS[1]; | ||
135 | + } else { | ||
136 | + return SECTION_COLORS[0]; | ||
137 | + } | ||
138 | + | ||
139 | + } | ||
140 | + | ||
141 | + /*** | ||
142 | + * 设置最大的进度值 | ||
143 | + * | ||
144 | + * @param maxCount | ||
145 | + */ | ||
146 | + public void setMaxCount(float maxCount) { | ||
147 | + this.maxCount = maxCount; | ||
148 | + } | ||
149 | + | ||
150 | + /*** | ||
151 | + * 设置当前的进度值 | ||
152 | + * | ||
153 | + * @param currentCount | ||
154 | + */ | ||
155 | + public void setCurrentCount(float currentCount) { | ||
156 | + this.currentCount = currentCount > maxCount ? maxCount : currentCount; | ||
157 | + invalidate(); | ||
158 | + } | ||
159 | + | ||
160 | + @Override | ||
161 | + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | ||
162 | + int widthSpecMode = MeasureSpec.getMode(widthMeasureSpec); | ||
163 | + int widthSpecSize = MeasureSpec.getSize(widthMeasureSpec); | ||
164 | + int heightSpecMode = MeasureSpec.getMode(heightMeasureSpec); | ||
165 | + int heightSpecSize = MeasureSpec.getSize(heightMeasureSpec); | ||
166 | + if (widthSpecMode == MeasureSpec.EXACTLY | ||
167 | + || widthSpecMode == MeasureSpec.AT_MOST) { | ||
168 | + mWidth = widthSpecSize; | ||
169 | + } else { | ||
170 | + mWidth = 0; | ||
171 | + } | ||
172 | + if (heightSpecMode == MeasureSpec.AT_MOST | ||
173 | + || heightSpecMode == MeasureSpec.UNSPECIFIED) { | ||
174 | + mHeight = dipToPx(15); | ||
175 | + } else { | ||
176 | + mHeight = heightSpecSize; | ||
177 | + } | ||
178 | + setMeasuredDimension(mWidth, mHeight); | ||
179 | + } | ||
180 | + | ||
181 | + } |
@@ -0,0 +1,140 @@ | @@ -0,0 +1,140 @@ | ||
1 | +package com.shunzhi.parent.views; | ||
2 | + | ||
3 | +import android.content.Context; | ||
4 | +import android.graphics.Canvas; | ||
5 | +import android.graphics.Color; | ||
6 | +import android.graphics.Paint; | ||
7 | +import android.graphics.Typeface; | ||
8 | +import android.graphics.drawable.ColorDrawable; | ||
9 | +import android.util.AttributeSet; | ||
10 | +import android.view.MotionEvent; | ||
11 | +import android.view.View; | ||
12 | +import android.widget.TextView; | ||
13 | + | ||
14 | +import com.shunzhi.parent.R; | ||
15 | + | ||
16 | + | ||
17 | +public class SideBar extends View { | ||
18 | + // 触摸事件 | ||
19 | + private OnTouchingLetterChangedListener onTouchingLetterChangedListener; | ||
20 | + // 26个字母 | ||
21 | + public static String[] b = { "*","A", "B", "C", "D", "E", "F", "G", "H", "I","J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V","W", "X", "Y", "Z", "#" }; | ||
22 | + private int choose = -1;// 选中 | ||
23 | + private Paint paint = new Paint(); | ||
24 | + | ||
25 | + private TextView mTextDialog; | ||
26 | + | ||
27 | + public void setTextView(TextView mTextDialog) { | ||
28 | + this.mTextDialog = mTextDialog; | ||
29 | + } | ||
30 | + | ||
31 | + | ||
32 | + public SideBar(Context context, AttributeSet attrs, int defStyle) { | ||
33 | + super(context, attrs, defStyle); | ||
34 | + } | ||
35 | + | ||
36 | + public SideBar(Context context, AttributeSet attrs) { | ||
37 | + super(context, attrs); | ||
38 | + } | ||
39 | + | ||
40 | + public SideBar(Context context) { | ||
41 | + super(context); | ||
42 | + } | ||
43 | + | ||
44 | + /** | ||
45 | + * 重写这个方法 | ||
46 | + */ | ||
47 | + protected void onDraw(Canvas canvas) { | ||
48 | + super.onDraw(canvas); | ||
49 | + // 获取焦点改变背景颜色. | ||
50 | + int height = getHeight();// 获取对应高度 | ||
51 | + int width = getWidth(); // 获取对应宽度 | ||
52 | + //int singleHeight = height / b.length;// 获取每一个字母的高度 | ||
53 | + int singleHeight = height / b.length;// 获取每一个字母的高度 | ||
54 | + | ||
55 | + for (int i = 0; i < b.length; i++) { | ||
56 | + if(!b[i].equals("")) { | ||
57 | + paint.setColor(Color.rgb(33, 65, 98)); | ||
58 | + // paint.setColor(Color.WHITE); | ||
59 | + paint.setTypeface(Typeface.DEFAULT_BOLD); | ||
60 | + paint.setAntiAlias(true); | ||
61 | + //paint.setAlpha(0);//透明 | ||
62 | + paint.setTextSize(26); | ||
63 | + // 选中的状态 | ||
64 | + if (i == choose) { | ||
65 | + paint.setColor(Color.parseColor("#3399ff")); | ||
66 | + paint.setFakeBoldText(true); | ||
67 | + } | ||
68 | + // x坐标等于中间-字符串宽度的一半. | ||
69 | + float xPos = width / 2 - paint.measureText(b[i]) / 2; | ||
70 | + float yPos = singleHeight * i + singleHeight; | ||
71 | + canvas.drawText(b[i], xPos, yPos, paint); | ||
72 | + paint.reset();// 重置画笔 | ||
73 | + } | ||
74 | + } | ||
75 | + | ||
76 | + } | ||
77 | + | ||
78 | + @Override | ||
79 | + public boolean dispatchTouchEvent(MotionEvent event) { | ||
80 | + final int action = event.getAction(); | ||
81 | + final float y = event.getY();// 点击y坐标 | ||
82 | + final int oldChoose = choose; | ||
83 | + final OnTouchingLetterChangedListener listener = onTouchingLetterChangedListener; | ||
84 | + final int c = (int) (y / getHeight() * b.length);// 点击y坐标所占总高度的比例*b数组的长度就等于点击b中的个数. | ||
85 | + switch (action) { | ||
86 | + case MotionEvent.ACTION_UP: | ||
87 | + gotoStart(); | ||
88 | + break; | ||
89 | + | ||
90 | + default: | ||
91 | + setBackgroundResource(R.drawable.sidebar_background); | ||
92 | + if (oldChoose != c) { | ||
93 | + if (c >= 0 && c < b.length) { | ||
94 | + if (listener != null) { | ||
95 | + listener.onTouchingLetterChanged(b[c]); | ||
96 | + } | ||
97 | + if (mTextDialog != null) { | ||
98 | + mTextDialog.setText(b[c]); | ||
99 | + mTextDialog.setVisibility(View.VISIBLE); | ||
100 | + } | ||
101 | + | ||
102 | + choose = c; | ||
103 | + invalidate(); | ||
104 | + } | ||
105 | + } | ||
106 | + | ||
107 | + break; | ||
108 | + } | ||
109 | + return true; | ||
110 | + } | ||
111 | + | ||
112 | + /** | ||
113 | + * 向外公开的方法 | ||
114 | + * | ||
115 | + * @param onTouchingLetterChangedListener | ||
116 | + */ | ||
117 | + public void setOnTouchingLetterChangedListener( | ||
118 | + OnTouchingLetterChangedListener onTouchingLetterChangedListener) { | ||
119 | + this.onTouchingLetterChangedListener = onTouchingLetterChangedListener; | ||
120 | + } | ||
121 | + | ||
122 | + /** | ||
123 | + * 接口 | ||
124 | + * | ||
125 | + * @author coder | ||
126 | + * | ||
127 | + */ | ||
128 | + public interface OnTouchingLetterChangedListener { | ||
129 | + public void onTouchingLetterChanged(String s); | ||
130 | + } | ||
131 | + | ||
132 | + public void gotoStart(){ | ||
133 | + setBackgroundDrawable(new ColorDrawable(0x77dddddd)); | ||
134 | + choose = -1; | ||
135 | + invalidate(); | ||
136 | + if (mTextDialog != null) { | ||
137 | + mTextDialog.setVisibility(View.INVISIBLE); | ||
138 | + } | ||
139 | + } | ||
140 | +} |
481 Bytes
531 Bytes
395 Bytes
1.46 KB
@@ -0,0 +1,6 @@ | @@ -0,0 +1,6 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <stroke android:color="#00000000" android:width="1dp"/> | ||
4 | + <solid android:color="@color/white" /> | ||
5 | + <corners android:radius="10dp"/> | ||
6 | +</shape> | ||
0 | \ No newline at end of file | 7 | \ No newline at end of file |
@@ -0,0 +1,6 @@ | @@ -0,0 +1,6 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <stroke android:color="#b8b8b9" android:width="1dp"/> | ||
4 | + <solid android:color="#00000000"/> | ||
5 | + <corners android:radius="5dp"/> | ||
6 | +</shape> | ||
0 | \ No newline at end of file | 7 | \ No newline at end of file |
@@ -0,0 +1,5 @@ | @@ -0,0 +1,5 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <stroke android:color="@color/bottomline" android:width="1dp"/> | ||
4 | + <corners android:radius="10dp"/> | ||
5 | +</shape> | ||
0 | \ No newline at end of file | 6 | \ No newline at end of file |
@@ -0,0 +1,6 @@ | @@ -0,0 +1,6 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <stroke android:color="#00000000" android:width="1dp"/> | ||
4 | + <solid android:color="#EEEEEE" /> | ||
5 | + <corners android:radius="15dp"/> | ||
6 | +</shape> | ||
0 | \ No newline at end of file | 7 | \ No newline at end of file |
@@ -0,0 +1,6 @@ | @@ -0,0 +1,6 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <stroke android:color="#00000000" android:width="1dp"/> | ||
4 | + <solid android:color="#AACFFC" /> | ||
5 | + <corners android:topLeftRadius="10dp" android:topRightRadius="10dp"/> | ||
6 | +</shape> | ||
0 | \ No newline at end of file | 7 | \ No newline at end of file |
@@ -0,0 +1,6 @@ | @@ -0,0 +1,6 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <stroke android:color="#00000000" android:width="1dp"/> | ||
4 | + <solid android:color="@color/white" /> | ||
5 | + <corners android:radius="20dp"/> | ||
6 | +</shape> | ||
0 | \ No newline at end of file | 7 | \ No newline at end of file |
@@ -0,0 +1,10 @@ | @@ -0,0 +1,10 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<shape android:shape="rectangle" | ||
3 | + xmlns:android="http://schemas.android.com/apk/res/android"> | ||
4 | + <gradient android:startColor="@color/gray" android:endColor="@color/white" android:angle="90.0" /> | ||
5 | + | ||
6 | + <corners | ||
7 | + android:topLeftRadius="8dip" | ||
8 | + android:bottomLeftRadius="8dip"/> | ||
9 | + | ||
10 | +</shape> |
@@ -0,0 +1,160 @@ | @@ -0,0 +1,160 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:tools="http://schemas.android.com/tools" | ||
4 | + android:layout_width="match_parent" | ||
5 | + android:layout_height="match_parent" | ||
6 | + android:orientation="vertical" | ||
7 | + android:background="@color/white" | ||
8 | + tools:context="com.shunzhi.parent.ui.activity.binding.CheckInfoActivity"> | ||
9 | + <include layout="@layout/top" /> | ||
10 | + | ||
11 | + <LinearLayout | ||
12 | + android:layout_width="match_parent" | ||
13 | + android:layout_height="match_parent" | ||
14 | + android:orientation="vertical"> | ||
15 | + | ||
16 | + <LinearLayout | ||
17 | + android:id="@+id/iphone_layout" | ||
18 | + android:layout_width="match_parent" | ||
19 | + android:layout_height="wrap_content" | ||
20 | + android:layout_marginTop="30dp" | ||
21 | + android:orientation="vertical"> | ||
22 | + | ||
23 | + <TextView | ||
24 | + android:layout_width="match_parent" | ||
25 | + android:layout_height="wrap_content" | ||
26 | + android:gravity="center" | ||
27 | + android:text="绑定手机号码为" | ||
28 | + android:textSize="@dimen/sp_18" /> | ||
29 | + | ||
30 | + <TextView | ||
31 | + android:layout_width="match_parent" | ||
32 | + android:layout_height="wrap_content" | ||
33 | + android:layout_marginTop="10dp" | ||
34 | + android:gravity="center_horizontal" | ||
35 | + android:text="15245252542" | ||
36 | + android:textColor="@color/textRed" | ||
37 | + android:textSize="@dimen/sp_18" /> | ||
38 | + </LinearLayout> | ||
39 | + | ||
40 | + <LinearLayout | ||
41 | + android:id="@+id/info_layout" | ||
42 | + android:layout_width="match_parent" | ||
43 | + android:layout_height="match_parent" | ||
44 | + android:layout_marginTop="20dp" | ||
45 | + android:orientation="vertical"> | ||
46 | + | ||
47 | + <LinearLayout | ||
48 | + android:layout_width="match_parent" | ||
49 | + android:layout_height="30dp" | ||
50 | + android:layout_marginLeft="60dp" | ||
51 | + android:layout_marginRight="60dp" | ||
52 | + android:layout_marginTop="10dp"> | ||
53 | + | ||
54 | + <TextView | ||
55 | + android:layout_width="wrap_content" | ||
56 | + android:layout_height="wrap_content" | ||
57 | + android:text="孩子姓名:" | ||
58 | + android:textSize="@dimen/sp_16" /> | ||
59 | + | ||
60 | + <EditText | ||
61 | + android:layout_width="wrap_content" | ||
62 | + android:layout_height="match_parent" | ||
63 | + android:layout_weight="1" | ||
64 | + android:background="@drawable/rudio_bord" | ||
65 | + android:gravity="center" | ||
66 | + android:text="李小明" | ||
67 | + android:textColor="@color/textColor" /> | ||
68 | + | ||
69 | + </LinearLayout> | ||
70 | + | ||
71 | + <LinearLayout | ||
72 | + android:layout_width="match_parent" | ||
73 | + android:layout_height="30dp" | ||
74 | + android:layout_marginLeft="60dp" | ||
75 | + android:layout_marginRight="60dp" | ||
76 | + android:layout_marginTop="10dp"> | ||
77 | + | ||
78 | + <TextView | ||
79 | + android:layout_width="wrap_content" | ||
80 | + android:layout_height="wrap_content" | ||
81 | + android:text="性 别:" | ||
82 | + android:textSize="@dimen/sp_16" /> | ||
83 | + | ||
84 | + <EditText | ||
85 | + android:layout_width="wrap_content" | ||
86 | + android:layout_height="match_parent" | ||
87 | + android:layout_weight="1" | ||
88 | + android:background="@drawable/rudio_bord" | ||
89 | + android:gravity="center" | ||
90 | + android:text="男" | ||
91 | + android:textColor="@color/textColor" /> | ||
92 | + | ||
93 | + </LinearLayout> | ||
94 | + | ||
95 | + <LinearLayout | ||
96 | + android:layout_width="match_parent" | ||
97 | + android:layout_height="30dp" | ||
98 | + android:layout_marginLeft="60dp" | ||
99 | + android:layout_marginRight="60dp" | ||
100 | + android:layout_marginTop="10dp"> | ||
101 | + | ||
102 | + <TextView | ||
103 | + android:layout_width="wrap_content" | ||
104 | + android:layout_height="wrap_content" | ||
105 | + android:text="年 级:" | ||
106 | + android:textSize="@dimen/sp_16" /> | ||
107 | + | ||
108 | + <EditText | ||
109 | + android:layout_width="wrap_content" | ||
110 | + android:layout_height="match_parent" | ||
111 | + android:layout_weight="1" | ||
112 | + android:background="@drawable/rudio_bord" | ||
113 | + android:gravity="center" | ||
114 | + android:text="初一" | ||
115 | + android:textColor="@color/textColor" /> | ||
116 | + | ||
117 | + </LinearLayout> | ||
118 | + | ||
119 | + <LinearLayout | ||
120 | + android:layout_width="match_parent" | ||
121 | + android:layout_height="30dp" | ||
122 | + android:layout_marginLeft="60dp" | ||
123 | + android:layout_marginRight="60dp" | ||
124 | + android:layout_marginTop="10dp"> | ||
125 | + | ||
126 | + <TextView | ||
127 | + android:layout_width="wrap_content" | ||
128 | + android:layout_height="wrap_content" | ||
129 | + android:text="班 级:" | ||
130 | + android:textSize="@dimen/sp_16" /> | ||
131 | + | ||
132 | + <EditText | ||
133 | + android:layout_width="wrap_content" | ||
134 | + android:layout_height="match_parent" | ||
135 | + android:layout_weight="1" | ||
136 | + android:background="@drawable/rudio_bord" | ||
137 | + android:gravity="center" | ||
138 | + android:text="初一(3)班" | ||
139 | + android:textColor="@color/textColor" /> | ||
140 | + | ||
141 | + </LinearLayout> | ||
142 | + | ||
143 | + <TextView | ||
144 | + android:id="@+id/add_child" | ||
145 | + android:layout_width="220dp" | ||
146 | + android:layout_height="40dp" | ||
147 | + android:layout_gravity="center_horizontal" | ||
148 | + android:layout_marginTop="20dp" | ||
149 | + android:background="@drawable/rudiobtn" | ||
150 | + android:gravity="center" | ||
151 | + android:text="确定" | ||
152 | + android:textColor="@color/white" | ||
153 | + android:textSize="@dimen/txtsize_title" /> | ||
154 | + </LinearLayout> | ||
155 | + | ||
156 | + | ||
157 | + </LinearLayout> | ||
158 | + | ||
159 | + | ||
160 | +</LinearLayout> |
@@ -0,0 +1,148 @@ | @@ -0,0 +1,148 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:tools="http://schemas.android.com/tools" | ||
4 | + android:layout_width="match_parent" | ||
5 | + android:layout_height="match_parent" | ||
6 | + android:orientation="vertical" | ||
7 | + android:background="@color/white" | ||
8 | + tools:context="com.shunzhi.parent.ui.activity.binding.CheckInfoActivity"> | ||
9 | + <include layout="@layout/top" /> | ||
10 | + | ||
11 | + <LinearLayout | ||
12 | + android:layout_width="match_parent" | ||
13 | + android:layout_height="match_parent" | ||
14 | + android:orientation="vertical"> | ||
15 | + | ||
16 | + <LinearLayout | ||
17 | + android:id="@+id/iphone_layout" | ||
18 | + android:layout_width="match_parent" | ||
19 | + android:layout_height="46dp" | ||
20 | + android:layout_marginTop="30dp" | ||
21 | + android:orientation="vertical"> | ||
22 | + | ||
23 | + </LinearLayout> | ||
24 | + | ||
25 | + <LinearLayout | ||
26 | + android:id="@+id/info_layout" | ||
27 | + android:layout_width="match_parent" | ||
28 | + android:layout_height="match_parent" | ||
29 | + android:layout_marginTop="20dp" | ||
30 | + android:orientation="vertical"> | ||
31 | + | ||
32 | + <LinearLayout | ||
33 | + android:layout_width="match_parent" | ||
34 | + android:layout_height="30dp" | ||
35 | + android:layout_marginLeft="60dp" | ||
36 | + android:layout_marginRight="60dp" | ||
37 | + android:layout_marginTop="10dp"> | ||
38 | + | ||
39 | + <TextView | ||
40 | + android:layout_width="wrap_content" | ||
41 | + android:layout_height="wrap_content" | ||
42 | + android:text="孩子姓名:" | ||
43 | + android:textSize="@dimen/sp_16" /> | ||
44 | + | ||
45 | + <EditText | ||
46 | + android:layout_width="wrap_content" | ||
47 | + android:layout_height="match_parent" | ||
48 | + android:layout_weight="1" | ||
49 | + android:background="@drawable/rudio_bord" | ||
50 | + android:gravity="center" | ||
51 | + android:text="李小明" | ||
52 | + android:textColor="@color/textColor" /> | ||
53 | + | ||
54 | + </LinearLayout> | ||
55 | + | ||
56 | + <LinearLayout | ||
57 | + android:layout_width="match_parent" | ||
58 | + android:layout_height="30dp" | ||
59 | + android:layout_marginLeft="60dp" | ||
60 | + android:layout_marginRight="60dp" | ||
61 | + android:layout_marginTop="10dp"> | ||
62 | + | ||
63 | + <TextView | ||
64 | + android:layout_width="wrap_content" | ||
65 | + android:layout_height="wrap_content" | ||
66 | + android:text="性 别:" | ||
67 | + android:textSize="@dimen/sp_16" /> | ||
68 | + | ||
69 | + <EditText | ||
70 | + android:layout_width="wrap_content" | ||
71 | + android:layout_height="match_parent" | ||
72 | + android:layout_weight="1" | ||
73 | + android:background="@drawable/rudio_bord" | ||
74 | + android:gravity="center" | ||
75 | + android:drawableRight="@drawable/arrow_down" | ||
76 | + android:text="男" | ||
77 | + android:textColor="@color/textColor" /> | ||
78 | + | ||
79 | + </LinearLayout> | ||
80 | + | ||
81 | + <LinearLayout | ||
82 | + android:layout_width="match_parent" | ||
83 | + android:layout_height="30dp" | ||
84 | + android:layout_marginLeft="60dp" | ||
85 | + android:layout_marginRight="60dp" | ||
86 | + android:layout_marginTop="10dp"> | ||
87 | + | ||
88 | + <TextView | ||
89 | + android:layout_width="wrap_content" | ||
90 | + android:layout_height="wrap_content" | ||
91 | + android:text="年 级:" | ||
92 | + android:textSize="@dimen/sp_16" /> | ||
93 | + | ||
94 | + <EditText | ||
95 | + android:layout_width="wrap_content" | ||
96 | + android:layout_height="match_parent" | ||
97 | + android:layout_weight="1" | ||
98 | + android:background="@drawable/rudio_bord" | ||
99 | + android:gravity="center" | ||
100 | + android:text="初一" | ||
101 | + android:drawableRight="@drawable/arrow_down" | ||
102 | + android:textColor="@color/textColor" /> | ||
103 | + | ||
104 | + </LinearLayout> | ||
105 | + | ||
106 | + <LinearLayout | ||
107 | + android:layout_width="match_parent" | ||
108 | + android:layout_height="30dp" | ||
109 | + android:layout_marginLeft="60dp" | ||
110 | + android:layout_marginRight="60dp" | ||
111 | + android:layout_marginTop="10dp"> | ||
112 | + | ||
113 | + <TextView | ||
114 | + android:layout_width="wrap_content" | ||
115 | + android:layout_height="wrap_content" | ||
116 | + android:text="班 级:" | ||
117 | + android:textSize="@dimen/sp_16" /> | ||
118 | + | ||
119 | + <EditText | ||
120 | + android:layout_width="wrap_content" | ||
121 | + android:layout_height="match_parent" | ||
122 | + android:layout_weight="1" | ||
123 | + android:background="@drawable/rudio_bord" | ||
124 | + android:gravity="center" | ||
125 | + android:text="初一(3)班" | ||
126 | + android:drawableRight="@drawable/arrow_down" | ||
127 | + android:textColor="@color/textColor" /> | ||
128 | + | ||
129 | + </LinearLayout> | ||
130 | + | ||
131 | + <TextView | ||
132 | + android:id="@+id/add_child" | ||
133 | + android:layout_width="220dp" | ||
134 | + android:layout_height="40dp" | ||
135 | + android:layout_gravity="center_horizontal" | ||
136 | + android:layout_marginTop="20dp" | ||
137 | + android:background="@drawable/rudiobtn" | ||
138 | + android:gravity="center" | ||
139 | + android:text="生成孩子账号" | ||
140 | + android:textColor="@color/white" | ||
141 | + android:textSize="@dimen/txtsize_title" /> | ||
142 | + </LinearLayout> | ||
143 | + | ||
144 | + | ||
145 | + </LinearLayout> | ||
146 | + | ||
147 | + | ||
148 | +</LinearLayout> |
@@ -0,0 +1,42 @@ | @@ -0,0 +1,42 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + android:layout_width="match_parent" | ||
4 | + android:layout_height="match_parent" | ||
5 | + android:orientation="vertical"> | ||
6 | + | ||
7 | + <include layout="@layout/top" /> | ||
8 | + | ||
9 | + <TextView | ||
10 | + android:layout_width="match_parent" | ||
11 | + android:layout_height="40dp" /> | ||
12 | + | ||
13 | + <EditText | ||
14 | + android:layout_width="match_parent" | ||
15 | + android:layout_height="60dp" | ||
16 | + android:layout_margin="20dp" | ||
17 | + android:hint="填写邀请码" /> | ||
18 | + | ||
19 | + <TextView | ||
20 | + android:id="@+id/add_child" | ||
21 | + android:layout_width="220dp" | ||
22 | + android:layout_height="40dp" | ||
23 | + android:layout_gravity="center_horizontal" | ||
24 | + android:layout_marginTop="20dp" | ||
25 | + android:background="@drawable/rudiobtn" | ||
26 | + android:gravity="center" | ||
27 | + android:text="下一步" | ||
28 | + android:textColor="@color/white" | ||
29 | + android:textSize="@dimen/txtsize_title" /> | ||
30 | + <TextView | ||
31 | + android:layout_margin="20dp" | ||
32 | + android:layout_width="match_parent" | ||
33 | + android:layout_height="wrap_content" | ||
34 | + android:text="注:填写需要绑定的孩子的邀请码(非合作学校无邀请码,请更换为手机号码验证的方式) | ||
35 | + | ||
36 | +如不知道邀请码请电话拨打:400-123456 进行查询 " | ||
37 | + android:textSize="@dimen/sp_14" | ||
38 | + android:textColor="@color/text_color" | ||
39 | + android:lineSpacingMultiplier="1.5" | ||
40 | + /> | ||
41 | + | ||
42 | +</LinearLayout> |
app/src/main/res/layout/activity_mychild.xml
@@ -16,6 +16,7 @@ | @@ -16,6 +16,7 @@ | ||
16 | </com.yanzhenjie.recyclerview.swipe.SwipeMenuRecyclerView> | 16 | </com.yanzhenjie.recyclerview.swipe.SwipeMenuRecyclerView> |
17 | 17 | ||
18 | <TextView | 18 | <TextView |
19 | + android:id="@+id/add_child" | ||
19 | android:layout_width="match_parent" | 20 | android:layout_width="match_parent" |
20 | android:layout_height="40dp" | 21 | android:layout_height="40dp" |
21 | android:layout_marginLeft="10dp" | 22 | android:layout_marginLeft="10dp" |
@@ -0,0 +1,214 @@ | @@ -0,0 +1,214 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | + android:layout_width="match_parent" | ||
5 | + android:layout_height="match_parent" | ||
6 | + android:background="#F0eff5" | ||
7 | + android:orientation="vertical"> | ||
8 | + | ||
9 | + <LinearLayout | ||
10 | + android:layout_width="match_parent" | ||
11 | + android:layout_height="wrap_content" | ||
12 | + android:layout_weight="1" | ||
13 | + android:background="#F0eff5" | ||
14 | + android:orientation="vertical"> | ||
15 | + | ||
16 | + <RelativeLayout | ||
17 | + android:layout_width="match_parent" | ||
18 | + android:layout_height="match_parent"> | ||
19 | + | ||
20 | + <RelativeLayout | ||
21 | + android:layout_width="match_parent" | ||
22 | + android:layout_height="360dp"> | ||
23 | + | ||
24 | + <LinearLayout | ||
25 | + android:id="@+id/top_layout" | ||
26 | + android:layout_width="match_parent" | ||
27 | + android:layout_height="180dp" | ||
28 | + android:background="@drawable/backgroud_top" | ||
29 | + android:orientation="vertical" | ||
30 | + android:paddingTop="20dp"> | ||
31 | + | ||
32 | + <TextView | ||
33 | + android:layout_width="match_parent" | ||
34 | + android:layout_height="wrap_content" | ||
35 | + android:layout_gravity="center" | ||
36 | + android:gravity="center" | ||
37 | + android:text="个人资料" | ||
38 | + android:textColor="@color/white" | ||
39 | + android:textSize="@dimen/txtsize_headline" /> | ||
40 | + | ||
41 | + | ||
42 | + </LinearLayout> | ||
43 | + | ||
44 | + <FrameLayout | ||
45 | + android:id="@+id/photoImage" | ||
46 | + android:layout_width="wrap_content" | ||
47 | + android:layout_height="wrap_content" | ||
48 | + android:layout_centerInParent="true"> | ||
49 | + | ||
50 | + <com.makeramen.roundedimageview.RoundedImageView | ||
51 | + android:layout_width="100dp" | ||
52 | + android:layout_height="100dp" | ||
53 | + android:src="@color/white" | ||
54 | + app:riv_corner_radius="20dp" /> | ||
55 | + </FrameLayout> | ||
56 | + | ||
57 | + <LinearLayout | ||
58 | + android:id="@+id/zhnaghaoxinxi" | ||
59 | + android:layout_width="match_parent" | ||
60 | + android:layout_height="wrap_content" | ||
61 | + android:layout_below="@id/photoImage" | ||
62 | + android:layout_marginTop="10dp" | ||
63 | + android:layout_weight="1" | ||
64 | + android:gravity="center" | ||
65 | + android:orientation="vertical"> | ||
66 | + | ||
67 | + <TextView | ||
68 | + android:layout_width="wrap_content" | ||
69 | + android:layout_height="wrap_content" | ||
70 | + android:text="马铂骞" | ||
71 | + android:textSize="@dimen/txtsize_title" /> | ||
72 | + | ||
73 | + <TextView | ||
74 | + android:layout_width="wrap_content" | ||
75 | + android:layout_height="wrap_content" | ||
76 | + android:text="账号:12345678991" | ||
77 | + android:textSize="@dimen/sp_18" /> | ||
78 | + </LinearLayout> | ||
79 | + | ||
80 | + </RelativeLayout> | ||
81 | + | ||
82 | + <ScrollView | ||
83 | + android:layout_width="match_parent" | ||
84 | + android:layout_height="match_parent" | ||
85 | + android:layout_marginTop="300dp"> | ||
86 | + | ||
87 | + <LinearLayout | ||
88 | + android:id="@+id/center_layout" | ||
89 | + android:layout_width="match_parent" | ||
90 | + android:layout_height="match_parent" | ||
91 | + android:layout_margin="20dp" | ||
92 | + android:orientation="vertical"> | ||
93 | + | ||
94 | + <LinearLayout | ||
95 | + android:layout_width="match_parent" | ||
96 | + android:layout_height="wrap_content" | ||
97 | + android:background="@color/white" | ||
98 | + android:orientation="vertical"> | ||
99 | + | ||
100 | + <LinearLayout | ||
101 | + android:layout_width="match_parent" | ||
102 | + android:layout_height="40dp" | ||
103 | + android:gravity="center_vertical"> | ||
104 | + | ||
105 | + <TextView | ||
106 | + android:layout_width="wrap_content" | ||
107 | + android:layout_height="wrap_content" | ||
108 | + android:layout_gravity="center" | ||
109 | + android:layout_marginLeft="15dp" | ||
110 | + android:layout_marginRight="30dp" | ||
111 | + android:text="用户名" | ||
112 | + android:textColor="@color/text_color" | ||
113 | + android:textSize="@dimen/txtsize_title" /> | ||
114 | + | ||
115 | + <TextView | ||
116 | + android:layout_width="0dp" | ||
117 | + android:layout_height="wrap_content" | ||
118 | + android:layout_weight="1" | ||
119 | + | ||
120 | + /> | ||
121 | + | ||
122 | + <EditText | ||
123 | + android:id="@+id/et_name" | ||
124 | + android:layout_width="wrap_content" | ||
125 | + android:layout_height="wrap_content" | ||
126 | + android:layout_gravity="center_vertical" | ||
127 | + android:layout_marginRight="15dp" | ||
128 | + android:background="@null" | ||
129 | + android:focusable="false" | ||
130 | + android:text="马铂骞" | ||
131 | + android:textColor="@color/text_color" | ||
132 | + android:textSize="@dimen/txtsize_title" /> | ||
133 | + | ||
134 | + </LinearLayout> | ||
135 | + | ||
136 | + <TextView | ||
137 | + android:layout_width="match_parent" | ||
138 | + android:layout_height="0.5dp" | ||
139 | + android:layout_marginLeft="15dp" | ||
140 | + android:layout_marginRight="15dp" | ||
141 | + android:background="@color/bottomline" /> | ||
142 | + | ||
143 | + <LinearLayout | ||
144 | + android:layout_width="match_parent" | ||
145 | + android:layout_height="40dp" | ||
146 | + android:gravity="center_vertical" | ||
147 | + | ||
148 | + > | ||
149 | + | ||
150 | + <TextView | ||
151 | + android:layout_width="wrap_content" | ||
152 | + android:layout_height="wrap_content" | ||
153 | + android:layout_marginLeft="15dp" | ||
154 | + android:layout_marginRight="30dp" | ||
155 | + android:text="性别" | ||
156 | + android:textSize="@dimen/txtsize_title" /> | ||
157 | + | ||
158 | + <TextView | ||
159 | + android:layout_width="wrap_content" | ||
160 | + android:layout_height="wrap_content" | ||
161 | + android:layout_gravity="center_vertical" | ||
162 | + android:layout_weight="1" | ||
163 | + android:textSize="@dimen/txtsize_title" /> | ||
164 | + | ||
165 | + <RadioGroup | ||
166 | + android:layout_width="wrap_content" | ||
167 | + android:layout_height="wrap_content" | ||
168 | + android:orientation="horizontal"> | ||
169 | + | ||
170 | + <RadioButton | ||
171 | + android:layout_width="wrap_content" | ||
172 | + android:layout_height="wrap_content" | ||
173 | + android:button="@null" | ||
174 | + android:drawablePadding="10dp" | ||
175 | + android:drawableRight="@android:drawable/btn_radio" | ||
176 | + android:text="男" | ||
177 | + android:textColor="@color/text_color" | ||
178 | + android:textSize="@dimen/txtsize_title" /> | ||
179 | + | ||
180 | + <RadioButton | ||
181 | + android:layout_width="wrap_content" | ||
182 | + android:layout_height="wrap_content" | ||
183 | + android:layout_marginLeft="10dp" | ||
184 | + android:button="@null" | ||
185 | + android:drawablePadding="10dp" | ||
186 | + android:drawableRight="@android:drawable/btn_radio" | ||
187 | + android:text="女" | ||
188 | + android:textColor="@color/text_color" | ||
189 | + android:textSize="@dimen/txtsize_title" /> | ||
190 | + | ||
191 | + </RadioGroup> | ||
192 | + | ||
193 | + </LinearLayout> | ||
194 | + | ||
195 | + | ||
196 | + </LinearLayout> | ||
197 | + | ||
198 | + | ||
199 | + </LinearLayout> | ||
200 | + </ScrollView> | ||
201 | + | ||
202 | + </RelativeLayout> | ||
203 | + </LinearLayout> | ||
204 | + | ||
205 | + <TextView | ||
206 | + android:layout_width="match_parent" | ||
207 | + android:layout_height="40dp" | ||
208 | + android:layout_margin="20dp" | ||
209 | + android:background="@drawable/rudiobtn" | ||
210 | + android:gravity="center" | ||
211 | + android:text="确认" | ||
212 | + android:textColor="@color/white" | ||
213 | + android:textSize="@dimen/txtsize_title" /> | ||
214 | +</LinearLayout> | ||
0 | \ No newline at end of file | 215 | \ No newline at end of file |
@@ -0,0 +1,109 @@ | @@ -0,0 +1,109 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<LinearLayout | ||
3 | + xmlns:android="http://schemas.android.com/apk/res/android" | ||
4 | + android:layout_width="match_parent" | ||
5 | + android:layout_height="match_parent" | ||
6 | + android:background="@color/white" | ||
7 | + android:orientation="vertical" | ||
8 | + > | ||
9 | + | ||
10 | + <include layout="@layout/top"/> | ||
11 | + <LinearLayout | ||
12 | + android:layout_width="match_parent" | ||
13 | + android:layout_height="wrap_content" | ||
14 | + > | ||
15 | + <TextView | ||
16 | + android:layout_marginBottom="10dp" | ||
17 | + android:layout_marginTop="10dp" | ||
18 | + android:id="@+id/tvLocalAddress" | ||
19 | + android:layout_width="wrap_content" | ||
20 | + android:layout_height="wrap_content" | ||
21 | + android:drawablePadding="@dimen/size_dp_5" | ||
22 | + android:drawableRight="@drawable/pull" | ||
23 | + android:gravity="center" | ||
24 | + android:paddingLeft="@dimen/size_dp_15" | ||
25 | + android:text="杭州" | ||
26 | + android:textColor="@color/textColor" | ||
27 | + android:textSize="@dimen/sp_16" /> | ||
28 | + <LinearLayout | ||
29 | + android:layout_width="wrap_content" | ||
30 | + android:layout_weight="1" | ||
31 | + android:layout_height="wrap_content" | ||
32 | + android:layout_marginRight="@dimen/size_dp_15" | ||
33 | + android:paddingTop="5dp" | ||
34 | + android:paddingBottom="5dp" | ||
35 | + android:background="@drawable/rudiobtn_gray" | ||
36 | + android:layout_gravity="center_vertical" | ||
37 | + > | ||
38 | + | ||
39 | + <EditText | ||
40 | + android:layout_width="wrap_content" | ||
41 | + android:layout_height="wrap_content" | ||
42 | + android:layout_marginLeft="10dp" | ||
43 | + android:layout_weight="1" | ||
44 | + android:hint="请输入搜索内容" | ||
45 | + android:textSize="@dimen/sp_16" | ||
46 | + android:gravity="center_horizontal" | ||
47 | + android:background="@null" | ||
48 | + /> | ||
49 | +<ImageView | ||
50 | + android:layout_width="40dp" | ||
51 | + android:layout_height="match_parent" | ||
52 | + android:src="@drawable/search_black" | ||
53 | + android:layout_marginRight="15dp" | ||
54 | + android:layout_gravity="center_vertical" | ||
55 | + /> | ||
56 | + </LinearLayout> | ||
57 | + | ||
58 | + </LinearLayout> | ||
59 | + <FrameLayout | ||
60 | + android:layout_width="fill_parent" | ||
61 | + android:layout_height="wrap_content" | ||
62 | + android:layout_weight="1" | ||
63 | + android:background="@android:color/white"> | ||
64 | + | ||
65 | + <android.support.v7.widget.RecyclerView | ||
66 | + android:id="@+id/schoollist" | ||
67 | + android:layout_width="match_parent" | ||
68 | + android:layout_height="match_parent" | ||
69 | + android:layout_gravity="center" | ||
70 | + android:divider="@null" /> | ||
71 | + | ||
72 | + <TextView | ||
73 | + android:id="@+id/dialog" | ||
74 | + android:layout_width="80.0dip" | ||
75 | + android:layout_height="80.0dip" | ||
76 | + android:layout_gravity="center" | ||
77 | + android:background="@drawable/progress_bg" | ||
78 | + android:gravity="center" | ||
79 | + android:textColor="#ffffffff" | ||
80 | + android:textSize="30.0dip" | ||
81 | + android:visibility="invisible" /> | ||
82 | + | ||
83 | + <com.shunzhi.parent.views.SideBar | ||
84 | + android:id="@+id/sidrbar" | ||
85 | + android:layout_width="30.0dip" | ||
86 | + android:layout_height="fill_parent" | ||
87 | + android:layout_gravity="right|center" | ||
88 | + android:background="#77dddddd" | ||
89 | + android:layout_marginBottom="5dp" | ||
90 | + android:layout_marginTop="5dp" /> | ||
91 | + | ||
92 | + </FrameLayout> | ||
93 | + | ||
94 | + <TextView | ||
95 | + android:id="@+id/go_next" | ||
96 | + android:layout_width="match_parent" | ||
97 | + android:layout_height="40dp" | ||
98 | + android:layout_marginLeft="10dp" | ||
99 | + android:layout_marginRight="10dp" | ||
100 | + android:text="下一步" | ||
101 | + android:textColor="@color/white" | ||
102 | + android:textSize="@dimen/txtsize_title" | ||
103 | + android:gravity="center" | ||
104 | + android:background="@drawable/rudiobtn" | ||
105 | + /> | ||
106 | + | ||
107 | + | ||
108 | + | ||
109 | +</LinearLayout> | ||
0 | \ No newline at end of file | 110 | \ No newline at end of file |
@@ -0,0 +1,46 @@ | @@ -0,0 +1,46 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + android:layout_width="300dp" | ||
4 | + android:layout_gravity="center" | ||
5 | + android:layout_height="wrap_content" | ||
6 | + android:background="#00000000" | ||
7 | + android:orientation="vertical"> | ||
8 | + | ||
9 | + <TextView | ||
10 | + android:id="@+id/dialog_info" | ||
11 | + android:layout_width="300dp" | ||
12 | + android:layout_height="200dp" | ||
13 | + android:gravity="center" | ||
14 | + android:textSize="@dimen/txtsize_headline" | ||
15 | + android:layout_gravity="center" | ||
16 | + android:background="@drawable/rudiobtn_white" /> | ||
17 | + | ||
18 | + <LinearLayout | ||
19 | + android:layout_width="match_parent" | ||
20 | + android:layout_height="wrap_content" | ||
21 | + android:layout_marginTop="10dp"> | ||
22 | + | ||
23 | + <TextView | ||
24 | + android:id="@+id/cancel_btn" | ||
25 | + android:layout_width="140dp" | ||
26 | + android:layout_height="40dp" | ||
27 | + android:gravity="center" | ||
28 | + android:textColor="@color/white" | ||
29 | + android:textSize="@dimen/txtsize_title" | ||
30 | + android:background="@drawable/rudiobtn" | ||
31 | + android:text="取消" /> | ||
32 | + | ||
33 | + <TextView | ||
34 | + android:id="@+id/right_btn" | ||
35 | + android:layout_marginLeft="20dp" | ||
36 | + android:layout_width="140dp" | ||
37 | + android:layout_height="40dp" | ||
38 | + android:gravity="center" | ||
39 | + android:textColor="@color/white" | ||
40 | + android:textSize="@dimen/txtsize_title" | ||
41 | + android:background="@drawable/rudiobtn" | ||
42 | + android:text="确定" /> | ||
43 | + </LinearLayout> | ||
44 | + | ||
45 | + | ||
46 | +</LinearLayout> |
app/src/main/res/layout/fragment_mine.xml
@@ -14,9 +14,9 @@ | @@ -14,9 +14,9 @@ | ||
14 | 14 | ||
15 | <LinearLayout | 15 | <LinearLayout |
16 | android:id="@+id/top_layout" | 16 | android:id="@+id/top_layout" |
17 | - android:paddingTop="40dp" | 17 | + android:paddingTop="20dp" |
18 | android:layout_width="match_parent" | 18 | android:layout_width="match_parent" |
19 | - android:layout_height="200dp" | 19 | + android:layout_height="180dp" |
20 | android:background="@drawable/backgroud_top" | 20 | android:background="@drawable/backgroud_top" |
21 | android:orientation="vertical"> | 21 | android:orientation="vertical"> |
22 | 22 | ||
@@ -26,10 +26,11 @@ | @@ -26,10 +26,11 @@ | ||
26 | android:layout_gravity="center" | 26 | android:layout_gravity="center" |
27 | android:gravity="center" | 27 | android:gravity="center" |
28 | android:text="个人中心" | 28 | android:text="个人中心" |
29 | - android:textColor="@color/textRed" | 29 | + android:textColor="@color/white" |
30 | android:textSize="@dimen/txtsize_headline" /> | 30 | android:textSize="@dimen/txtsize_headline" /> |
31 | 31 | ||
32 | <LinearLayout | 32 | <LinearLayout |
33 | + android:id="@+id/personinfo" | ||
33 | android:layout_width="match_parent" | 34 | android:layout_width="match_parent" |
34 | android:layout_height="wrap_content" | 35 | android:layout_height="wrap_content" |
35 | android:orientation="horizontal"> | 36 | android:orientation="horizontal"> |
@@ -246,7 +247,7 @@ | @@ -246,7 +247,7 @@ | ||
246 | android:layout_height="wrap_content" | 247 | android:layout_height="wrap_content" |
247 | android:layout_gravity="center_vertical" | 248 | android:layout_gravity="center_vertical" |
248 | android:layout_weight="1" | 249 | android:layout_weight="1" |
249 | - android:text="在线客服" | 250 | + android:text="意见与反馈" |
250 | android:textSize="@dimen/txtsize_title" /> | 251 | android:textSize="@dimen/txtsize_title" /> |
251 | 252 | ||
252 | </LinearLayout> | 253 | </LinearLayout> |
app/src/main/res/layout/fragment_report.xml
@@ -5,10 +5,78 @@ | @@ -5,10 +5,78 @@ | ||
5 | android:orientation="vertical" | 5 | android:orientation="vertical" |
6 | tools:context="com.shunzhi.parent.ui.fragment.ReportFragment"> | 6 | tools:context="com.shunzhi.parent.ui.fragment.ReportFragment"> |
7 | 7 | ||
8 | +<<<<<<< HEAD | ||
8 | <FrameLayout | 9 | <FrameLayout |
9 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
10 | android:layout_height="?android:actionBarSize" | 11 | android:layout_height="?android:actionBarSize" |
11 | android:background="@color/titleColor"> | 12 | android:background="@color/titleColor"> |
13 | +======= | ||
14 | + <!-- TODO: Update blank fragment layout --> | ||
15 | +<LinearLayout | ||
16 | + android:layout_width="match_parent" | ||
17 | + android:layout_height="match_parent" | ||
18 | + android:orientation="vertical" | ||
19 | + > | ||
20 | +<LinearLayout | ||
21 | + android:id="@+id/top_layout" | ||
22 | + android:layout_width="match_parent" | ||
23 | + android:layout_height="?android:actionBarSize" | ||
24 | + android:orientation="horizontal" | ||
25 | + android:padding="10dp" | ||
26 | + android:background="@color/back_top" | ||
27 | + > | ||
28 | + | ||
29 | + <TextView | ||
30 | + android:layout_width="wrap_content" | ||
31 | + android:layout_height="wrap_content" | ||
32 | + android:text="马铂骞" | ||
33 | + android:drawableRight="@drawable/pull" | ||
34 | + android:drawablePadding="10dp" | ||
35 | + android:textColor="@color/textColor" | ||
36 | + android:textSize="@dimen/textSize16" | ||
37 | + android:layout_gravity="center_vertical" | ||
38 | + /> | ||
39 | +<TextView | ||
40 | + android:layout_width="wrap_content" | ||
41 | + android:layout_height="wrap_content" | ||
42 | + android:layout_weight="1" | ||
43 | + android:text="2018年3月" | ||
44 | + android:gravity="center_horizontal" | ||
45 | + android:layout_gravity="center_vertical" | ||
46 | + android:textColor="@color/textColor" | ||
47 | + android:textSize="@dimen/textSize16" | ||
48 | + /> | ||
49 | + <TextView | ||
50 | + android:layout_width="wrap_content" | ||
51 | + android:layout_height="wrap_content" | ||
52 | + android:text="筛选" | ||
53 | + android:layout_gravity="center_vertical" | ||
54 | + android:textColor="@color/textColor" | ||
55 | + android:textSize="@dimen/textSize16" | ||
56 | + android:drawableRight="@drawable/screen" | ||
57 | + /> | ||
58 | +</LinearLayout> | ||
59 | +<LinearLayout | ||
60 | + android:layout_width="match_parent" | ||
61 | + android:layout_height="60dp"> | ||
62 | +<TextView | ||
63 | + android:layout_width="match_parent" | ||
64 | + android:layout_height="match_parent" | ||
65 | + android:text="日期控件" | ||
66 | + android:textColor="@color/white" | ||
67 | + android:gravity="center" | ||
68 | + android:background="@color/textRed" | ||
69 | + /> | ||
70 | + | ||
71 | +</LinearLayout> | ||
72 | +<android.support.v7.widget.RecyclerView | ||
73 | + android:id="@+id/recycle_report" | ||
74 | + android:layout_width="match_parent" | ||
75 | + android:layout_height="match_parent"> | ||
76 | + | ||
77 | +</android.support.v7.widget.RecyclerView> | ||
78 | +</LinearLayout> | ||
79 | +>>>>>>> 91d4262102c69d0c070bfc0895a51c51b717175b | ||
12 | 80 | ||
13 | <TextView | 81 | <TextView |
14 | android:id="@+id/tvLocalAddress" | 82 | android:id="@+id/tvLocalAddress" |
app/src/main/res/layout/fragment_report_BACKUP_12928.xml
0 → 100644
@@ -0,0 +1,113 @@ | @@ -0,0 +1,113 @@ | ||
1 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
2 | + xmlns:tools="http://schemas.android.com/tools" | ||
3 | + android:layout_width="match_parent" | ||
4 | + android:layout_height="match_parent" | ||
5 | + android:orientation="vertical" | ||
6 | + tools:context="com.shunzhi.parent.ui.fragment.ReportFragment"> | ||
7 | + | ||
8 | +<<<<<<< HEAD | ||
9 | + <FrameLayout | ||
10 | + android:layout_width="match_parent" | ||
11 | + android:layout_height="?android:actionBarSize" | ||
12 | + android:background="@color/titleColor"> | ||
13 | +======= | ||
14 | + <!-- TODO: Update blank fragment layout --> | ||
15 | +<LinearLayout | ||
16 | + android:layout_width="match_parent" | ||
17 | + android:layout_height="match_parent" | ||
18 | + android:orientation="vertical" | ||
19 | + > | ||
20 | +<LinearLayout | ||
21 | + android:id="@+id/top_layout" | ||
22 | + android:layout_width="match_parent" | ||
23 | + android:layout_height="?android:actionBarSize" | ||
24 | + android:orientation="horizontal" | ||
25 | + android:padding="10dp" | ||
26 | + android:background="@color/back_top" | ||
27 | + > | ||
28 | + | ||
29 | + <TextView | ||
30 | + android:layout_width="wrap_content" | ||
31 | + android:layout_height="wrap_content" | ||
32 | + android:text="马铂骞" | ||
33 | + android:drawableRight="@drawable/pull" | ||
34 | + android:drawablePadding="10dp" | ||
35 | + android:textColor="@color/textColor" | ||
36 | + android:textSize="@dimen/textSize16" | ||
37 | + android:layout_gravity="center_vertical" | ||
38 | + /> | ||
39 | +<TextView | ||
40 | + android:layout_width="wrap_content" | ||
41 | + android:layout_height="wrap_content" | ||
42 | + android:layout_weight="1" | ||
43 | + android:text="2018年3月" | ||
44 | + android:gravity="center_horizontal" | ||
45 | + android:layout_gravity="center_vertical" | ||
46 | + android:textColor="@color/textColor" | ||
47 | + android:textSize="@dimen/textSize16" | ||
48 | + /> | ||
49 | + <TextView | ||
50 | + android:layout_width="wrap_content" | ||
51 | + android:layout_height="wrap_content" | ||
52 | + android:text="筛选" | ||
53 | + android:layout_gravity="center_vertical" | ||
54 | + android:textColor="@color/textColor" | ||
55 | + android:textSize="@dimen/textSize16" | ||
56 | + android:drawableRight="@drawable/screen" | ||
57 | + /> | ||
58 | +</LinearLayout> | ||
59 | +<LinearLayout | ||
60 | + android:layout_width="match_parent" | ||
61 | + android:layout_height="60dp"> | ||
62 | +<TextView | ||
63 | + android:layout_width="match_parent" | ||
64 | + android:layout_height="match_parent" | ||
65 | + android:text="日期控件" | ||
66 | + android:textColor="@color/white" | ||
67 | + android:gravity="center" | ||
68 | + android:background="@color/textRed" | ||
69 | + /> | ||
70 | + | ||
71 | +</LinearLayout> | ||
72 | +<android.support.v7.widget.RecyclerView | ||
73 | + android:id="@+id/recycle_report" | ||
74 | + android:layout_width="match_parent" | ||
75 | + android:layout_height="match_parent"> | ||
76 | + | ||
77 | +</android.support.v7.widget.RecyclerView> | ||
78 | +</LinearLayout> | ||
79 | +>>>>>>> 91d4262102c69d0c070bfc0895a51c51b717175b | ||
80 | + | ||
81 | + <TextView | ||
82 | + android:id="@+id/tvLocalAddress" | ||
83 | + android:layout_width="wrap_content" | ||
84 | + android:layout_height="match_parent" | ||
85 | + android:drawablePadding="@dimen/size_dp_5" | ||
86 | + android:drawableRight="@drawable/pull" | ||
87 | + android:gravity="center" | ||
88 | + android:paddingLeft="@dimen/size_dp_15" | ||
89 | + android:text="马博晒" | ||
90 | + android:textColor="@color/textColor" | ||
91 | + android:textSize="@dimen/textSize16" /> | ||
92 | + | ||
93 | + <TextView | ||
94 | + style="@style/TextView_Wrap_16" | ||
95 | + android:layout_gravity="center" | ||
96 | + android:gravity="center" | ||
97 | + android:text="2018年8月" | ||
98 | + android:textColor="@color/textColor" /> | ||
99 | + | ||
100 | + | ||
101 | + <TextView | ||
102 | + style="@style/TextView_Wrap_16" | ||
103 | + android:layout_height="match_parent" | ||
104 | + android:paddingRight="@dimen/size_dp_15" | ||
105 | + android:layout_gravity="right" | ||
106 | + android:gravity="center" | ||
107 | + android:text="筛选" | ||
108 | + android:drawableRight="@drawable/shaixuan" | ||
109 | + android:drawablePadding="@dimen/size_dp_5" | ||
110 | + android:textColor="@color/textColor" /> | ||
111 | + | ||
112 | + </FrameLayout> | ||
113 | +</LinearLayout> |
@@ -0,0 +1,13 @@ | @@ -0,0 +1,13 @@ | ||
1 | +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
2 | + xmlns:tools="http://schemas.android.com/tools" | ||
3 | + android:layout_width="match_parent" | ||
4 | + android:layout_height="match_parent" | ||
5 | + tools:context="com.shunzhi.parent.ui.fragment.ReportFragment"> | ||
6 | + | ||
7 | + <!-- TODO: Update blank fragment layout --> | ||
8 | + <TextView | ||
9 | + android:layout_width="match_parent" | ||
10 | + android:layout_height="match_parent" | ||
11 | + android:text="@string/hello_blank_fragment" /> | ||
12 | + | ||
13 | +</FrameLayout> |
@@ -0,0 +1,45 @@ | @@ -0,0 +1,45 @@ | ||
1 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
2 | + xmlns:tools="http://schemas.android.com/tools" | ||
3 | + android:layout_width="match_parent" | ||
4 | + android:layout_height="match_parent" | ||
5 | + android:orientation="vertical" | ||
6 | + tools:context="com.shunzhi.parent.ui.fragment.ReportFragment"> | ||
7 | + | ||
8 | + <FrameLayout | ||
9 | + android:layout_width="match_parent" | ||
10 | + android:layout_height="?android:actionBarSize" | ||
11 | + android:background="@color/titleColor"> | ||
12 | + | ||
13 | + <TextView | ||
14 | + android:id="@+id/tvLocalAddress" | ||
15 | + android:layout_width="wrap_content" | ||
16 | + android:layout_height="match_parent" | ||
17 | + android:drawablePadding="@dimen/size_dp_5" | ||
18 | + android:drawableRight="@drawable/pull" | ||
19 | + android:gravity="center" | ||
20 | + android:paddingLeft="@dimen/size_dp_15" | ||
21 | + android:text="马博晒" | ||
22 | + android:textColor="@color/textColor" | ||
23 | + android:textSize="@dimen/textSize16" /> | ||
24 | + | ||
25 | + <TextView | ||
26 | + style="@style/TextView_Wrap_16" | ||
27 | + android:layout_gravity="center" | ||
28 | + android:gravity="center" | ||
29 | + android:text="2018年8月" | ||
30 | + android:textColor="@color/textColor" /> | ||
31 | + | ||
32 | + | ||
33 | + <TextView | ||
34 | + style="@style/TextView_Wrap_16" | ||
35 | + android:layout_height="match_parent" | ||
36 | + android:paddingRight="@dimen/size_dp_15" | ||
37 | + android:layout_gravity="right" | ||
38 | + android:gravity="center" | ||
39 | + android:text="筛选" | ||
40 | + android:drawableRight="@drawable/shaixuan" | ||
41 | + android:drawablePadding="@dimen/size_dp_5" | ||
42 | + android:textColor="@color/textColor" /> | ||
43 | + | ||
44 | + </FrameLayout> | ||
45 | +</LinearLayout> |
app/src/main/res/layout/fragment_report_REMOTE_12928.xml
0 → 100644
@@ -0,0 +1,73 @@ | @@ -0,0 +1,73 @@ | ||
1 | +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
2 | + xmlns:tools="http://schemas.android.com/tools" | ||
3 | + android:layout_width="match_parent" | ||
4 | + android:layout_height="match_parent" | ||
5 | + tools:context="com.shunzhi.parent.ui.fragment.ReportFragment"> | ||
6 | + | ||
7 | + <!-- TODO: Update blank fragment layout --> | ||
8 | +<LinearLayout | ||
9 | + android:layout_width="match_parent" | ||
10 | + android:layout_height="match_parent" | ||
11 | + android:orientation="vertical" | ||
12 | + > | ||
13 | +<LinearLayout | ||
14 | + android:id="@+id/top_layout" | ||
15 | + android:layout_width="match_parent" | ||
16 | + android:layout_height="?android:actionBarSize" | ||
17 | + android:orientation="horizontal" | ||
18 | + android:padding="10dp" | ||
19 | + android:background="@color/back_top" | ||
20 | + > | ||
21 | + | ||
22 | + <TextView | ||
23 | + android:layout_width="wrap_content" | ||
24 | + android:layout_height="wrap_content" | ||
25 | + android:text="马铂骞" | ||
26 | + android:drawableRight="@drawable/pull" | ||
27 | + android:drawablePadding="10dp" | ||
28 | + android:textColor="@color/textColor" | ||
29 | + android:textSize="@dimen/textSize16" | ||
30 | + android:layout_gravity="center_vertical" | ||
31 | + /> | ||
32 | +<TextView | ||
33 | + android:layout_width="wrap_content" | ||
34 | + android:layout_height="wrap_content" | ||
35 | + android:layout_weight="1" | ||
36 | + android:text="2018年3月" | ||
37 | + android:gravity="center_horizontal" | ||
38 | + android:layout_gravity="center_vertical" | ||
39 | + android:textColor="@color/textColor" | ||
40 | + android:textSize="@dimen/textSize16" | ||
41 | + /> | ||
42 | + <TextView | ||
43 | + android:layout_width="wrap_content" | ||
44 | + android:layout_height="wrap_content" | ||
45 | + android:text="筛选" | ||
46 | + android:layout_gravity="center_vertical" | ||
47 | + android:textColor="@color/textColor" | ||
48 | + android:textSize="@dimen/textSize16" | ||
49 | + android:drawableRight="@drawable/screen" | ||
50 | + /> | ||
51 | +</LinearLayout> | ||
52 | +<LinearLayout | ||
53 | + android:layout_width="match_parent" | ||
54 | + android:layout_height="60dp"> | ||
55 | +<TextView | ||
56 | + android:layout_width="match_parent" | ||
57 | + android:layout_height="match_parent" | ||
58 | + android:text="日期控件" | ||
59 | + android:textColor="@color/white" | ||
60 | + android:gravity="center" | ||
61 | + android:background="@color/textRed" | ||
62 | + /> | ||
63 | + | ||
64 | +</LinearLayout> | ||
65 | +<android.support.v7.widget.RecyclerView | ||
66 | + android:id="@+id/recycle_report" | ||
67 | + android:layout_width="match_parent" | ||
68 | + android:layout_height="match_parent"> | ||
69 | + | ||
70 | +</android.support.v7.widget.RecyclerView> | ||
71 | +</LinearLayout> | ||
72 | + | ||
73 | +</FrameLayout> |
@@ -0,0 +1,103 @@ | @@ -0,0 +1,103 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + android:layout_width="match_parent" | ||
4 | + android:layout_height="match_parent"> | ||
5 | + | ||
6 | + <LinearLayout | ||
7 | + android:layout_width="match_parent" | ||
8 | + android:layout_height="250dp" | ||
9 | + android:layout_margin="20dp" | ||
10 | + android:background="@drawable/report_white" | ||
11 | + android:orientation="vertical"> | ||
12 | + | ||
13 | + <TextView | ||
14 | + android:layout_width="match_parent" | ||
15 | + android:layout_height="40dp" | ||
16 | + android:background="@drawable/rudiobtn_report_top" | ||
17 | + android:gravity="center_vertical" | ||
18 | + android:paddingLeft="20dp" | ||
19 | + android:text="语文作业报告" | ||
20 | + android:textColor="#20519f" | ||
21 | + android:textSize="@dimen/sp_16" /> | ||
22 | + | ||
23 | + <RelativeLayout | ||
24 | + android:layout_width="match_parent" | ||
25 | + android:layout_height="wrap_content" | ||
26 | + android:layout_weight="1" | ||
27 | + android:orientation="horizontal"> | ||
28 | + | ||
29 | + <LinearLayout | ||
30 | + android:layout_width="80dp" | ||
31 | + android:layout_height="match_parent" | ||
32 | + android:layout_marginTop="10dp" | ||
33 | + android:orientation="vertical"> | ||
34 | + | ||
35 | + <TextView | ||
36 | + android:layout_width="match_parent" | ||
37 | + android:layout_height="wrap_content" | ||
38 | + android:gravity="center" | ||
39 | + android:text="12" | ||
40 | + android:textColor="@color/textGreen" | ||
41 | + android:textSize="@dimen/txtsize_num" /> | ||
42 | + | ||
43 | + <TextView | ||
44 | + android:layout_width="match_parent" | ||
45 | + android:layout_height="wrap_content" | ||
46 | + android:gravity="center" | ||
47 | + android:text="正确" | ||
48 | + android:textColor="@color/textGreen" | ||
49 | + android:textSize="@dimen/sp_16" /> | ||
50 | + </LinearLayout> | ||
51 | + | ||
52 | + <LinearLayout | ||
53 | + android:layout_width="wrap_content" | ||
54 | + android:layout_height="match_parent" | ||
55 | + android:layout_weight="1" | ||
56 | + android:layout_centerInParent="true" | ||
57 | + android:gravity="center_horizontal" | ||
58 | + > | ||
59 | + <com.shunzhi.parent.views.ProgressView | ||
60 | + android:id="@+id/ring" | ||
61 | + android:layout_width="160dp" | ||
62 | + android:layout_height="match_parent" | ||
63 | + android:layout_marginTop="10dp" /> | ||
64 | + </LinearLayout> | ||
65 | + | ||
66 | + <LinearLayout | ||
67 | + android:layout_width="80dp" | ||
68 | + android:layout_height="match_parent" | ||
69 | + android:layout_marginTop="10dp" | ||
70 | + android:layout_alignParentRight="true" | ||
71 | + android:orientation="vertical"> | ||
72 | + | ||
73 | + <TextView | ||
74 | + android:layout_width="match_parent" | ||
75 | + android:layout_height="wrap_content" | ||
76 | + android:gravity="center" | ||
77 | + android:text="8" | ||
78 | + android:textColor="@color/textRed" | ||
79 | + android:textSize="@dimen/txtsize_num" /> | ||
80 | + | ||
81 | + <TextView | ||
82 | + android:layout_width="match_parent" | ||
83 | + android:layout_height="wrap_content" | ||
84 | + android:gravity="center" | ||
85 | + android:text="错误" | ||
86 | + android:textColor="@color/textRed" | ||
87 | + android:textSize="@dimen/sp_16" /> | ||
88 | + </LinearLayout> | ||
89 | + | ||
90 | + </RelativeLayout> | ||
91 | + | ||
92 | + <TextView | ||
93 | + android:layout_width="match_parent" | ||
94 | + android:layout_height="wrap_content" | ||
95 | + android:height="40dp" | ||
96 | + android:gravity="center_vertical" | ||
97 | + android:paddingLeft="20dp" | ||
98 | + android:text="3月4日语文作业" | ||
99 | + android:textColor="@color/text_color" | ||
100 | + android:textSize="@dimen/sp_14" /> | ||
101 | + | ||
102 | + </LinearLayout> | ||
103 | +</LinearLayout> |
@@ -0,0 +1,44 @@ | @@ -0,0 +1,44 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + android:layout_width="match_parent" | ||
4 | + android:layout_height="match_parent" | ||
5 | + android:orientation="vertical"> | ||
6 | +<LinearLayout | ||
7 | + android:layout_width="fill_parent" | ||
8 | + android:layout_height="wrap_content" | ||
9 | + android:background="#E0E0E0" | ||
10 | + > | ||
11 | + <TextView | ||
12 | + android:id="@+id/uiPPLetter" | ||
13 | + android:layout_width="match_parent" | ||
14 | + android:layout_height="wrap_content" | ||
15 | + android:paddingBottom="5dip" | ||
16 | + android:paddingLeft="5dip" | ||
17 | + android:paddingTop="5dip" | ||
18 | + android:text="A" | ||
19 | + android:textColor="#454545" /> | ||
20 | +</LinearLayout> | ||
21 | + <RelativeLayout | ||
22 | + android:layout_width="match_parent" | ||
23 | + android:layout_height="wrap_content"> | ||
24 | + | ||
25 | + <TextView | ||
26 | + android:id="@+id/school_name" | ||
27 | + android:layout_width="wrap_content" | ||
28 | + android:layout_height="40dp" | ||
29 | + android:layout_marginLeft="20dp" | ||
30 | + android:gravity="center_vertical" | ||
31 | + android:text="阿尔卑斯" | ||
32 | + android:textColor="@color/textColor" | ||
33 | + android:textSize="@dimen/sp_16" /> | ||
34 | + | ||
35 | + <ImageView | ||
36 | + android:layout_alignParentRight="true" | ||
37 | + android:id="@+id/select_school" | ||
38 | + android:layout_width="20dp" | ||
39 | + android:layout_height="40dp" | ||
40 | + android:layout_marginRight="40dp" | ||
41 | + android:gravity="center_vertical" | ||
42 | + android:src="@drawable/select_ok" /> | ||
43 | + </RelativeLayout> | ||
44 | +</LinearLayout> |
app/src/main/res/layout/top.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | android:layout_width="match_parent" | 3 | android:layout_width="match_parent" |
4 | - android:layout_height="80dp"> | 4 | + android:layout_height="?android:actionBarSize" |
5 | + android:background="@color/back_top" | ||
6 | + android:padding="10dp"> | ||
5 | 7 | ||
6 | - <RelativeLayout | ||
7 | - android:layout_width="match_parent" | ||
8 | - android:layout_height="wrap_content" | ||
9 | - android:background="@color/back_top" | ||
10 | - android:paddingTop="20dp" | ||
11 | - android:paddingBottom="10dp" | ||
12 | - > | ||
13 | - <TextView | ||
14 | - android:id="@+id/back_top" | ||
15 | - android:layout_width="40dp" | ||
16 | - android:layout_height="40dp" | ||
17 | - android:layout_alignParentBottom="true" | ||
18 | - android:background="@drawable/arrow_left" /> | ||
19 | - | ||
20 | - <TextView | ||
21 | - android:layout_width="wrap_content" | ||
22 | - android:layout_height="wrap_content" | ||
23 | - android:textSize="@dimen/txtsize_headline" | ||
24 | - android:layout_centerHorizontal="true" | ||
25 | - android:layout_alignParentBottom="true" | ||
26 | - android:text="主题" /> | ||
27 | - </RelativeLayout> | 8 | + <TextView |
9 | + android:id="@+id/back_top" | ||
10 | + android:layout_width="30dp" | ||
11 | + android:layout_height="30dp" | ||
12 | + android:layout_gravity="center_vertical" | ||
13 | + android:background="@drawable/arrow_left" /> | ||
28 | 14 | ||
15 | + <TextView | ||
16 | + android:id="@+id/center_title" | ||
17 | + android:layout_width="wrap_content" | ||
18 | + android:layout_height="match_parent" | ||
19 | + android:layout_weight="1" | ||
20 | + android:text="主题" | ||
21 | + android:gravity="center" | ||
22 | + android:textColor="@color/textColor" | ||
23 | + android:textSize="@dimen/textSize16" /> | ||
24 | + <TextView | ||
25 | + android:layout_width="30dp" | ||
26 | + android:layout_height="30dp" | ||
27 | + android:layout_gravity="center_vertical" | ||
28 | + /> | ||
29 | </LinearLayout> | 29 | </LinearLayout> |
30 | \ No newline at end of file | 30 | \ No newline at end of file |
app/src/main/res/values/colors.xml
@@ -17,4 +17,6 @@ | @@ -17,4 +17,6 @@ | ||
17 | <color name="xueqing_blue">#ABC9FF</color> | 17 | <color name="xueqing_blue">#ABC9FF</color> |
18 | <color name="zxlx">#1BE2E5</color> | 18 | <color name="zxlx">#1BE2E5</color> |
19 | <color name="huodong_blue">#ACD1FB</color> | 19 | <color name="huodong_blue">#ACD1FB</color> |
20 | + <color name="text_color">#757575</color> | ||
21 | + <color name="textGreen">#5FB762</color> | ||
20 | </resources> | 22 | </resources> |
app/src/main/res/values/dimens.xml
@@ -14,6 +14,7 @@ | @@ -14,6 +14,7 @@ | ||
14 | 14 | ||
15 | <!-- txtsize --> | 15 | <!-- txtsize --> |
16 | <dimen name="txtsize_display1">34sp</dimen> | 16 | <dimen name="txtsize_display1">34sp</dimen> |
17 | + <dimen name="txtsize_num">36sp</dimen> | ||
17 | <dimen name="txtsize_headline">24sp</dimen> | 18 | <dimen name="txtsize_headline">24sp</dimen> |
18 | <dimen name="txtsize_title">20sp</dimen> | 19 | <dimen name="txtsize_title">20sp</dimen> |
19 | <dimen name="txtsize_subhead">16sp</dimen> | 20 | <dimen name="txtsize_subhead">16sp</dimen> |