Merge remote-tracking branch 'origin/master'

master
hanxueqing 5 years ago
commit 15eebaa706

@ -110,8 +110,12 @@
<orderEntry type="library" name="Gradle: androidx.annotation:annotation:1.0.0@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.constraintlayout:constraintlayout-solver:1.1.3@jar" level="project" />
<orderEntry type="library" name="Gradle: com.alibaba:fastjson:1.2.62@jar" level="project" />
<orderEntry type="library" name="Gradle: com.google.code.gson:gson:2.8.2@jar" level="project" />
<orderEntry type="library" name="Gradle: com.google.android.material:material:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: com.loopeer.library:cardstack:1.0.2@aar" level="project" />
<orderEntry type="library" name="Gradle: com.hanks.animatecheckbox:library:0.1@aar" level="project" />
<orderEntry type="library" name="Gradle: com.github.johnpersano:supertoasts:2.0@aar" level="project" />
<orderEntry type="library" name="Gradle: liji.library.dev:citypickerview:5.1.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.appcompat:appcompat:1.0.2@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.cardview:cardview:1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.fragment:fragment:1.0.0@aar" level="project" />
@ -142,5 +146,8 @@
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-livedata-core:2.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.arch.core:core-runtime:2.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: androidx.constraintlayout:constraintlayout:1.1.3@aar" level="project" />
<orderEntry type="library" name="Gradle: com.github.dmytrodanylyk.circular-progress-button:library:1.1.3@aar" level="project" />
<orderEntry type="library" name="Gradle: com.github.open-android:WheelPicker:v1.0.0@aar" level="project" />
<orderEntry type="library" name="Gradle: cn.aigestudio.wheelpicker:WheelPicker:1.1.3@aar" level="project" />
</component>
</module>

@ -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'
@ -38,4 +41,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'
}

@ -16,6 +16,7 @@
android:theme="@style/AppTheme">
<activity android:name="com.example.SearchCenter.SearchEntryActivity"/>
<activity android:name="com.example.PersonalCenter.Login_Register.LoginActivity"/>
<activity android:name="com.example.PersonalCenter.Login_Register.RegisterActivity"/>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

@ -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();
}
//登录错误,恢复初始状态

@ -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<RegisterActivity> weakReference;
RegisterHandler(RegisterActivity registerActivity){
this.weakReference = new WeakReference<RegisterActivity>(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<String> agewhellList = new ArrayList<String>();
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
+"&region="+""+"&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,"请选择性别");
}
}
}
}
}
}

@ -23,4 +23,17 @@ public interface ConditionCode {
public final String Model_Operation="用法";
public final String Model_Function="作用";
//登陆成功
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;
}

@ -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;
}
}

@ -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();
}
}

@ -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;
}
}

@ -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
*
*
* */
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 821 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

@ -5,7 +5,7 @@
<corners android:radius="50dip"/>
<stroke
android:width="1dip"
android:width="2dip"
android:color="#ffffff" />
</shape>

@ -27,7 +27,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:gravity="center"
android:text="FIREFLY FOREST"
android:text="LOGIN YOURPHONE"
android:textColor="#ffffff"
android:textSize="24sp" />
@ -35,7 +35,7 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="SHOW YOUR IDEAS"
android:text="SHOW YOUR HEALTH"
android:textColor="#ffffff"
android:textSize="16sp" />
</LinearLayout>
@ -60,10 +60,10 @@
<TextView
android:id="@+id/main_btn_login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="120dp"
android:layout_height="40dp"
android:layout_below="@+id/input_layout"
android:layout_centerInParent="true"
android:layout_marginLeft="50dp"
android:layout_marginTop="15dip"
android:background="@drawable/text_bg"
android:gravity="center"
@ -71,9 +71,26 @@
android:paddingLeft="15dip"
android:paddingRight="15dip"
android:paddingTop="2dip"
android:text="Login"
android:text="Sign In"
android:textColor="#ffffff"
android:textSize="20sp" />
<TextView
android:id="@+id/main_btn_register"
android:layout_width="120dp"
android:layout_height="40dp"
android:layout_below="@+id/input_layout"
android:layout_alignParentRight="true"
android:layout_marginRight="50dp"
android:layout_marginTop="15dip"
android:background="@drawable/text_bg"
android:gravity="center"
android:paddingBottom="4dip"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:paddingTop="4dip"
android:text="Sign Up"
android:textColor="#ffffff"
android:textSize="20dp" />
</RelativeLayout>
</RelativeLayout>

