Commit 0c319a2dc865eaf58d2cd74c85bad62348f94337

Authored by 陶汉栋
2 parents 6bcfb14f c1a67969
Exists in yxb_dev and in 1 other branch developer

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

app/libs/processor.jar
No preview for this file type
app/src/main/java/com/shunzhi/parent/adapter/SchoolListAdapter.java
... ... @@ -39,6 +39,17 @@ public class SchoolListAdapter extends BaseRecyclerViewAdapter<SortBean> {
39 39  
40 40 }
41 41  
  42 +
  43 + public void setStart(){
  44 + ischeck = new boolean[list.size()];
  45 + for (int i=0;i<ischeck.length;i++){
  46 + ischeck[i]=false;
  47 + }
  48 + currentPosition=-1;
  49 +
  50 + }
  51 +
  52 +
42 53 @Override
43 54 public void addAll(List<SortBean> data) {
44 55 super.addAll(data);
... ... @@ -72,7 +83,6 @@ public class SchoolListAdapter extends BaseRecyclerViewAdapter&lt;SortBean&gt; {
72 83 @Override
73 84 public void onBindViewHolder(final SortBean object, final int position) {
74 85 select_school.setVisibility(View.INVISIBLE);
75   - Log.e("1111-===",position+"");
76 86 if (ischeck[position] ==true) {
77 87 select_school.setVisibility(View.VISIBLE);
78 88 }
... ...
app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
... ... @@ -172,8 +172,9 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre
172 172 AppConfig.getAppConfig(AppContext.getContext()).set(AppConfig.USER_ID, currentBean.getUserid());
173 173  
174 174 if (currentBean.getStudentClass() != null && currentBean.getStudentClass().size() > 0) {
175   -// Log.e("qqqq--==","qqqqq");
176 175 AppConfig.getAppConfig(mIView.getBindActivity()).set(AppConfig.ISBINDING, "1");
  176 + }else{
  177 + AppConfig.getAppConfig(mIView.getBindActivity()).set(AppConfig.ISBINDING, "0");
177 178 }
178 179  
179 180 String account = currentBean.getUserid();
... ...
app/src/main/java/com/shunzhi/parent/ui/activity/MyChildActivity.java
... ... @@ -102,6 +102,11 @@ public class MyChildActivity extends BaseMVPCompatActivity&lt;MyChildContract.MyChi
102 102 public void updateChildList(CurrentBean currentBean) {
103 103 currlist.clear();
104 104 List<ChildBean> list = currentBean.getStudentClass();
  105 + if (list.size() > 0) {
  106 + AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.ISBINDING, "1");
  107 + } else {
  108 + AppConfig.getAppConfig(AppContext.getInstance()).set(AppConfig.ISBINDING, "0");
  109 + }
105 110 currlist.addAll(list);
106 111 if (childAdapter == null) {
107 112 childAdapter = new ChildAdapter(this);
... ...
app/src/main/java/com/shunzhi/parent/ui/activity/binding/SelectSchoolActivity.java
... ... @@ -5,7 +5,12 @@ import android.os.Bundle;
5 5 import android.support.annotation.NonNull;
6 6 import android.support.v7.widget.LinearLayoutManager;
7 7 import android.support.v7.widget.RecyclerView;
  8 +import android.text.Editable;
  9 +import android.text.TextUtils;
  10 +import android.text.TextWatcher;
  11 +import android.util.Log;
8 12 import android.view.View;
  13 +import android.widget.EditText;
9 14 import android.widget.ImageView;
10 15 import android.widget.TextView;
11 16  
... ... @@ -41,12 +46,13 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity&lt;SchoolListContra
41 46  
42 47 private SideBar sideBar;
43 48 private TextView dialog, go_next, tvLocalAddress, center_title;
44   - ImageView back;
  49 + ImageView back, iv_search;
45 50 private RecyclerView schoollist;
46   - private List<String> list = new ArrayList<>();
  51 + private List<SchoolBean> currList = new ArrayList<>();
47 52 SchoolListAdapter schoolListAdapter;
48 53 int schoolId;
49 54 CityPicker cityPicker = null;
  55 + EditText et_search;
50 56  
51 57 @NonNull
52 58 @Override
... ... @@ -74,6 +80,10 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity&lt;SchoolListContra
74 80 tvLocalAddress.setText(AppContext.getInstance().district);
75 81 setSchoolList();
76 82  
  83 + et_search = findViewById(R.id.et_search);
  84 + iv_search = findViewById(R.id.iv_search);
  85 + iv_search.setOnClickListener(this);
  86 + et_search.addTextChangedListener(textWatcher);
77 87  
78 88 schoollist = findViewById(R.id.schoollist);
79 89 schoollist.setLayoutManager(new LinearLayoutManager(this));
... ... @@ -180,30 +190,56 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity&lt;SchoolListContra
180 190 if (null == cityPicker) cityPicker = new CityPicker(SelectSchoolActivity.this, this);
181 191 if (cityPicker.isShow()) cityPicker.close();
182 192 else cityPicker.show();
  193 + } else if (v == iv_search) {
  194 + setNewSchoolList(et_search.getText().toString().trim());
183 195 }
184 196  
185 197 }
186 198  
  199 + private void setNewSchoolList(String s) {
  200 + List<SchoolBean> list = new ArrayList<>();
  201 + if (!TextUtils.isEmpty(s)) {
  202 + for (int i = 0; i < currList.size(); i++) {
  203 + if (currList.get(i).school_name.contains(s)) {
  204 + list.add(currList.get(i));
  205 + }
  206 + }
  207 + showResult(list);
  208 + return;
  209 + }
  210 + showResult(currList);
  211 + }
  212 +
187 213  
188 214 @Override
189 215 public void showList(List<SchoolBean> list) {
  216 + currList.clear();
  217 + currList.addAll(list);
  218 + showResult(list);
  219 +
  220 + }
  221 +
  222 + void showResult(List<SchoolBean> list) {
190 223 final List<SortBean> schoolList = OrderedSortSmodel(list);
191   - if(schoolListAdapter==null){
192   - schoolListAdapter = new SchoolListAdapter(this, schoolList);
193   - schoolListAdapter.addAll(schoolList);
194   - schoollist.setAdapter(schoolListAdapter);
195   - }else{
  224 + if (schoolListAdapter == null) {
  225 + schoolListAdapter = new SchoolListAdapter(this, schoolList);
  226 + schoolListAdapter.addAll(schoolList);
  227 + schoollist.setAdapter(schoolListAdapter);
  228 + } else {
  229 +
196 230 schoolListAdapter.addAll(schoolList);
  231 + schoolListAdapter.setStart();
197 232 schoolListAdapter.notifyDataSetChanged();
198 233 }
199 234 }
200 235  
  236 +
201 237 @Override
202 238 public void showChild(CurrentBean currentBean) {
203 239 if (currentBean.isNew() == 0) {
204 240 startActivity(new Intent().putExtra("school_id", schoolId).setClass(SelectSchoolActivity.this, CheckInfoActivity.class));
205 241 } else {
206   - startActivity(new Intent().putExtra("school_id",schoolId).setClass(SelectSchoolActivity.this, InviteCodeActivity.class));
  242 + startActivity(new Intent().putExtra("school_id", schoolId).setClass(SelectSchoolActivity.this, InviteCodeActivity.class));
207 243 }
208 244 }
209 245  
... ... @@ -216,8 +252,27 @@ public class SelectSchoolActivity extends BaseMVPCompatActivity&lt;SchoolListContra
216 252 @Override
217 253 public void getCity(String name) {
218 254 tvLocalAddress.setText(name.split(" ")[2]);
219   - mPresenter.schoolListResult(name.split(" ")[2],"");
  255 + mPresenter.schoolListResult(name.split(" ")[2], "");
220 256  
221 257  
222 258 }
  259 +
  260 + TextWatcher textWatcher = new TextWatcher() {
  261 + @Override
  262 + public void beforeTextChanged(CharSequence s, int start, int count, int after) {
  263 +
  264 + }
  265 +
  266 + @Override
  267 + public void onTextChanged(CharSequence s, int start, int before, int count) {
  268 + setNewSchoolList(s.toString());
  269 + }
  270 +
  271 + @Override
  272 + public void afterTextChanged(Editable s) {
  273 +
  274 + }
  275 + };
  276 +
  277 +
223 278 }
... ...
app/src/main/java/com/shunzhi/parent/ui/activity/mywebview/WebViewActivity.java
... ... @@ -79,9 +79,8 @@ public class WebViewActivity extends BaseCompatActivity {
79 79 public void onClick(View v) {
80 80 if (type != -1 && type != AppConfig.ORDER_CENTER) {
81 81 startActivity(new Intent().setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP).setClass(WebViewActivity.this, MainActivity.class));
82   - } else {
83   - finish();
84 82 }
  83 + finish();
85 84 }
86 85 });
87 86  
... ... @@ -101,7 +100,6 @@ public class WebViewActivity extends BaseCompatActivity {
101 100 if (token != null && !"".equals(token) && !TextUtils.isEmpty(token)) {
102 101 url = url + "&Token=" + token;
103 102 }
104   -// Log.d("66666","url="+url);
105 103 if (type == AppConfig.BINDING_SUCCESS_HEZUO) {
106 104 binding_success.setVisibility(View.VISIBLE);
107 105 binding_success2.setVisibility(View.GONE);
... ...
app/src/main/java/com/shunzhi/parent/ui/fragment/MineFragment.java
... ... @@ -7,6 +7,7 @@ import android.os.Bundle;
7 7 import android.support.annotation.NonNull;
8 8 import android.support.annotation.Nullable;
9 9 import android.text.TextUtils;
  10 +import android.util.Log;
10 11 import android.view.View;
11 12 import android.widget.LinearLayout;
12 13 import android.widget.TextView;
... ... @@ -16,6 +17,7 @@ import com.makeramen.roundedimageview.RoundedImageView;
16 17 import com.share.mvpsdk.base.BasePresenter;
17 18 import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment;
18 19 import com.share.mvpsdk.utils.CacheUtils;
  20 +import com.share.mvpsdk.utils.ToastUtils;
19 21 import com.shunzhi.parent.AppConfig;
20 22 import com.shunzhi.parent.AppContext;
21 23 import com.shunzhi.parent.BuildConfig;
... ... @@ -102,9 +104,10 @@ public class MineFragment extends BaseMVPCompatFragment&lt;LoginAndRegisterContract
102 104 String useName = AppConfig.getAppConfig(getContext()).get(AppConfig.USER_NAME);
103 105 if (!TextUtils.isEmpty(useName)) AppConfig.ISLOGIN = true;
104 106 else AppConfig.ISLOGIN = false;
105   -
106   - if (!TextUtils.isEmpty(AppConfig.getAppConfig(getContext()).get(AppConfig.ISBINDING))) {
  107 + if (AppConfig.getAppConfig(getContext()).get(AppConfig.ISBINDING).equals("1")) {
107 108 binding_state.setText("");
  109 + } else {
  110 + binding_state.setText("未绑定");
108 111 }
109 112  
110 113 if (AppConfig.ISLOGIN) {
... ... @@ -156,11 +159,15 @@ public class MineFragment extends BaseMVPCompatFragment&lt;LoginAndRegisterContract
156 159 startNewActivity(OrderDetailActivity.class);
157 160 break;
158 161 case R.id.layout_order:
159   - Bundle bundle = new Bundle();
160   - bundle.putString("url", AppConfig.BASE_URL_ORDER + "ParentOrderCenter.aspx?userid=" +
161   - AppConfig.getAppConfig(getContext()).get(AppConfig.USER_ID));
162   - bundle.putInt("type", AppConfig.ORDER_CENTER);
163   - startNewActivity(WebViewActivity.class, bundle);
  162 + if (AppConfig.getAppConfig(getContext()).get(AppConfig.ISBINDING).equals("1")) {
  163 + Bundle bundle = new Bundle();
  164 + bundle.putString("url", AppConfig.BASE_URL_ORDER + "ParentOrderCenter.aspx?userid=" +
  165 + AppConfig.getAppConfig(getContext()).get(AppConfig.USER_ID));
  166 + bundle.putInt("type", AppConfig.ORDER_CENTER);
  167 + startNewActivity(WebViewActivity.class, bundle);
  168 + } else {
  169 + ToastUtils.showToast("请先绑定孩子");
  170 + }
164 171 break;
165 172 case R.id.tvExit:
166 173 clearUerinfo();
... ...
app/src/main/java/com/shunzhi/parent/ui/fragment/report/ChengZhangFragment.java
1 1 package com.shunzhi.parent.ui.fragment.report;
2 2  
  3 +import android.content.Intent;
3 4 import android.os.Bundle;
4 5 import android.os.Handler;
5 6 import android.os.Message;
... ... @@ -36,6 +37,7 @@ import com.shunzhi.parent.bean.ReportBean;
36 37 import com.shunzhi.parent.contract.report.ReportContract;
37 38 import com.shunzhi.parent.presenter.report.ReportPresenter;
38 39 import com.shunzhi.parent.ui.activity.BankActivity;
  40 +import com.shunzhi.parent.ui.activity.MyChildActivity;
39 41 import com.shunzhi.parent.ui.activity.apply.ApplyReplaceCardActivity;
40 42 import com.shunzhi.parent.ui.activity.apply.ApplySigninActivity;
41 43 import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity;
... ... @@ -184,7 +186,7 @@ public class ChengZhangFragment extends BaseMVPCompatFragment&lt;ReportContract.Rep
184 186  
185 187 @Override
186 188 public void onClick(View view) {
187   - if(showOrderPopu())
  189 + if (showOrderPopu())
188 190 return;
189 191 switch (view.getId()) {
190 192  
... ... @@ -244,7 +246,7 @@ public class ChengZhangFragment extends BaseMVPCompatFragment&lt;ReportContract.Rep
244 246 }
245 247  
246 248 if (TextUtils.isEmpty(childBean.getCardNumber())) {
247   - BankActivity.newInstance(getActivity(), "如果使用该应用,请前往激活孩子校园卡",childBean.getStudentName(),childBean.getStudentId(),0);
  249 + BankActivity.newInstance(getActivity(), "如果使用该应用,请前往激活孩子校园卡", childBean.getStudentName(), childBean.getStudentId(), 0);
248 250 return true;
249 251  
250 252 }
... ... @@ -297,6 +299,13 @@ public class ChengZhangFragment extends BaseMVPCompatFragment&lt;ReportContract.Rep
297 299 Spannable span = new SpannableString(text);
298 300 span.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.xueqing_blue)), 13, 22, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
299 301 tvNoData.setText(span);
  302 + tvNoData.setOnClickListener(new View.OnClickListener() {
  303 + @Override
  304 + public void onClick(View v) {
  305 + startActivity(new Intent().setClass(getActivity(), MyChildActivity.class));
  306 +// getActivity().finish();
  307 + }
  308 + });
300 309 }
301 310  
302 311 }
... ...
app/src/main/res/layout/activity_select_school.xml
1 1 <?xml version="1.0" encoding="utf-8"?>
2   -<LinearLayout
3   - xmlns:android="http://schemas.android.com/apk/res/android"
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
4 3 android:layout_width="match_parent"
5 4 android:layout_height="match_parent"
6 5 android:background="@color/white"
7   - android:orientation="vertical"
8   - >
  6 + android:orientation="vertical">
  7 +
  8 + <include layout="@layout/top" />
9 9  
10   - <include layout="@layout/top"/>
11 10 <LinearLayout
12 11 android:layout_width="match_parent"
13   - android:layout_height="wrap_content"
14   - >
  12 + android:layout_height="wrap_content">
  13 +
15 14 <TextView
16   - android:layout_marginBottom="10dp"
17   - android:layout_marginTop="10dp"
18 15 android:id="@+id/tvLocalAddress"
19 16 android:layout_width="wrap_content"
20 17 android:layout_height="wrap_content"
  18 + android:layout_marginBottom="10dp"
  19 + android:layout_marginTop="10dp"
21 20 android:drawablePadding="@dimen/size_dp_5"
22 21 android:drawableRight="@drawable/pull_black"
23 22 android:gravity="center"
... ... @@ -25,37 +24,39 @@
25 24 android:text="杭州"
26 25 android:textColor="@color/textColor"
27 26 android:textSize="@dimen/sp_16" />
  27 +
28 28 <LinearLayout
29 29 android:layout_width="wrap_content"
30   - android:layout_weight="1"
31 30 android:layout_height="wrap_content"
  31 + android:layout_gravity="center_vertical"
32 32 android:layout_marginRight="@dimen/size_dp_15"
33   - android:paddingTop="5dp"
34   - android:paddingBottom="5dp"
  33 + android:layout_weight="1"
35 34 android:background="@drawable/rudiobtn_gray"
36   - android:layout_gravity="center_vertical"
37   - >
  35 + android:paddingBottom="5dp"
  36 + android:paddingTop="5dp">
38 37  
39 38 <EditText
  39 + android:id="@+id/et_search"
40 40 android:layout_width="wrap_content"
41 41 android:layout_height="wrap_content"
42 42 android:layout_marginLeft="10dp"
43 43 android:layout_weight="1"
44   - android:hint="请输入搜索内容"
45   - android:textSize="@dimen/sp_16"
46   - android:gravity="center_horizontal"
47 44 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   - />
  45 + android:gravity="center_horizontal"
  46 + android:hint="请输入搜索内容"
  47 + android:textSize="@dimen/sp_16" />
  48 +
  49 + <ImageView
  50 + android:id="@+id/iv_search"
  51 + android:layout_width="40dp"
  52 + android:layout_height="match_parent"
  53 + android:layout_gravity="center_vertical"
  54 + android:layout_marginRight="15dp"
  55 + android:src="@drawable/search_black" />
56 56 </LinearLayout>
57 57  
58 58 </LinearLayout>
  59 +
59 60 <FrameLayout
60 61 android:layout_width="fill_parent"
61 62 android:layout_height="wrap_content"
... ... @@ -85,9 +86,9 @@
85 86 android:layout_width="30.0dip"
86 87 android:layout_height="fill_parent"
87 88 android:layout_gravity="right|center"
88   - android:background="#77dddddd"
89 89 android:layout_marginBottom="5dp"
90   - android:layout_marginTop="5dp" />
  90 + android:layout_marginTop="5dp"
  91 + android:background="#77dddddd" />
91 92  
92 93 </FrameLayout>
93 94  
... ... @@ -95,16 +96,14 @@
95 96 android:id="@+id/go_next"
96 97 android:layout_width="match_parent"
97 98 android:layout_height="40dp"
  99 + android:layout_marginBottom="10dp"
98 100 android:layout_marginLeft="10dp"
99 101 android:layout_marginRight="10dp"
  102 + android:background="@drawable/rudiobtn"
  103 + android:gravity="center"
100 104 android:text="下一步"
101 105 android:textColor="@color/white"
102   - android:textSize="@dimen/txtsize_title"
103   - android:gravity="center"
104   - android:background="@drawable/rudiobtn"
105   - android:layout_marginBottom="10dp"
106   - />
107   -
  106 + android:textSize="@dimen/txtsize_title" />
108 107  
109 108  
110 109 </LinearLayout>
111 110 \ No newline at end of file
... ...
app/src/main/res/layout/fragment_mine.xml
... ... @@ -30,6 +30,7 @@
30 30 android:textSize="@dimen/sp_18" />
31 31  
32 32 <LinearLayout
  33 + android:layout_marginTop="20dp"
33 34 android:id="@+id/personinfo"
34 35 android:layout_width="match_parent"
35 36 android:layout_height="wrap_content"
... ... @@ -73,8 +74,8 @@
73 74 </LinearLayout>
74 75  
75 76 <ImageView
76   - android:layout_width="30dp"
77   - android:layout_height="30dp"
  77 + android:layout_width="25dp"
  78 + android:layout_height="25dp"
78 79 android:layout_marginRight="20dp"
79 80 android:layout_gravity="center_vertical"
80 81 android:src="@drawable/arrow_right" />
... ...