From 70904e2f5336cbaf50be1a26c7992ea57505219d Mon Sep 17 00:00:00 2001 From: XinYiWorld <1349308479@qq.com> Date: Tue, 18 Apr 2017 11:49:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=AE=E7=AE=B1=E6=A0=A1=E9=AA=8C=E6=AD=A3?= =?UTF-8?q?=E5=88=99=E8=A1=A8=E8=BE=BE=E5=BC=8Fbug=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/misc.xml | 2 +- .../xinyi/czbasedevtool/base/utils/RegularUtil.java | 4 ++-- app/src/main/java/xinyi/com/czdevmodule/Fragment1.java | 10 +++------- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 5d19981..fbb6828 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,7 +37,7 @@ - + diff --git a/CZBaseDevTool/src/main/java/com/xinyi/czbasedevtool/base/utils/RegularUtil.java b/CZBaseDevTool/src/main/java/com/xinyi/czbasedevtool/base/utils/RegularUtil.java index efd0f31..8b74003 100644 --- a/CZBaseDevTool/src/main/java/com/xinyi/czbasedevtool/base/utils/RegularUtil.java +++ b/CZBaseDevTool/src/main/java/com/xinyi/czbasedevtool/base/utils/RegularUtil.java @@ -18,9 +18,9 @@ public static boolean isNumeric(String str){ } public static boolean isEmail(String email){ - return check(email,"/^(\\w)+(\\.\\w+)*@(\\w)+((\\.\\w+)+)$/"); + return check(email,"^([a-z0-9A-Z]+[-|_|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"); } - + public static boolean check(String input ,String reg){ Pattern pattern = Pattern.compile(reg); Matcher isNum = pattern.matcher(input); diff --git a/app/src/main/java/xinyi/com/czdevmodule/Fragment1.java b/app/src/main/java/xinyi/com/czdevmodule/Fragment1.java index b7dae39..16c0fe8 100644 --- a/app/src/main/java/xinyi/com/czdevmodule/Fragment1.java +++ b/app/src/main/java/xinyi/com/czdevmodule/Fragment1.java @@ -8,14 +8,13 @@ import com.xinyi.czbasedevtool.base.bean.BaseHttpResponseBean; import com.xinyi.czbasedevtool.base.main.DefaultBaseFragment; import com.xinyi.czbasedevtool.base.manager.DataCleanManager; -import com.xinyi.czbasedevtool.base.manager.net_about.RetrofitClient; +import com.xinyi.czbasedevtool.base.utils.RegularUtil; +import com.xinyi.czbasedevtool.base.utils.ToastUtil; import com.xinyi.czbasedevtool.base.view.ContentViewHolder; import com.xinyi.czbasedevtool.base.view.round.RoundTextView; import java.io.IOException; -import xinyi.com.czdevmodule.net_test.SimpleRequestService; -import xinyi.com.czdevmodule.net_test.retrofit.DegreeBean; import xinyi.com.czdevmodule.net_test.retrofit.UserBean; import xinyi.com.czdevmodule.net_test.retrofit.callback.IUserRegistCallBack; import xinyi.com.czdevmodule.net_test.retrofit.service.UserService; @@ -65,10 +64,7 @@ public void bindView(ContentViewHolder contentViewHolder) throws IOException { roundTextView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - String BASE_URL = "http://app.bestbeijing.top/"; - RetrofitClient.setHasToken(true); - RetrofitClient.setBaseUrl(BASE_URL); - requestData(v,100, SimpleRequestService.class,"getDegreeList",DegreeBean.class,new Object[]{"fdsaf"},true); + ToastUtil.shortT(mContext, "" + RegularUtil.isEmail("3149308479@qq.com")); } });