From 10b597d55d50beadba0e60e308a1e22b161b6c40 Mon Sep 17 00:00:00 2001
From: ongbo <1308161085@qq.com>
Date: Mon, 6 Jan 2020 16:27:58 +0800
Subject: [PATCH] UPDATE 1
---
app/app.iml | 7 +
app/build.gradle | 15 +-
app/src/main/AndroidManifest.xml | 1 +
.../Login_Register/LoginActivity.java | 83 +++++--
.../Login_Register/RegisterActivity.java | 204 ++++++++++++++++++
.../java/com/example/Util/ConditionCode.java | 13 ++
.../com/example/Util/RequestBody/user.java | 88 ++++++++
.../main/java/com/example/Util/ToolTip.java | 41 ++++
.../com/example/Util/cmkgWebServicePost.java | 114 ++++++++++
.../com/example/Util/publicStringUtil.java | 12 +-
app/src/main/res/drawable/boy.png | Bin 0 -> 7212 bytes
app/src/main/res/drawable/girl.png | Bin 0 -> 6515 bytes
.../main/res/drawable/ic_action_accept.png | Bin 0 -> 401 bytes
.../main/res/drawable/ic_action_cancel.png | Bin 0 -> 353 bytes
app/src/main/res/drawable/ic_call_filled.png | Bin 0 -> 821 bytes
app/src/main/res/drawable/ic_lockopen.png | Bin 0 -> 1166 bytes
app/src/main/res/drawable/ic_profile.png | Bin 0 -> 1694 bytes
app/src/main/res/drawable/text_bg.xml | 2 +-
app/src/main/res/layout/activity_login.xml | 29 ++-
app/src/main/res/layout/activity_register.xml | 201 +++++++++++------
app/src/main/res/layout/input_layout.xml | 8 +
.../main/res/layout/input_layout_register.xml | 110 ++++++++++
app/src/main/res/layout/title_layout.xml | 28 +--
app/src/main/res/values/strings.xml | 1 +
24 files changed, 851 insertions(+), 106 deletions(-)
create mode 100644 app/src/main/java/com/example/PersonalCenter/Login_Register/RegisterActivity.java
create mode 100644 app/src/main/java/com/example/Util/RequestBody/user.java
create mode 100644 app/src/main/java/com/example/Util/ToolTip.java
create mode 100644 app/src/main/java/com/example/Util/cmkgWebServicePost.java
create mode 100644 app/src/main/res/drawable/boy.png
create mode 100644 app/src/main/res/drawable/girl.png
create mode 100644 app/src/main/res/drawable/ic_action_accept.png
create mode 100644 app/src/main/res/drawable/ic_action_cancel.png
create mode 100644 app/src/main/res/drawable/ic_call_filled.png
create mode 100644 app/src/main/res/drawable/ic_lockopen.png
create mode 100644 app/src/main/res/drawable/ic_profile.png
create mode 100644 app/src/main/res/layout/input_layout_register.xml
diff --git a/app/app.iml b/app/app.iml
index 9273a94..5903ae2 100644
--- a/app/app.iml
+++ b/app/app.iml
@@ -110,8 +110,12 @@
+
+
+
+
@@ -142,5 +146,8 @@
+
+
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index e358269..054d415 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -5,7 +5,7 @@ android {
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.cmknowledgegraph"
- minSdkVersion 15
+ minSdkVersion 18
targetSdkVersion 29
versionCode 1
versionName "1.0"
@@ -25,7 +25,10 @@ android {
exclude 'com/mysql/cj/configurations/3-0-Compat.properties'
}
}
+repositories {
+ maven { url "https://jitpack.io" }
+}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
@@ -39,4 +42,14 @@ dependencies {
implementation 'com.alibaba:fastjson:1.2.62'
implementation 'com.loopeer.library:cardstack:1.0.2'
implementation 'androidx.cardview:cardview:1.0.0'
+//进度条按钮
+ implementation 'com.github.dmytrodanylyk.circular-progress-button:library:1.1.3'
+ implementation 'com.hanks.animatecheckbox:library:0.1'
+//对话框
+ implementation 'com.github.johnpersano:supertoasts:2.0'
+
+// 城市选择器
+ implementation 'liji.library.dev:citypickerview:5.1.0'
+ implementation 'cn.aigestudio.wheelpicker:WheelPicker:1.1.3'
+ implementation 'com.github.open-android:WheelPicker:v1.0.0'
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 0e91255..41ff7cc 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -16,6 +16,7 @@
android:theme="@style/AppTheme">
+
diff --git a/app/src/main/java/com/example/PersonalCenter/Login_Register/LoginActivity.java b/app/src/main/java/com/example/PersonalCenter/Login_Register/LoginActivity.java
index 46b432c..9a66ba1 100644
--- a/app/src/main/java/com/example/PersonalCenter/Login_Register/LoginActivity.java
+++ b/app/src/main/java/com/example/PersonalCenter/Login_Register/LoginActivity.java
@@ -5,6 +5,8 @@ import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.animation.ValueAnimator;
+import android.content.Intent;
+import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
@@ -24,17 +26,25 @@ import androidx.appcompat.app.AppCompatActivity;
import com.example.PersonalCenter.JellyInterpolator;
+import com.example.Util.ConditionCode;
import com.example.Util.ReturnData;
+import com.example.Util.ToolTip;
import com.example.Util.User;
import com.example.Util.cmkgWebServiceGet;
import com.example.Util.publicStringUtil;
import com.example.cmknowledgegraph.R;
+import com.github.johnpersano.supertoasts.library.Style;
+import com.github.johnpersano.supertoasts.library.SuperActivityToast;
+import com.github.johnpersano.supertoasts.library.SuperToast;
+import com.github.johnpersano.supertoasts.library.utils.PaletteUtils;
import java.lang.ref.WeakReference;
public class LoginActivity extends AppCompatActivity implements View.OnClickListener {
private TextView mBtnLogin;
+ private TextView getmBtnRegister;
+ AnimatorSet animatorSet;
private View progress;
private View mInputLayout;
private float mWidth, mHeight;
@@ -54,17 +64,37 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
LoginActivity loginActivity = (LoginActivity) weakReference.get();
Bundle bundle = msg.getData();
ReturnData messageJSON = (ReturnData) bundle.getSerializable("msg");
+ if(messageJSON.getCode() == ConditionCode.loginsucess) {
+ weakReference.get().mName.setVisibility(View.INVISIBLE);
+ weakReference.get().mPsw.setVisibility(View.INVISIBLE);
+ int mWidth = weakReference.get().mBtnLogin.getMeasuredWidth();
+ int mHeight =weakReference.get().mBtnLogin.getMeasuredHeight();
+
+ weakReference.get().inputAnimator(weakReference.get().mInputLayout, mWidth, mHeight);
+
+
+ String ReturnUsername = (String) messageJSON.getData();
+
+
+ ToolTip.FadeCenter(weakReference.get(),"登陆成功");
+ User.setLogin(true);
+ User.getUser().setUsername(ReturnUsername);
+ try {
+ Thread.sleep(500);
+ loginActivity.finish();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }else {
+
+// 这里要让那个输入输出框还原
+
+// weakReference.get().recovery();
+ ToolTip.FadeCenter(weakReference.get(),messageJSON.getMsg());
- String ReturnUsername = (String) messageJSON.getData();
- User.setLogin(true);
- User.getUser().setUsername(ReturnUsername);
- try {
- Thread.sleep(300);
- loginActivity.finish();
- } catch (InterruptedException e) {
- e.printStackTrace();
}
+
}
}
@@ -82,6 +112,7 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
}
public void initView(){
mBtnLogin = (TextView) findViewById(R.id.main_btn_login);
+ getmBtnRegister = (TextView) findViewById(R.id.main_btn_register);
progress = findViewById(R.id.layout_progress);
mInputLayout = findViewById(R.id.input_layout);
mName = (LinearLayout) findViewById(R.id.id_edit);
@@ -90,6 +121,7 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
//给登陆功能设置设置监听
mBtnLogin.setOnClickListener(this);
+ getmBtnRegister.setOnClickListener(this);
}
@@ -103,13 +135,11 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
//登录
//根据监听的不同内容,来改变响应状态
// 计算出控件的高与宽
- mWidth = mBtnLogin.getMeasuredWidth();
- mHeight = mBtnLogin.getMeasuredHeight();
// 隐藏输入框
- mName.setVisibility(View.INVISIBLE);
- mPsw.setVisibility(View.INVISIBLE);
+
//调入动画
- inputAnimator(mInputLayout, mWidth, mHeight);
+
+
//如果登录成功
//获取手机号和密码
@@ -117,18 +147,17 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
EditText passwordEditText = (EditText) mPsw.getChildAt(1);
if(phonenumberEditText==null||phonenumberEditText.getText().toString().equals("")){
//请输入用户名
- Toast.makeText(this, "请输入电话号码", Toast.LENGTH_SHORT).show();
+ ToolTip.FlyTocenter(this,"请输入手机号");
}else if(passwordEditText==null||passwordEditText.getText().toString().equals("")){
//请输入密码
- Toast.makeText(this, "请输入密码", Toast.LENGTH_SHORT).show();
+ ToolTip.FlyTocenter(this,"请输入密码");
}else{
String phonenumber = phonenumberEditText.getText().toString();
String password = passwordEditText.getText().toString();
- if(phonenumber.length()!=11){
- Toast.makeText(this,"请输入11位电话号码",Toast.LENGTH_SHORT).show();
+ if(phonenumber.length()!=11 || !phonenumber.matches("[0-9]+")){
+ ToolTip.FlyTocenter(this,"请输入正确手机号码");
}else {
// 基本没错误,就要请求登陆了
-
new Thread(new Runnable() {
@Override
public void run() {
@@ -149,8 +178,11 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
break;
- case R.id.main_title:
+ case R.id.main_btn_register:
//注册
+ Intent intent = new Intent();
+ intent.setClass(this,RegisterActivity.class);
+ startActivity(intent);
}
@@ -161,7 +193,7 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
//设置输入框动画效果
- private void inputAnimator(final View view, float w, float h){
+ public AnimatorSet inputAnimator(final View view, float w, float h){
AnimatorSet set = new AnimatorSet();
ValueAnimator animator = ValueAnimator.ofFloat(0, w);
@@ -180,10 +212,11 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
ObjectAnimator animator2 = ObjectAnimator.ofFloat(mInputLayout,
"scaleX", 1f, 0.5f);
- set.setDuration(1000);
+ set.setDuration(500);
set.setInterpolator(new AccelerateDecelerateInterpolator());
set.playTogether(animator, animator2);
set.start();
+
set.addListener(new Animator.AnimatorListener() {
@Override
@@ -202,16 +235,19 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
* 动画结束后,先显示加载的动画,然后再隐藏输入框
*/
progress.setVisibility(View.VISIBLE);
- progressAnimator(progress);
+// progress.setVisibility(View.GONE);
+// progressAnimator(progress);
mInputLayout.setVisibility(View.INVISIBLE);
}
@Override
public void onAnimationCancel(Animator animation) {
-
+ progress.setVisibility(View.GONE);
+ recovery();
}
});
+ return set;
}
private void progressAnimator(final View view) {
@@ -224,6 +260,7 @@ public class LoginActivity extends AppCompatActivity implements View.OnClickList
animator3.setDuration(1000);
animator3.setInterpolator(new JellyInterpolator());
animator3.start();
+// animator3.cancel();
}
//登录错误,恢复初始状态
diff --git a/app/src/main/java/com/example/PersonalCenter/Login_Register/RegisterActivity.java b/app/src/main/java/com/example/PersonalCenter/Login_Register/RegisterActivity.java
new file mode 100644
index 0000000..d8835da
--- /dev/null
+++ b/app/src/main/java/com/example/PersonalCenter/Login_Register/RegisterActivity.java
@@ -0,0 +1,204 @@
+package com.example.PersonalCenter.Login_Register;
+
+import android.media.Image;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.util.Log;
+import android.view.View;
+import android.view.Window;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import com.alibaba.fastjson.JSONArray;
+import com.dd.CircularProgressButton;
+import com.example.Util.ConditionCode;
+import com.example.Util.RequestBody.user;
+import com.example.Util.ReturnData;
+import com.example.Util.ToolTip;
+import com.example.Util.User;
+import com.example.Util.cmkgWebServicePost;
+import com.example.Util.publicStringUtil;
+import com.example.cmknowledgegraph.R;
+import com.hanks.library.AnimateCheckBox;
+import com.itheima.wheelpicker.WheelPicker;
+
+import org.json.JSONObject;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.List;
+
+public class RegisterActivity extends AppCompatActivity implements View.OnClickListener {
+ private EditText phonenumberRegister;
+ private EditText usernameRegister;
+ private EditText passwordRegister;
+ private TextView RegisterButton;
+ private ImageView boycheckimg;
+ private ImageView girlcheckimg;
+ private AnimateCheckBox boycheck;
+ private AnimateCheckBox girlcheck;
+ private WheelPicker wheelPicker;
+
+
+
+ private final RegisterHandler registerHandler = new RegisterHandler(this);
+ public static class RegisterHandler extends Handler{
+ private final WeakReference weakReference;
+ RegisterHandler(RegisterActivity registerActivity){
+ this.weakReference = new WeakReference(registerActivity);
+ }
+ @Override
+ public void handleMessage(@NonNull Message msg) {
+ super.handleMessage(msg);
+ RegisterActivity registerActivity = (RegisterActivity) weakReference.get();
+ Bundle bundle = msg.getData();
+
+ ReturnData returnData = (ReturnData) bundle.getSerializable("msg");
+
+ if(returnData!=null && returnData.getCode()!=null){
+ int code = returnData.getCode();
+ if(code == ConditionCode.registersucess){
+ try {
+ Thread.sleep(700);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ ToolTip.FadeCenter(weakReference.get(),"注册成功!");
+ weakReference.get().finish();
+ }else {
+ ToolTip.FlyTocenter(weakReference.get(),returnData.getMsg());
+ }
+ }else ToolTip.FlyTocenter(weakReference.get(),"服务器出了点小问题");
+
+
+
+
+ }
+ }
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ requestWindowFeature(Window.FEATURE_NO_TITLE);
+ setContentView(R.layout.activity_register);
+ initView();
+
+ }
+
+ private void initView() {
+ //获取各个控件
+ RegisterButton = findViewById(R.id.main_btn_register_but);
+ boycheck = findViewById(R.id.boycheck);
+ boycheckimg = findViewById(R.id.boycheckimg);
+ girlcheck = findViewById(R.id.girlcheck);
+ girlcheckimg = findViewById(R.id.girlcheckimg);
+ phonenumberRegister = findViewById(R.id.phonenumber_edit_register);
+ usernameRegister = findViewById(R.id.username_edit_register);
+ passwordRegister = findViewById(R.id.password_edit_register);
+
+ //给控件设置监听器
+ boycheck.setOnClickListener(this);
+ boycheckimg.setOnClickListener(this);
+ girlcheckimg.setOnClickListener(this);
+ girlcheck.setOnClickListener(this);
+ RegisterButton.setOnClickListener(this);
+ List agewhellList = new ArrayList();
+ for(int i=0;i<120;i++) agewhellList.add(i+"");
+
+
+
+// wheelPicker.run();
+
+ }
+
+ @Override
+ public void onClick(View v) {
+ int id = v.getId();
+ switch (id){
+ case R.id.boycheck:
+ case R.id.boycheckimg:
+ if(!girlcheck.isChecked()){
+ if(boycheck.isChecked()) boycheck.setChecked(false); else boycheck.setChecked(true);
+ }
+ break;
+ case R.id.girlcheck:
+ case R.id.girlcheckimg:
+ if(!boycheck.isChecked()) {
+ if(girlcheck.isChecked()) girlcheck.setChecked(false); else girlcheck.setChecked(true);
+ }
+ break;
+ case R.id.main_btn_register_but:
+ Log.i("haha","你要注册了");
+ checkInfo();
+
+ }
+ }
+ public void checkInfo(){
+// 先检查手机号
+ String phonenumber = phonenumberRegister.getText().toString();
+
+ if(phonenumber == null || phonenumber.length()!=11 || !phonenumber.matches("[0-9]+")){
+ ToolTip.FadeCenter(this,"请输入正确的手机号");
+
+ }else{
+ String username = usernameRegister.getText().toString();
+ if(username == null){
+ ToolTip.FadeCenter(this,"请输入用户名");
+ }else if(username.length()>14) ToolTip.FadeCenter(this,"用户名过长");
+ else {
+ String password = passwordRegister.getText().toString();
+ if(password == null){
+ ToolTip.FadeCenter(this,"请输入密码");
+ }else if(password.length()<6) ToolTip.FadeCenter(this, "密码至少为6位");
+ else if(password.length()>14) ToolTip.FadeCenter(this," 密码最多14位");
+ else {
+ if(boycheck.isChecked()){
+ user user = new user(phonenumber,username,password,0,0,"");
+
+ new Thread(new Runnable() {
+ @Override
+ public void run() {
+ Message m = new Message();
+ Bundle bundle = new Bundle();
+
+ ReturnData returnData = cmkgWebServicePost.execuHttpPost(user.toString(), publicStringUtil.registerURL);
+ Log.i("returndata",""+returnData);
+ bundle.putSerializable("msg", returnData);
+ m.setData(bundle);
+ registerHandler.sendMessage(m);
+
+ }
+ }).start();
+ }else if(girlcheck.isChecked()){
+ String args = "phonenumber="+phonenumber+"&username="+username+"&password="+password
+ +"®ion="+""+"&age=0"+"&sex=0";
+ cmkgWebServicePost.execuHttpPost(args, publicStringUtil.registerURL);
+ new Thread(new Runnable() {
+ @Override
+ public void run() {
+ Message message = new Message();
+ Bundle bundle = new Bundle();
+ ReturnData returnData = cmkgWebServicePost.execuHttpPost(args,publicStringUtil.registerURL);
+ bundle.putSerializable("msg", returnData);
+ message.setData(bundle);
+ registerHandler.sendMessage(message);
+ }
+ }).start();
+ }else{
+ ToolTip.FadeCenter(this,"请选择性别");
+ }
+ }
+ }
+ }
+
+
+ }
+
+
+}
diff --git a/app/src/main/java/com/example/Util/ConditionCode.java b/app/src/main/java/com/example/Util/ConditionCode.java
index aca2ad1..2521b15 100644
--- a/app/src/main/java/com/example/Util/ConditionCode.java
+++ b/app/src/main/java/com/example/Util/ConditionCode.java
@@ -13,4 +13,17 @@ public interface ConditionCode {
public final int MedicineToOperation=300;
public final int MedicineToSymptom=400;
+ //登陆成功
+ public final int loginsucess = 200;
+ //手机号不存在
+ public final int phonenumberisNotExist = 501;
+ //密码错误
+ public final int passwordError = 502;
+
+ //注册成功
+ public final int registersucess = 200;
+ //手机号已注册
+ public final int phonenumberHadExist = 501;
+
+
}
diff --git a/app/src/main/java/com/example/Util/RequestBody/user.java b/app/src/main/java/com/example/Util/RequestBody/user.java
new file mode 100644
index 0000000..5a7bd11
--- /dev/null
+++ b/app/src/main/java/com/example/Util/RequestBody/user.java
@@ -0,0 +1,88 @@
+package com.example.Util.RequestBody;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+public class user {
+ protected user(){}
+ private String phonenumber;
+ private String username;
+ private String password;
+ private Integer age;
+ private Integer sex;
+ private String region;
+
+ public user(String phonenumber, String username, String password, Integer age, Integer sex, String region) {
+ this.phonenumber = phonenumber;
+ this.username = username;
+ this.password = password;
+ this.age = age;
+ this.sex = sex;
+ this.region = region;
+ }
+
+ public String getPhonenumber() {
+ return phonenumber;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public Integer getAge() {
+ return age;
+ }
+
+ public Integer getSex() {
+ return sex;
+ }
+
+ @Override
+ public String toString() {
+ JSONObject jsonObject = new JSONObject();
+ try {
+ jsonObject.put("phonenumber",phonenumber);
+ jsonObject.put("username",username);
+ jsonObject.put("password",password);
+ jsonObject.put("sex",sex);
+ jsonObject.put("age",age);
+ jsonObject.put("region",region);
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+
+ return jsonObject.toString();
+ }
+
+ public String getRegion() {
+ return region;
+ }
+
+ public void setPhonenumber(String phonenumber) {
+ this.phonenumber = phonenumber;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public void setAge(Integer age) {
+ this.age = age;
+ }
+
+ public void setSex(Integer sex) {
+ this.sex = sex;
+ }
+
+ public void setRegion(String region) {
+ this.region = region;
+ }
+}
diff --git a/app/src/main/java/com/example/Util/ToolTip.java b/app/src/main/java/com/example/Util/ToolTip.java
new file mode 100644
index 0000000..8e0a79e
--- /dev/null
+++ b/app/src/main/java/com/example/Util/ToolTip.java
@@ -0,0 +1,41 @@
+package com.example.Util;
+
+
+import android.content.Context;
+import android.graphics.Color;
+
+import com.example.cmknowledgegraph.R;
+import com.github.johnpersano.supertoasts.library.Style;
+import com.github.johnpersano.supertoasts.library.SuperActivityToast;
+import com.github.johnpersano.supertoasts.library.utils.PaletteUtils;
+
+/*
+*
+* 用于发出提示框
+* */
+public class ToolTip {
+
+ public static void FadeCenter(Context context,String info){
+ SuperActivityToast.create(context, new Style(), Style.TYPE_STANDARD)
+ .setButtonText("UNDO")
+ .setButtonIconResource(R.drawable.back)
+ .setProgressBarColor(Color.WHITE)
+ .setText(info)
+ .setDuration(Style.DURATION_LONG)
+ .setFrame(Style.FRAME_KITKAT)
+ .setColor(PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_RED))
+ .setAnimations(Style.ANIMATIONS_SCALE).show();
+ }
+ public static void FlyTocenter(Context context, String info){
+ SuperActivityToast.create(context, new Style(), Style.TYPE_STANDARD)
+ .setButtonText("UNDO")
+ .setButtonIconResource(R.drawable.back)
+ .setProgressBarColor(Color.WHITE)
+ .setText(info)
+ .setDuration(Style.DURATION_MEDIUM)
+ .setFrame(Style.FRAME_KITKAT)
+ .setColor(PaletteUtils.getSolidColor(PaletteUtils.MATERIAL_BROWN))
+ .setAnimations(Style.ANIMATIONS_FLY).show();
+ }
+
+}
diff --git a/app/src/main/java/com/example/Util/cmkgWebServicePost.java b/app/src/main/java/com/example/Util/cmkgWebServicePost.java
new file mode 100644
index 0000000..9576391
--- /dev/null
+++ b/app/src/main/java/com/example/Util/cmkgWebServicePost.java
@@ -0,0 +1,114 @@
+package com.example.Util;
+
+import android.util.Log;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLEncoder;
+
+public class cmkgWebServicePost {
+ public static ReturnData execuHttpPost(String args,String address){
+ HttpURLConnection connection = null;
+ InputStream in = null;
+ String path = publicStringUtil.cmkgTomcatURL+address;
+ URL url = null;
+ try {
+ url = new URL(path);
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
+ try {
+ connection = (HttpURLConnection) url.openConnection();
+ connection.setDoInput(true);
+ connection.setDoOutput(true);
+ connection.setRequestMethod("POST");
+ connection.setReadTimeout(8000);
+ connection.setUseCaches(false);
+ connection.setRequestProperty("Content-Type","raw");
+ connection.connect();
+ DataOutputStream out = new DataOutputStream(connection.getOutputStream());
+// String data = URLEncoder.encode(args, "UTF-8");
+ Log.i("data",""+args);
+// "username="+ URLEncoder.encode(username,"UTF-8")+"&phonenumber="+URLEncoder.encode(phonenumber,"UTF-8")+"&password="+URLEncoder.encode(password,"UTF-8");
+ out.writeBytes(args);
+ out.flush();
+ out.close();
+// int resultCode = connection.getResponseCode();
+// Log.i("HTTP",resultCode+"");
+// if(HttpURLConnection.HTTP_OK == resultCode){
+ in = connection.getInputStream();
+
+ return parseInfo(in);
+// }
+// return null;
+ } catch (IOException e) {
+ e.printStackTrace();
+ }finally {
+ if(connection != null){
+ connection.disconnect();
+ }
+ if(in != null){
+ try {
+ in.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ return null;
+
+ }
+
+ public static ReturnData parseInfo(InputStream inputStream){
+ BufferedReader reader = null;
+ String line = "";
+ StringBuilder response = new StringBuilder();
+ reader = new BufferedReader(new InputStreamReader(inputStream));
+
+ try {
+ while((line = reader.readLine())!=null){
+ Log.d("RegisterActivity",line);
+ response.append(line);
+ }
+ Log.d("RegisterActivity","response.toSring:"+response.toString());
+
+ JSONObject jsonObject = null;
+ ReturnData returnData = null;
+ try {
+ jsonObject = new JSONObject(response.toString());
+ int code = jsonObject.getInt("code");
+ String msg = jsonObject.getString("msg");
+ String data = jsonObject.getString("data");
+ returnData = new ReturnData(code,msg,data);
+
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ return returnData;
+
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ }finally {
+ if(reader != null){
+ try {
+ reader.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/app/src/main/java/com/example/Util/publicStringUtil.java b/app/src/main/java/com/example/Util/publicStringUtil.java
index d635d6c..45abb5f 100644
--- a/app/src/main/java/com/example/Util/publicStringUtil.java
+++ b/app/src/main/java/com/example/Util/publicStringUtil.java
@@ -3,6 +3,7 @@ package com.example.Util;
public class publicStringUtil {
//cmkg项目tomcat服务器请求根路径
public static final String cmkgTomcatURL = "http://114.116.199.154:5000/cmkg";
+// public static final String cmkgTomcatURL = "10.0.2.2:8080";
//apache文件存储路径,图片什么的都在这里存
public static final String getCmkgApacheURL = "http://114.116.199.154:5001/";
@@ -11,8 +12,17 @@ public class publicStringUtil {
public static final String questionArgsname = "name=";
public static final String loginURL = "/request/login?";
- public static final String registerURL = "/request/register?";
+ public static final String registerURL = "/request/register";
+
+ /*
+ *
+ * Message
+ *
+ *
+ * */
+
+
}
diff --git a/app/src/main/res/drawable/boy.png b/app/src/main/res/drawable/boy.png
new file mode 100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