parent
b78b57b1e4
commit
af18e75a6b
@ -0,0 +1,7 @@
|
|||||||
|
package com.example.cici.voice;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
public class LoginActivityTest {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
|
||||||
|
package com.example.cici.dao;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
|
import android.database.sqlite.SQLiteOpenHelper;
|
||||||
|
import android.database.sqlite.SQLiteDatabase.CursorFactory;
|
||||||
|
|
||||||
|
public class DBOpenHelper extends SQLiteOpenHelper {
|
||||||
|
public DBOpenHelper(Context context,String name, CursorFactory factory,
|
||||||
|
int version) {
|
||||||
|
super(context, name, factory, version);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onCreate(SQLiteDatabase db) {
|
||||||
|
db.execSQL("create table if not exists user_tb(_id integer primary key autoincrement," +
|
||||||
|
"userID text not null," +
|
||||||
|
"pwd text not null," +
|
||||||
|
"name text not null," +
|
||||||
|
"birthday text not null," +
|
||||||
|
"sex text not null," +
|
||||||
|
"phonenum text not null," +
|
||||||
|
"headpic text not null)");
|
||||||
|
db.execSQL("create table if not exists voice_tb(_id integer primary key autoincrement," +
|
||||||
|
"voiceID text not null," +
|
||||||
|
"voicecontent text not null,"+
|
||||||
|
"sharemoment integer," +
|
||||||
|
"diary integer," +
|
||||||
|
"memorandum integer," +
|
||||||
|
"report integer)");
|
||||||
|
db.execSQL("create table if not exists publish_tb(_id integer primary key autoincrement," +
|
||||||
|
"voiceID text not null," +
|
||||||
|
"userID text not null)");
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
|||||||
|
package com.example.cici.util;
|
||||||
|
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public class pubFun{
|
||||||
|
public static boolean isEmpty(String input)
|
||||||
|
{
|
||||||
|
if(input==null ||"".equals(input))
|
||||||
|
return true;
|
||||||
|
for(int i=0;i<input.length();i++)
|
||||||
|
{
|
||||||
|
char c=input.charAt(i);
|
||||||
|
if(c!=' '&&c!='\t'&&c!='\r'&&c!='\n')
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
public static boolean isPhoneNumberValid(String phoneNumber){
|
||||||
|
boolean isValid=false;
|
||||||
|
String expression = "^\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{5})$";
|
||||||
|
String expression2 = "^\\(?(\\d{3})\\)?[- ]?(\\d{4})[- ]?(\\d{4})$";
|
||||||
|
CharSequence inputStr = phoneNumber;
|
||||||
|
Pattern pattern = Pattern.compile(expression);
|
||||||
|
Matcher matcher = pattern.matcher(inputStr);
|
||||||
|
|
||||||
|
Pattern pattern2 = Pattern.compile(expression2);
|
||||||
|
Matcher matcher2 = pattern2.matcher(inputStr);
|
||||||
|
if(matcher.matches() || matcher2.matches()) {
|
||||||
|
isValid = true;
|
||||||
|
}
|
||||||
|
return isValid;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,84 @@
|
|||||||
|
package com.example.cici.voice;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.example.cici.dao.DBOpenHelper;
|
||||||
|
import com.example.cici.util.pubFun;
|
||||||
|
|
||||||
|
|
||||||
|
public class LoginActivity extends AppCompatActivity {
|
||||||
|
private EditText editPhone;
|
||||||
|
private EditText editPwd;
|
||||||
|
private Button btnLogin;
|
||||||
|
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.login);
|
||||||
|
editPhone = (EditText) findViewById(R.id.editPhone);
|
||||||
|
editPwd = (EditText) findViewById(R.id.editPwd);
|
||||||
|
btnLogin = (Button) findViewById(R.id.btnLogin);
|
||||||
|
}
|
||||||
|
public void OnMyLoginClick(View v) {
|
||||||
|
if(pubFun.isEmpty(editPhone.getText().toString()) || pubFun.isEmpty(editPwd.getText().toString())){
|
||||||
|
Toast.makeText(this, "手机号或密码不能为空!", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//call DBOpenHelper
|
||||||
|
DBOpenHelper helper = new DBOpenHelper(this,"voice.db",null,1);
|
||||||
|
SQLiteDatabase db = helper.getWritableDatabase();
|
||||||
|
Cursor c = db.query("user_tb",null,"userID=? and pwd=?",new String[]{editPhone.getText().toString(),editPwd.getText().toString()},null,null,null);
|
||||||
|
if(c!=null && c.getCount() >= 1){
|
||||||
|
String[] cols = c.getColumnNames();
|
||||||
|
while(c.moveToNext()){
|
||||||
|
for(String ColumnName:cols){
|
||||||
|
Log.i("info",ColumnName+":"+c.getString(c.getColumnIndex(ColumnName)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
c.close();
|
||||||
|
db.close();
|
||||||
|
|
||||||
|
//将登陆用户信息存储到SharedPreferences中
|
||||||
|
SharedPreferences mySharedPreferences= getSharedPreferences("setting",Activity.MODE_PRIVATE); //实例化SharedPreferences对象
|
||||||
|
SharedPreferences.Editor editor = mySharedPreferences.edit();//实例化SharedPreferences.Editor对象
|
||||||
|
editor.putString("userID", editPhone.getText().toString()); //用putString的方法保存数据
|
||||||
|
editor.commit(); //提交当前数据
|
||||||
|
|
||||||
|
this.finish();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Toast.makeText(this, "手机号或密码输入错误!", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jump to the registration interface
|
||||||
|
* @param v
|
||||||
|
*/
|
||||||
|
public void OnMyRegistClick(View v) {
|
||||||
|
Intent intent=new Intent(LoginActivity.this,RegistActivity.class);
|
||||||
|
//intent.putExtra("info", "No66778899");
|
||||||
|
LoginActivity.this.startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jump to reset password interface
|
||||||
|
* @param v
|
||||||
|
*/
|
||||||
|
public void OnMyResPwdClick(View v){
|
||||||
|
Intent intent=new Intent(LoginActivity.this,ResPwdActivity.class);
|
||||||
|
LoginActivity.this.startActivity(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
|||||||
|
package com.example.cici.voice;
|
||||||
|
|
||||||
|
|
||||||
|
import android.content.ContentValues;
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.example.cici.dao.DBOpenHelper;
|
||||||
|
import com.example.cici.util.pubFun;
|
||||||
|
|
||||||
|
|
||||||
|
public class RegistActivity extends AppCompatActivity {
|
||||||
|
private EditText editPhone;
|
||||||
|
private EditText editPwd;
|
||||||
|
private Button btnRegist;
|
||||||
|
protected void onCreate(Bundle savedInstanceState){
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.regist);
|
||||||
|
editPhone = (EditText) findViewById(R.id.editPhone);
|
||||||
|
editPwd = (EditText) findViewById(R.id.editPwd);
|
||||||
|
btnRegist = (Button) findViewById(R.id.btnRegist);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* register event
|
||||||
|
* @param v
|
||||||
|
*/
|
||||||
|
public void OnMyRegistClick(View v)
|
||||||
|
{
|
||||||
|
boolean isTrue = true;
|
||||||
|
if(pubFun.isPhoneNumberValid(editPhone.getText().toString()) == false){
|
||||||
|
isTrue = false;
|
||||||
|
Toast.makeText(this, "手机号格式不正确!", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(pubFun.isEmpty(editPwd.getText().toString())){
|
||||||
|
isTrue = false;
|
||||||
|
Toast.makeText(this, "密码不能为空!", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isTrue = true){
|
||||||
|
//call DBOpenHelper
|
||||||
|
DBOpenHelper helper = new DBOpenHelper(this,".db",null,1);
|
||||||
|
SQLiteDatabase db = helper.getWritableDatabase();
|
||||||
|
Cursor c = db.query("user_tb",null,"userID=?",new String[]{editPhone.getText().toString()},null,null,null);
|
||||||
|
if(c!=null && c.getCount() >= 1){
|
||||||
|
Toast.makeText(this, "该用户已存在", Toast.LENGTH_SHORT).show();
|
||||||
|
c.close();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
//insert data
|
||||||
|
ContentValues values= new ContentValues();
|
||||||
|
values.put("userID",editPhone.getText().toString());
|
||||||
|
values.put("pwd",editPwd.getText().toString());
|
||||||
|
long rowid = db.insert("user_tb",null,values);
|
||||||
|
|
||||||
|
Toast.makeText(this, "注册成功", Toast.LENGTH_SHORT).show();
|
||||||
|
this.finish();
|
||||||
|
}
|
||||||
|
db.close();
|
||||||
|
}else{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,88 @@
|
|||||||
|
package com.example.cici.voice;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.content.ContentValues;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.example.cici.dao.DBOpenHelper;
|
||||||
|
import com.example.cici.util.pubFun;
|
||||||
|
|
||||||
|
|
||||||
|
public class ResPwdActivity extends AppCompatActivity {
|
||||||
|
private EditText editPhone;
|
||||||
|
private EditText editPwd;
|
||||||
|
private EditText editResPwd;
|
||||||
|
private Button btnConfirm;
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.res_password);
|
||||||
|
editPhone = (EditText) findViewById(R.id.editPhone);
|
||||||
|
editPwd = (EditText) findViewById(R.id.editPwd);
|
||||||
|
editResPwd = (EditText) findViewById(R.id.editResPwd);
|
||||||
|
btnConfirm = (Button) findViewById(R.id.btnConfirm);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* confirm event
|
||||||
|
* @param v
|
||||||
|
*/
|
||||||
|
public void OnMyConfirmClick(View v) {
|
||||||
|
confirmInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* confirm event
|
||||||
|
*/
|
||||||
|
private void confirmInfo() {
|
||||||
|
if(pubFun.isEmpty(editPhone.getText().toString()) || pubFun.isEmpty(editPwd.getText().toString()) || pubFun.isEmpty(editResPwd.getText().toString())){
|
||||||
|
Toast.makeText(this, "手机号或密码不能为空!", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!editPwd.getText().toString().equals(editResPwd.getText().toString())){
|
||||||
|
Toast.makeText(this, "输入密码不正确!", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//调用DBOpenHelper
|
||||||
|
DBOpenHelper helper = new DBOpenHelper(this,"voice.db",null,1);
|
||||||
|
SQLiteDatabase db = helper.getWritableDatabase();
|
||||||
|
Cursor c = db.query("user_tb",null,"userID=?",new String[]{editPhone.getText().toString()},null,null,null);
|
||||||
|
if(c!=null && c.getCount() >= 1){
|
||||||
|
ContentValues cv = new ContentValues();
|
||||||
|
cv.put("pwd", editPwd.getText().toString());
|
||||||
|
String[] args = {String.valueOf(editPhone.getText().toString())};
|
||||||
|
long rowid = db.update("user_tb", cv, "userID=?",args);
|
||||||
|
c.close();
|
||||||
|
db.close();
|
||||||
|
Toast.makeText(this, "密码重置成功!", Toast.LENGTH_SHORT).show();
|
||||||
|
this.finish();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
new AlertDialog.Builder(this)
|
||||||
|
.setTitle("提示")
|
||||||
|
.setMessage("该用户不存在,请到注册界面进行注册!")
|
||||||
|
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int whichButton) {
|
||||||
|
setResult(RESULT_OK);
|
||||||
|
Intent intent=new Intent(ResPwdActivity.this,RegistActivity.class);
|
||||||
|
ResPwdActivity.this.startActivity(intent);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int whichButton) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,90 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:layout_editor_absoluteY="81dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/textstyle"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/login"
|
||||||
|
android:textColor="#ffff"
|
||||||
|
android:textSize="24sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
tools:layout_editor_absoluteY="95dp"
|
||||||
|
tools:ignore="MissingConstraints" />
|
||||||
|
<!-- input account -->
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/editPhone"
|
||||||
|
style="@style/textstyle"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:hint="手机号"
|
||||||
|
android:inputType="number"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLength="11"
|
||||||
|
android:singleLine="true"
|
||||||
|
tools:layout_editor_absoluteX="5dp"
|
||||||
|
tools:layout_editor_absoluteY="60dp"
|
||||||
|
tools:ignore="MissingConstraints" />
|
||||||
|
<!-- input pwd -->
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/editPwd"
|
||||||
|
style="@style/textstyle"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_marginTop="36dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:hint="密码"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLength="16"
|
||||||
|
android:password="true"
|
||||||
|
android:singleLine="true"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/btnLogin"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.545"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/editPhone" />
|
||||||
|
<!-- the login button -->
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnLogin"
|
||||||
|
style="@style/textstyle"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginBottom="124dp"
|
||||||
|
android:onClick="OnMyLoginClick"
|
||||||
|
android:text="@string/login"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtForgetPwd"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginBottom="80dp"
|
||||||
|
android:clickable="true"
|
||||||
|
android:onClick="OnMyResPwdClick"
|
||||||
|
android:text="忘记密码"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
tools:ignore="MissingConstraints" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtStartRegist"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:layout_marginBottom="76dp"
|
||||||
|
android:clickable="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:onClick="OnMyRegistClick"
|
||||||
|
|
||||||
|
android:text="立即注册"
|
||||||
|
android:textSize="15sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
@ -0,0 +1,69 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.constraint.ConstraintLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/textstyle"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/regist"
|
||||||
|
android:textColor="#ffff"
|
||||||
|
android:textSize="24sp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/editPhone"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:ignore="MissingConstraints" />
|
||||||
|
<!-- input phone -->
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/editPhone"
|
||||||
|
style="@style/textstyle"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:hint="手机号"
|
||||||
|
android:inputType="number"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLength="11"
|
||||||
|
android:singleLine="true"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
tools:ignore="MissingConstraints"
|
||||||
|
tools:layout_editor_absoluteY="144dp" />
|
||||||
|
<!-- input password -->
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/editPwd"
|
||||||
|
style="@style/textstyle"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginTop="48dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:hint="密码"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLength="16"
|
||||||
|
android:password="true"
|
||||||
|
android:singleLine="true"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/editPhone"
|
||||||
|
tools:ignore="MissingConstraints" />
|
||||||
|
<!-- the regist button -->
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnRegist"
|
||||||
|
style="@style/textstyle"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginTop="44dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:onClick="OnMyRegistClick"
|
||||||
|
android:text="@string/regist"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/editPwd"
|
||||||
|
tools:ignore="MissingConstraints" />
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
@ -0,0 +1,75 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.constraint.ConstraintLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView"
|
||||||
|
style="@style/textstyle"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/resPwd"
|
||||||
|
android:textColor="#ffff"
|
||||||
|
android:textSize="24sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
tools:layout_editor_absoluteY="52dp" />
|
||||||
|
<!-- input phone -->
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/editPhone"
|
||||||
|
style="@style/textstyle"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:hint="请输入注册的手机号"
|
||||||
|
android:inputType="number"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLength="11"
|
||||||
|
android:singleLine="true"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView"
|
||||||
|
tools:ignore="MissingConstraints"
|
||||||
|
tools:layout_editor_absoluteX="0dp" />
|
||||||
|
<!-- input password -->
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/editPwd"
|
||||||
|
style="@style/textstyle"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:hint="请输入新密码"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLength="16"
|
||||||
|
android:password="true"
|
||||||
|
android:singleLine="true"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/editPhone"
|
||||||
|
tools:ignore="MissingConstraints"
|
||||||
|
tools:layout_editor_absoluteX="0dp" />
|
||||||
|
<!-- input password again -->
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/editResPwd"
|
||||||
|
style="@style/textstyle"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:hint="请再次输入新密码"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxLength="16"
|
||||||
|
android:password="true"
|
||||||
|
android:singleLine="true"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/editPwd"
|
||||||
|
tools:ignore="MissingConstraints"
|
||||||
|
tools:layout_editor_absoluteX="0dp" />
|
||||||
|
<!-- the confirm button -->
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnConfirm"
|
||||||
|
style="@style/textstyle"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_marginTop="68dp"
|
||||||
|
android:onClick="OnMyConfirmClick"
|
||||||
|
android:text="@string/confirm"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/editResPwd"
|
||||||
|
tools:ignore="MissingConstraints"
|
||||||
|
tools:layout_editor_absoluteX="0dp" />
|
||||||
|
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
@ -1,3 +1,10 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">voice</string>
|
<string name="app_name">voice</string>
|
||||||
|
<string name="login">登录</string>
|
||||||
|
<string name="forgetPwd">忘记密码</string>
|
||||||
|
<string name="startRegist">开始注册</string>
|
||||||
|
<string name="regist">注册</string>
|
||||||
|
<string name="resPwd">重置密码</string>
|
||||||
|
<string name="confirm">确认</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in new issue