Commit 6a9221532534d354b7900b7fe1a9063fb703adb8
Exists in
yxb_dev
and in
2 other branches
Merge branch 'yxb_dev' of http://git.shunzhi.net/taohd/parentwork into developer
Showing
13 changed files
with
121 additions
and
37 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/adapter/ChildAdapter.java
@@ -33,7 +33,7 @@ public class ChildAdapter extends BaseRecyclerViewAdapter<ChildBean> { | @@ -33,7 +33,7 @@ public class ChildAdapter extends BaseRecyclerViewAdapter<ChildBean> { | ||
33 | 33 | ||
34 | @Override | 34 | @Override |
35 | public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | 35 | public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { |
36 | - View view = LayoutInflater.from(context).inflate(R.layout.activity_web_view, null); | 36 | + View view = LayoutInflater.from(context).inflate(R.layout.item_childlist, null); |
37 | return new MyViewHolder(view); | 37 | return new MyViewHolder(view); |
38 | } | 38 | } |
39 | 39 |
app/src/main/java/com/shunzhi/parent/contract/loginandregister/LoginAndRegisterContract.java
app/src/main/java/com/shunzhi/parent/contract/mine/MyChildContract.java
@@ -41,7 +41,7 @@ public interface MyChildContract { | @@ -41,7 +41,7 @@ public interface MyChildContract { | ||
41 | 41 | ||
42 | interface IMyChildView extends IBaseActivity { | 42 | interface IMyChildView extends IBaseActivity { |
43 | void updateChildList(CurrentBean currentBean); | 43 | void updateChildList(CurrentBean currentBean); |
44 | - void addChildSuccess(); | 44 | + void addChildSuccess(String account,String password); |
45 | void showClass(List<ChildClass>list); | 45 | void showClass(List<ChildClass>list); |
46 | void showError(String error); | 46 | void showError(String error); |
47 | 47 |
app/src/main/java/com/shunzhi/parent/presenter/loginandregister/LoginAndRegisterPresenter.java
@@ -17,11 +17,15 @@ import com.shunzhi.parent.model.loginandregister.LoginAndRegisterModel; | @@ -17,11 +17,15 @@ import com.shunzhi.parent.model.loginandregister.LoginAndRegisterModel; | ||
17 | import com.shunzhi.parent.ui.fragment.loginandregistfragment.LoginAndRegistFragment; | 17 | import com.shunzhi.parent.ui.fragment.loginandregistfragment.LoginAndRegistFragment; |
18 | import com.shunzhi.parent.util.Utils; | 18 | import com.shunzhi.parent.util.Utils; |
19 | 19 | ||
20 | +import org.json.JSONObject; | ||
21 | + | ||
20 | import java.util.regex.Matcher; | 22 | import java.util.regex.Matcher; |
21 | import java.util.regex.Pattern; | 23 | import java.util.regex.Pattern; |
22 | 24 | ||
23 | import io.reactivex.functions.Consumer; | 25 | import io.reactivex.functions.Consumer; |
26 | +import okhttp3.ResponseBody; | ||
24 | import retrofit2.HttpException; | 27 | import retrofit2.HttpException; |
28 | +import retrofit2.Response; | ||
25 | import timber.log.Timber; | 29 | import timber.log.Timber; |
26 | 30 | ||
27 | /** | 31 | /** |
@@ -35,7 +39,8 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -35,7 +39,8 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
35 | @Override | 39 | @Override |
36 | public void loginResult(final String loginName, final String loginPwd) { | 40 | public void loginResult(final String loginName, final String loginPwd) { |
37 | if (!isMate(loginName, REGEX_MOBILE)) { | 41 | if (!isMate(loginName, REGEX_MOBILE)) { |
38 | - ToastUtils.showToast("请输入正确的手机号!!"); | 42 | + |
43 | + mIView.showerror("请输入正确的手机号!!"); | ||
39 | return; | 44 | return; |
40 | } | 45 | } |
41 | 46 | ||
@@ -64,9 +69,21 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -64,9 +69,21 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
64 | }, new Consumer<Throwable>() { | 69 | }, new Consumer<Throwable>() { |
65 | @Override | 70 | @Override |
66 | public void accept(Throwable throwable) throws Exception { | 71 | public void accept(Throwable throwable) throws Exception { |
67 | - if (null != throwable) | ||
68 | - OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | ||
69 | -// ToastUtils.showToast(throwable.getMessage()); | 72 | + Response response = ((HttpException)throwable).response(); |
73 | + if (response==null)return; | ||
74 | + ResponseBody responseBody = response.errorBody(); | ||
75 | + if (responseBody==null)return; | ||
76 | + try { | ||
77 | + JSONObject json = new JSONObject(responseBody.string()); | ||
78 | +// ToastUtils.showToast(json.optString("message")+"json="+json); | ||
79 | + if(TextUtils.isEmpty(json.optString("error"))){ | ||
80 | + mIView.showerror(json.optString("message")); | ||
81 | + return; | ||
82 | + } | ||
83 | + mIView.showerror(json.optString("error")); | ||
84 | + } catch (Exception e1) { | ||
85 | + e1.printStackTrace(); | ||
86 | + } | ||
70 | } | 87 | } |
71 | })); | 88 | })); |
72 | 89 | ||
@@ -95,8 +112,17 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -95,8 +112,17 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
95 | }, new Consumer<Throwable>() { | 112 | }, new Consumer<Throwable>() { |
96 | @Override | 113 | @Override |
97 | public void accept(Throwable throwable) throws Exception { | 114 | public void accept(Throwable throwable) throws Exception { |
98 | - LoginAndRegistFragment.progressDialog.dismiss(); | ||
99 | - OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | 115 | + Response response = ((HttpException)throwable).response(); |
116 | + if (response==null)return; | ||
117 | + ResponseBody responseBody = response.errorBody(); | ||
118 | + if (responseBody==null)return; | ||
119 | + try { | ||
120 | + JSONObject json = new JSONObject(responseBody.string()); | ||
121 | +// ToastUtils.showToast(json.optString("message")+"json="+json); | ||
122 | + mIView.showerror(json.optString("message")); | ||
123 | + } catch (Exception e1) { | ||
124 | + e1.printStackTrace(); | ||
125 | + } | ||
100 | } | 126 | } |
101 | })); | 127 | })); |
102 | 128 | ||
@@ -160,8 +186,19 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | @@ -160,8 +186,19 @@ public class LoginAndRegisterPresenter extends LoginAndRegisterContract.LoginPre | ||
160 | }, new Consumer<Throwable>() { | 186 | }, new Consumer<Throwable>() { |
161 | @Override | 187 | @Override |
162 | public void accept(Throwable throwable) throws Exception { | 188 | public void accept(Throwable throwable) throws Exception { |
163 | - LoginAndRegistFragment.progressDialog.dismiss(); | ||
164 | - OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | 189 | + Response response = ((HttpException)throwable).response(); |
190 | + if (response==null)return; | ||
191 | + ResponseBody responseBody = response.errorBody(); | ||
192 | + if (responseBody==null)return; | ||
193 | + try { | ||
194 | + JSONObject json = new JSONObject(responseBody.string()); | ||
195 | +// ToastUtils.showToast(json.optString("message")+"json="+json); | ||
196 | + mIView.showerror(json.optString("message")); | ||
197 | + } catch (Exception e1) { | ||
198 | + e1.printStackTrace(); | ||
199 | + } | ||
200 | + | ||
201 | +// OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | ||
165 | } | 202 | } |
166 | })); | 203 | })); |
167 | } | 204 | } |
app/src/main/java/com/shunzhi/parent/presenter/mine/MyChildPresenter.java
1 | package com.shunzhi.parent.presenter.mine; | 1 | package com.shunzhi.parent.presenter.mine; |
2 | 2 | ||
3 | +import android.util.Log; | ||
4 | + | ||
3 | import com.google.gson.JsonObject; | 5 | import com.google.gson.JsonObject; |
4 | import com.share.mvpsdk.utils.OkHttpExceptionUtil; | 6 | import com.share.mvpsdk.utils.OkHttpExceptionUtil; |
5 | import com.share.mvpsdk.utils.ToastUtils; | 7 | import com.share.mvpsdk.utils.ToastUtils; |
@@ -47,14 +49,14 @@ public class MyChildPresenter extends MyChildContract.MyChildPresenter { | @@ -47,14 +49,14 @@ public class MyChildPresenter extends MyChildContract.MyChildPresenter { | ||
47 | }, new Consumer<Throwable>() { | 49 | }, new Consumer<Throwable>() { |
48 | @Override | 50 | @Override |
49 | public void accept(Throwable throwable) throws Exception { | 51 | public void accept(Throwable throwable) throws Exception { |
50 | - Response response = ((HttpException)throwable).response(); | ||
51 | - if (response==null)return; | 52 | + Response response = ((HttpException) throwable).response(); |
53 | + if (response == null) return; | ||
52 | ResponseBody responseBody = response.errorBody(); | 54 | ResponseBody responseBody = response.errorBody(); |
53 | - if (responseBody==null)return; | 55 | + if (responseBody == null) return; |
54 | try { | 56 | try { |
55 | JSONObject json = new JSONObject(responseBody.string()); | 57 | JSONObject json = new JSONObject(responseBody.string()); |
56 | mIView.showError(json.optString("message")); | 58 | mIView.showError(json.optString("message")); |
57 | - } catch (Exception e1) { | 59 | + } catch (Exception e1) { |
58 | e1.printStackTrace(); | 60 | e1.printStackTrace(); |
59 | } | 61 | } |
60 | 62 | ||
@@ -64,12 +66,19 @@ public class MyChildPresenter extends MyChildContract.MyChildPresenter { | @@ -64,12 +66,19 @@ public class MyChildPresenter extends MyChildContract.MyChildPresenter { | ||
64 | } | 66 | } |
65 | 67 | ||
66 | @Override | 68 | @Override |
67 | - public void addChild( int sex , String studentName,int parentId, boolean mobileFlag, boolean cooperateFlag, int schoolId, int classId, int studentId, String studentUserId) { | ||
68 | - mRxManager.register(mIModel.addChildResult(sex,studentName,parentId, mobileFlag, cooperateFlag, schoolId, classId, studentId, studentUserId).subscribe(new Consumer<JsonObject>() { | 69 | + public void addChild(int sex, String studentName, int parentId, boolean mobileFlag, boolean cooperateFlag, int schoolId, int classId, int studentId, String studentUserId) { |
70 | + mRxManager.register(mIModel.addChildResult(sex, studentName, parentId, mobileFlag, cooperateFlag, schoolId, classId, studentId, studentUserId).subscribe(new Consumer<JsonObject>() { | ||
69 | @Override | 71 | @Override |
70 | public void accept(JsonObject jsonObject) throws Exception { | 72 | public void accept(JsonObject jsonObject) throws Exception { |
71 | ToastUtils.showToast("绑定孩子成功"); | 73 | ToastUtils.showToast("绑定孩子成功"); |
72 | - mIView.addChildSuccess(); | 74 | + Log.e("asdasda", jsonObject.get("data").toString()); |
75 | + if (jsonObject.get("data").toString().equals("null")) { | ||
76 | + mIView.addChildSuccess("", ""); | ||
77 | + } else { | ||
78 | + JsonObject data = jsonObject.getAsJsonObject("data"); | ||
79 | + mIView.addChildSuccess(data.get("account").getAsString(), data.get("password").getAsString()); | ||
80 | + } | ||
81 | + | ||
73 | } | 82 | } |
74 | }, new Consumer<Throwable>() { | 83 | }, new Consumer<Throwable>() { |
75 | @Override | 84 | @Override |
app/src/main/java/com/shunzhi/parent/ui/activity/MyChildActivity.java
@@ -146,7 +146,7 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | @@ -146,7 +146,7 @@ public class MyChildActivity extends BaseMVPCompatActivity<MyChildContract.MyChi | ||
146 | } | 146 | } |
147 | 147 | ||
148 | @Override | 148 | @Override |
149 | - public void addChildSuccess() { | 149 | + public void addChildSuccess(String account,String password) { |
150 | 150 | ||
151 | } | 151 | } |
152 | 152 |
app/src/main/java/com/shunzhi/parent/ui/activity/binding/CheckInfoActivity.java
@@ -151,10 +151,10 @@ public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyC | @@ -151,10 +151,10 @@ public class CheckInfoActivity extends BaseMVPCompatActivity<MyChildContract.MyC | ||
151 | } | 151 | } |
152 | 152 | ||
153 | @Override | 153 | @Override |
154 | - public void addChildSuccess() { | 154 | + public void addChildSuccess(String account,String password) { |
155 | // WebViewActivity.start_show(CheckInfoActivity.this,AppConfig.BINDING_SUCCESS_HEZUO); | 155 | // WebViewActivity.start_show(CheckInfoActivity.this,AppConfig.BINDING_SUCCESS_HEZUO); |
156 | WebViewActivity.getInstance(CheckInfoActivity.this, | 156 | WebViewActivity.getInstance(CheckInfoActivity.this, |
157 | - AppConfig.BASE_URL_ORDER+"/ParentOrderCenter.aspx?userid="+ | 157 | + AppConfig.BASE_URL_ORDER+"/RecommendOrder.aspx?userid="+ |
158 | AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_ID),AppConfig.BINDING_SUCCESS_HEZUO); | 158 | AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_ID),AppConfig.BINDING_SUCCESS_HEZUO); |
159 | finish(); | 159 | finish(); |
160 | 160 |
app/src/main/java/com/shunzhi/parent/ui/activity/binding/CreateChildInfoActivity.java
@@ -132,8 +132,9 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | @@ -132,8 +132,9 @@ public class CreateChildInfoActivity extends BaseMVPCompatActivity<MyChildContra | ||
132 | } | 132 | } |
133 | 133 | ||
134 | @Override | 134 | @Override |
135 | - public void addChildSuccess() { | ||
136 | - WebViewActivity.getInstance(CreateChildInfoActivity.this,AppConfig.BASE_URL_ORDER+"/ParentOrderCenter.aspx?userid="+AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_ID),AppConfig.BINDING_SUCCESS_NOT); | 135 | + public void addChildSuccess(String account,String password) { |
136 | + WebViewActivity.startShow(CreateChildInfoActivity.this,AppConfig.BASE_URL_ORDER+"/RecommendOrder.aspx?userid="+ | ||
137 | + AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_ID),AppConfig.BINDING_SUCCESS_NOT,account,password,child_name.getText().toString()); | ||
137 | finish(); | 138 | finish(); |
138 | } | 139 | } |
139 | 140 |
app/src/main/java/com/shunzhi/parent/ui/activity/mywebview/WebViewActivity.java
@@ -22,13 +22,14 @@ import com.share.mvpsdk.utils.NetworkConnectionUtils; | @@ -22,13 +22,14 @@ import com.share.mvpsdk.utils.NetworkConnectionUtils; | ||
22 | import com.share.mvpsdk.widgets.NestedScrollWebView; | 22 | import com.share.mvpsdk.widgets.NestedScrollWebView; |
23 | import com.shunzhi.parent.AppConfig; | 23 | import com.shunzhi.parent.AppConfig; |
24 | import com.shunzhi.parent.R; | 24 | import com.shunzhi.parent.R; |
25 | +import com.shunzhi.parent.ui.MainActivity; | ||
25 | 26 | ||
26 | public class WebViewActivity extends BaseCompatActivity { | 27 | public class WebViewActivity extends BaseCompatActivity { |
27 | 28 | ||
28 | NestedScrollWebView nesteScrollWebView; | 29 | NestedScrollWebView nesteScrollWebView; |
29 | LinearLayout binding_success, binding_success2; | 30 | LinearLayout binding_success, binding_success2; |
30 | ImageView close_btn; | 31 | ImageView close_btn; |
31 | - TextView tv_info,zuoye,title_web; | 32 | + TextView tv_info, zuoye, title_web; |
32 | 33 | ||
33 | int type; | 34 | int type; |
34 | 35 | ||
@@ -41,14 +42,25 @@ public class WebViewActivity extends BaseCompatActivity { | @@ -41,14 +42,25 @@ public class WebViewActivity extends BaseCompatActivity { | ||
41 | context.startActivity(intent); | 42 | context.startActivity(intent); |
42 | } | 43 | } |
43 | 44 | ||
45 | + public static void startShow(Context context, String url, int type, String account, String password, String name) { | ||
46 | + Intent intent = new Intent(context, WebViewActivity.class); | ||
47 | + intent.putExtra("url", url); | ||
48 | + intent.putExtra("type", type); | ||
49 | + intent.putExtra("account", account); | ||
50 | + intent.putExtra("password", password); | ||
51 | + intent.putExtra("name", name); | ||
52 | + context.startActivity(intent); | ||
53 | + } | ||
54 | + | ||
55 | + | ||
44 | @Override | 56 | @Override |
45 | protected void initView(Bundle savedInstanceState) { | 57 | protected void initView(Bundle savedInstanceState) { |
46 | 58 | ||
47 | - binding_success=findViewById(R.id.binding_success); | 59 | + binding_success = findViewById(R.id.binding_success); |
48 | 60 | ||
49 | - binding_success=findViewById(R.id.binding_success1); | 61 | + binding_success = findViewById(R.id.binding_success1); |
50 | 62 | ||
51 | - binding_success2=findViewById(R.id.binding_success2); | 63 | + binding_success2 = findViewById(R.id.binding_success2); |
52 | close_btn = findViewById(R.id.close_btn); | 64 | close_btn = findViewById(R.id.close_btn); |
53 | tv_info = findViewById(R.id.tv_info); | 65 | tv_info = findViewById(R.id.tv_info); |
54 | zuoye = findViewById(R.id.zuoye); | 66 | zuoye = findViewById(R.id.zuoye); |
@@ -78,13 +90,18 @@ public class WebViewActivity extends BaseCompatActivity { | @@ -78,13 +90,18 @@ public class WebViewActivity extends BaseCompatActivity { | ||
78 | binding_success.setVisibility(View.GONE); | 90 | binding_success.setVisibility(View.GONE); |
79 | binding_success2.setVisibility(View.VISIBLE); | 91 | binding_success2.setVisibility(View.VISIBLE); |
80 | title_web.setVisibility(View.GONE); | 92 | title_web.setVisibility(View.GONE); |
93 | + String account = getIntent().getStringExtra("account"); | ||
94 | + String name = getIntent().getStringExtra("name"); | ||
95 | + String password = getIntent().getStringExtra("password"); | ||
96 | + | ||
97 | + tv_info.setText("生成孩子“" + name + "”账号为:" + account + ",初始密码为:" + password + "(与账号相同)。孩子可以下载“汇作业”app进行使用"); | ||
81 | 98 | ||
82 | } else if (type == AppConfig.ORDER_CENTER) { | 99 | } else if (type == AppConfig.ORDER_CENTER) { |
83 | binding_success.setVisibility(View.GONE); | 100 | binding_success.setVisibility(View.GONE); |
84 | binding_success2.setVisibility(View.GONE); | 101 | binding_success2.setVisibility(View.GONE); |
85 | title_web.setVisibility(View.VISIBLE); | 102 | title_web.setVisibility(View.VISIBLE); |
86 | 103 | ||
87 | - }else { | 104 | + } else { |
88 | binding_success.setVisibility(View.GONE); | 105 | binding_success.setVisibility(View.GONE); |
89 | binding_success2.setVisibility(View.GONE); | 106 | binding_success2.setVisibility(View.GONE); |
90 | title_web.setVisibility(View.GONE); | 107 | title_web.setVisibility(View.GONE); |
@@ -107,6 +124,7 @@ public class WebViewActivity extends BaseCompatActivity { | @@ -107,6 +124,7 @@ public class WebViewActivity extends BaseCompatActivity { | ||
107 | nesteScrollWebView.goBack(); | 124 | nesteScrollWebView.goBack(); |
108 | } else { | 125 | } else { |
109 | super.onBackPressedSupport(); | 126 | super.onBackPressedSupport(); |
127 | + startActivity(new Intent().setClass(this, MainActivity.class)); | ||
110 | } | 128 | } |
111 | } | 129 | } |
112 | 130 | ||
@@ -130,6 +148,7 @@ public class WebViewActivity extends BaseCompatActivity { | @@ -130,6 +148,7 @@ public class WebViewActivity extends BaseCompatActivity { | ||
130 | }); | 148 | }); |
131 | } | 149 | } |
132 | } | 150 | } |
151 | + | ||
133 | // 调起支付宝并跳转到指定页面 | 152 | // 调起支付宝并跳转到指定页面 |
134 | private void startAlipayActivity(String url) { | 153 | private void startAlipayActivity(String url) { |
135 | Intent intent; | 154 | Intent intent; |
@@ -152,8 +171,8 @@ public class WebViewActivity extends BaseCompatActivity { | @@ -152,8 +171,8 @@ public class WebViewActivity extends BaseCompatActivity { | ||
152 | nesteScrollWebView.setWebViewClient(new WebViewClient() { | 171 | nesteScrollWebView.setWebViewClient(new WebViewClient() { |
153 | @Override | 172 | @Override |
154 | public boolean shouldOverrideUrlLoading(WebView view, String url) { | 173 | public boolean shouldOverrideUrlLoading(WebView view, String url) { |
155 | - Log.d("666666","url="+url); | ||
156 | - if (url.startsWith("http"))view.loadUrl(url); | 174 | + Log.d("666666", "url=" + url); |
175 | + if (url.startsWith("http")) view.loadUrl(url); | ||
157 | // if (url.contains("platformapi/startapp")) { | 176 | // if (url.contains("platformapi/startapp")) { |
158 | // startAlipayActivity(url); | 177 | // startAlipayActivity(url); |
159 | // android 6.0 两种方式获取intent都可以跳转支付宝成功,7.1测试不成功 | 178 | // android 6.0 两种方式获取intent都可以跳转支付宝成功,7.1测试不成功 |
@@ -174,6 +193,13 @@ public class WebViewActivity extends BaseCompatActivity { | @@ -174,6 +193,13 @@ public class WebViewActivity extends BaseCompatActivity { | ||
174 | // html加载完成之后,添加监听图片的点击js函数 | 193 | // html加载完成之后,添加监听图片的点击js函数 |
175 | addWebImageClickListner(view); | 194 | addWebImageClickListner(view); |
176 | // toolbar.setTitle(getToolbarTitle()); | 195 | // toolbar.setTitle(getToolbarTitle()); |
196 | + if (nesteScrollWebView.canGoBack()) { | ||
197 | + binding_success.setVisibility(View.GONE); | ||
198 | + binding_success2.setVisibility(View.GONE); | ||
199 | + title_web.setVisibility(View.GONE); | ||
200 | + } else { | ||
201 | + | ||
202 | + } | ||
177 | } | 203 | } |
178 | 204 | ||
179 | @Override | 205 | @Override |
@@ -212,7 +238,6 @@ public class WebViewActivity extends BaseCompatActivity { | @@ -212,7 +238,6 @@ public class WebViewActivity extends BaseCompatActivity { | ||
212 | } | 238 | } |
213 | } | 239 | } |
214 | }); | 240 | }); |
215 | - | ||
216 | nesteScrollWebView.setOnLongClickListener(new View.OnLongClickListener() { | 241 | nesteScrollWebView.setOnLongClickListener(new View.OnLongClickListener() { |
217 | @Override | 242 | @Override |
218 | public boolean onLongClick(View v) { | 243 | public boolean onLongClick(View v) { |
@@ -231,6 +256,8 @@ public class WebViewActivity extends BaseCompatActivity { | @@ -231,6 +256,8 @@ public class WebViewActivity extends BaseCompatActivity { | ||
231 | } | 256 | } |
232 | 257 | ||
233 | 258 | ||
259 | + | ||
260 | + | ||
234 | /** | 261 | /** |
235 | * 初始化WebSetting | 262 | * 初始化WebSetting |
236 | * | 263 | * |
app/src/main/java/com/shunzhi/parent/ui/fragment/loginandregistfragment/LoginAndRegistFragment.java
@@ -179,6 +179,12 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | @@ -179,6 +179,12 @@ public class LoginAndRegistFragment extends BaseMVPCompatFragment<LoginAndRegist | ||
179 | } | 179 | } |
180 | 180 | ||
181 | @Override | 181 | @Override |
182 | + public void showerror(String error) { | ||
183 | + progressDialog.dismiss(); | ||
184 | + ToastUtils.showToast(error); | ||
185 | + } | ||
186 | + | ||
187 | + @Override | ||
182 | public void onClick(View v) { | 188 | public void onClick(View v) { |
183 | if (v == loginAndRegister) { | 189 | if (v == loginAndRegister) { |
184 | progressDialog.show(); | 190 | progressDialog.show(); |
app/src/main/res/drawable/rudiobtn_unclick.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"> | 2 | <shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"> |
3 | <stroke android:color="#00000000" android:width="1dp"/> | 3 | <stroke android:color="#00000000" android:width="1dp"/> |
4 | - <solid android:color="@color/xueqing_blue" /> | 4 | + <solid android:color="@color/bottomline" /> |
5 | <corners android:radius="5dp"/> | 5 | <corners android:radius="5dp"/> |
6 | </shape> | 6 | </shape> |
7 | \ No newline at end of file | 7 | \ No newline at end of file |
app/src/main/res/layout/activity_webview.xml
@@ -12,12 +12,14 @@ | @@ -12,12 +12,14 @@ | ||
12 | > | 12 | > |
13 | <ImageView | 13 | <ImageView |
14 | android:id="@+id/close_btn" | 14 | android:id="@+id/close_btn" |
15 | - android:layout_width="30dp" | ||
16 | - android:layout_height="30dp" | ||
17 | - android:layout_marginLeft="10dp" | ||
18 | - android:layout_centerVertical="true" | ||
19 | - android:background="@drawable/close" | ||
20 | - /> | 15 | + android:layout_width="wrap_content" |
16 | + android:layout_height="match_parent" | ||
17 | + android:gravity="center" | ||
18 | + android:paddingLeft="@dimen/size_dp_15" | ||
19 | + android:src="@drawable/back" | ||
20 | + android:paddingRight="@dimen/size_dp_15" | ||
21 | + android:textColor="@color/textColor" | ||
22 | + android:textSize="@dimen/textSize16" /> | ||
21 | <TextView | 23 | <TextView |
22 | android:id="@+id/title_web" | 24 | android:id="@+id/title_web" |
23 | android:layout_width="wrap_content" | 25 | android:layout_width="wrap_content" |
app/src/main/res/layout/fragment_login_and_regist.xml
@@ -200,6 +200,7 @@ | @@ -200,6 +200,7 @@ | ||
200 | android:layout_height="wrap_content" | 200 | android:layout_height="wrap_content" |
201 | android:layout_marginTop="40dp" | 201 | android:layout_marginTop="40dp" |
202 | android:background="@drawable/rudiobtn_unclick" | 202 | android:background="@drawable/rudiobtn_unclick" |
203 | + android:enabled="false" | ||
203 | android:gravity="center" | 204 | android:gravity="center" |
204 | android:paddingBottom="10dp" | 205 | android:paddingBottom="10dp" |
205 | android:paddingTop="10dp" | 206 | android:paddingTop="10dp" |