@ -5,72 +5,151 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#7adfb8"
tools:context=".RegisterActivity">
<GridLayout
android:layout_width="wrap_content"
<include
android:id="@+id/main_title"
layout="@layout/title_layout" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:rowCount="3"
android:columnCount="2"
android:layout_marginTop="80dp"
android:layout_marginLeft="60dp"
>
<TextView
android:text="手机号"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:textSize="20dp"
android:textColor="#D2691E"
/>
<EditText
android:id="@+id/tel_register_edit"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"/>
android:layout_below="@+id/main_title"
android:orientation="vertical" >
<ImageView
android:id="@+id/iv_avatar_register"
android:layout_width="70dip"
android:layout_height="70dip"
android:layout_gravity="center_horizontal"
android:src="@drawable/project_detail_cir" />
<TextView
android:text="昵称"
android:layout_marginTop="25dp"
android:layout_marginLeft="20dp"
android:textSize="20dp"
android:textColor="#D2691E"
/>
<EditText
android:id="@+id/nickname_register_edit"
android:layout_width="200dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="20dp"/>
android:layout_marginTop="5dip"
android:gravity="center"
android:text="REGISTER FOR YOU"
android:textColor="#ffffff"
android:textSize="24sp" />
<TextView
android:text="密 码"
android:layout_marginTop="25dp"
android:layout_marginLeft="10dp"
android:textSize="20dp"
android:textColor="#D2691E"
/>
<EditText
android:id="@+id/password_register_edit"
android:layout_width="200dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="20dp"
android:inputType="textPassword"
/>
</GridLayout>
<Button
android:id="@+id/register_btn"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_marginTop="80dp"
android:layout_marginStart="100dp"
android:background="#FFE4C4"
android:layout_marginLeft="5dp"
android:text="注册"
android:textSize="20dp"/>
<ImageView
android:layout_width="wrap_content"
android:gravity="center"
android:text="SHOW YOUR HEALTH"
android:textColor="#ffffff"
android:textSize="16sp" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@mipmap/register_pic"
android:layout_marginLeft="150dp"
android:layout_marginTop="60dp"/>
android:layout_centerInParent="true" >
<include
android:id="@+id/input_layout"
android:layout_width="match_parent"
android:layout_height="300dip"
layout="@layout/input_layout_register" />
<include
android:id="@+id/layout_progress"
android:layout_width="match_parent"
android:layout_height="130dip"
layout="@layout/layout_progress"
android:visibility="gone" />
<RelativeLayout
android:id="@+id/sexcheck"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_below="@+id/input_layout">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/boycheckimg"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/boy"/>
<com.hanks.library.AnimateCheckBox
android:id="@+id/boycheck"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="10dp"
android:padding="0dp"
app:animDuration="200"
app:checkedColor="#00f"
app:lineColor="#fff"
app:lineWidth="1.2dp"
app:unCheckColor="#fff"/>
<ImageView
android:id="@+id/girlcheckimg"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="10dp"
android:src="@drawable/girl"/>
<com.hanks.library.AnimateCheckBox
android:id="@+id/girlcheck"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="10dp"
android:padding="0dp"
app:animDuration="200"
app:checkedColor="#9933FA"
app:lineColor="#fff"
app:lineWidth="1.2dp"
app:unCheckColor="#fff"/>
</LinearLayout>
</RelativeLayout>
<!-- <RelativeLayout-->
<!-- android:id="@+id/agePickerRela"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_below="@+id/sexcheck"-->
<!-- android:layout_marginLeft="40dp"-->
<!-- android:layout_marginTop="10dp">-->
<!-- <com.itheima.wheelpicker.WheelPicker-->
<!-- android:id="@+id/agePicker"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- app:wheel_atmospheric="true"-->
<!-- app:wheel_curved="true"-->
<!-- app:wheel_cyclic="true"-->
<!-- app:wheel_selected_item_position="5"-->
<!-- app:wheel_item_text_color="#00FFFF"-->
<!-- app:wheel_selected_item_text_color="#DA70D6"/>-->
<!-- </RelativeLayout>-->
<TextView
android:id="@+id/main_btn_register_but"
android:layout_width="120dp"
android:layout_height="40dp"
android:layout_below="@+id/sexcheck"
android:layout_centerInParent="true"
android:layout_marginTop="15dip"
android:background="@drawable/text_bg"
android:gravity="center"
android:paddingBottom="4dip"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:paddingTop="4dip"
android:text="Sign Up"
android:textColor="#ffffff"
android:textSize="20dp" />
</RelativeLayout>
</LinearLayout>

@ -36,6 +36,7 @@
android:textSize="16sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="10px"
@ -66,6 +67,13 @@
android:textSize="16sp"
android:textColor="@color/cyan"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="10px"
android:layout_marginBottom="5dip"
android:layout_marginTop="5dip"
android:background="#eeeeee" />
</LinearLayout>
</LinearLayout>

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<!--这个是登录或者注册的编辑区-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dip"
android:background="@drawable/radius_drawable_bg"
android:orientation="vertical"
android:padding="20dip" >
<LinearLayout
android:id="@+id/phonenumber_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_call_filled" />
<EditText
android:id="@+id/phonenumber_edit_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:background="#00000000"
android:hint="请输入手机号"
android:textColor="@color/cyan"
android:padding="5dip"
android:textSize="16sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="10px"
android:layout_marginBottom="5dip"
android:layout_marginTop="5dip"
android:background="#eeeeee" />
<LinearLayout
android:id="@+id/username_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_profile" />
<EditText
android:id="@+id/username_edit_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:background="#00000000"
android:hint="请输入用户名"
android:padding="5dip"
android:textSize="16sp"
android:textColor="@color/cyan"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="10px"
android:layout_marginBottom="5dip"
android:layout_marginTop="5dip"
android:background="#eeeeee" />
<LinearLayout
android:id="@+id/password_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_lockopen" />
<EditText
android:id="@+id/password_edit_register"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:background="#00000000"
android:hint="密码"
android:inputType="textPassword"
android:padding="5dip"
android:textSize="16sp"
android:textColor="@color/cyan"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="10px"
android:layout_marginBottom="5dip"
android:layout_marginTop="5dip"
android:background="#eeeeee" />
</LinearLayout>
</LinearLayout>

@ -5,21 +5,23 @@
android:gravity="center_vertical"
android:padding="10dip" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/back" />
<!-- <ImageView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="60dp"-->
<!-- android:elevation="20dp"-->
<!-- android:src="@drawable/back" />-->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textSize="20sp"
android:text="Sign up"
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:textColor="#ffffff"-->
<!-- android:layout_alignParentRight="true"-->
<!-- android:layout_centerVertical="true"-->
<!-- android:textSize="20sp"-->
<!-- android:text="Sign up"-->
/>
<!-- />-->
</RelativeLayout>

@ -1,3 +1,4 @@
<resources>
<!-- <string name="app_name">CMKnowledgeGraph</string>-->
<!-- <string name="Sign"-->
</resources>

Loading…
Cancel
Save