Compare commits
3 Commits
master
...
Branch_Sun
Author | SHA1 | Date |
---|---|---|
|
ae0617c89a | 3 years ago |
|
a46d9bc594 | 3 years ago |
|
f000a99878 | 3 years ago |
@ -0,0 +1,6 @@
|
|||||||
|
projectKey=myNotes
|
||||||
|
serverUrl=http://127.0.0.1:9000
|
||||||
|
serverVersion=9.5.0.56709
|
||||||
|
dashboardUrl=http://127.0.0.1:9000/dashboard?id=myNotes
|
||||||
|
ceTaskId=AYRIh5EzuqDImpFV-sUP
|
||||||
|
ceTaskUrl=http://127.0.0.1:9000/api/ce/task?id=AYRIh5EzuqDImpFV-sUP
|
@ -0,0 +1,69 @@
|
|||||||
|
package net.micode.notes.ui;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import net.micode.notes.R;
|
||||||
|
|
||||||
|
public class ChangingPassword extends Activity {
|
||||||
|
EditText OldPassword;
|
||||||
|
EditText NewPassword;
|
||||||
|
EditText AckPassword;
|
||||||
|
Button Acknowledged;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_change_password);
|
||||||
|
getWindow().setSoftInputMode(
|
||||||
|
WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE
|
||||||
|
| WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
|
||||||
|
OldPassword=(EditText) findViewById(R.id.old_password);
|
||||||
|
NewPassword=(EditText) findViewById(R.id.new_password);
|
||||||
|
AckPassword=(EditText) findViewById(R.id.ack_password);
|
||||||
|
Acknowledged=(Button)findViewById(R.id.Acknowledged);
|
||||||
|
Acknowledged.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
String old_password = OldPassword.getText().toString();
|
||||||
|
String new_password = NewPassword.getText().toString();
|
||||||
|
String ack_password = AckPassword.getText().toString();
|
||||||
|
SharedPreferences pref=getSharedPreferences("user management",MODE_PRIVATE);
|
||||||
|
String login_password=pref.getString("password","");
|
||||||
|
if(old_password.equals("")==true || new_password.equals("")==true || ack_password.equals("")==true) {
|
||||||
|
Toast.makeText(ChangingPassword.this, "密码不能为空", Toast.LENGTH_SHORT).show();
|
||||||
|
}else if (new_password.equals(ack_password) == false) {
|
||||||
|
Toast.makeText(ChangingPassword.this, "新建密码与重复密码不匹配,请重新输入密码", Toast.LENGTH_SHORT).show();
|
||||||
|
AckPassword.setText("");
|
||||||
|
}else if(old_password.equals(login_password) == false){
|
||||||
|
Toast.makeText(ChangingPassword.this, "原有密码错误,请重新输入密码", Toast.LENGTH_SHORT).show();
|
||||||
|
OldPassword.setText("");
|
||||||
|
}
|
||||||
|
else if (new_password.equals(ack_password) == true && old_password.equals(login_password) == true){
|
||||||
|
SharedPreferences.Editor editor=getSharedPreferences("user management", MODE_PRIVATE).edit();
|
||||||
|
editor.putString("password",new_password);
|
||||||
|
editor.apply();
|
||||||
|
Toast.makeText(ChangingPassword.this, "修改密码成功", Toast.LENGTH_SHORT).show();
|
||||||
|
Intent intent=new Intent(ChangingPassword.this,NotesListActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
Intent intent=new Intent(ChangingPassword.this,NotesListActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,63 @@
|
|||||||
|
package net.micode.notes.ui;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import net.micode.notes.R;
|
||||||
|
|
||||||
|
public class DeletingPassword extends Activity {
|
||||||
|
EditText Dt_password;
|
||||||
|
Button Acknowledged;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_delete_password);
|
||||||
|
getWindow().setSoftInputMode(
|
||||||
|
WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE
|
||||||
|
| WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
|
||||||
|
Dt_password=(EditText) findViewById(R.id.thepassword);
|
||||||
|
Acknowledged=(Button)findViewById(R.id.Dt_Acknowledged);
|
||||||
|
Acknowledged.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
String text02 = Dt_password.getText().toString();
|
||||||
|
if(text02.equals("")==true)
|
||||||
|
Toast.makeText(DeletingPassword.this, "密码不能为空", Toast.LENGTH_SHORT).show();
|
||||||
|
SharedPreferences pref=getSharedPreferences("user management",MODE_PRIVATE);
|
||||||
|
String password = pref.getString("password","");
|
||||||
|
if(password.equals("")==false&&password.equals(text02)==true){
|
||||||
|
SharedPreferences.Editor editor=getSharedPreferences("user management",
|
||||||
|
MODE_PRIVATE).edit();
|
||||||
|
editor.putBoolean("user",false);//false表示已经设置登录密码
|
||||||
|
editor.putString("password","");
|
||||||
|
editor.apply();
|
||||||
|
|
||||||
|
Toast.makeText(DeletingPassword.this, "已经删除登录密码", Toast.LENGTH_SHORT).show();
|
||||||
|
Intent intent=new Intent(DeletingPassword.this,NotesListActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Toast.makeText(DeletingPassword.this, "密码错误", Toast.LENGTH_SHORT).show();
|
||||||
|
Dt_password.setText("");//把密码框内输入过的错误密码清空
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
Intent intent=new Intent(DeletingPassword.this,NotesListActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,67 @@
|
|||||||
|
package net.micode.notes.ui;
|
||||||
|
|
||||||
|
import static android.content.Context.MODE_PRIVATE;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import net.micode.notes.R;
|
||||||
|
|
||||||
|
public class SettingPassword extends Activity {
|
||||||
|
EditText password;
|
||||||
|
EditText password_ack;
|
||||||
|
Button acknowledge;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_set_loginpassword);
|
||||||
|
getWindow().setSoftInputMode(
|
||||||
|
WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE
|
||||||
|
| WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
|
||||||
|
password=(EditText) findViewById(R.id.password);
|
||||||
|
password_ack=(EditText) findViewById(R.id.password_ack);
|
||||||
|
acknowledge=(Button)findViewById(R.id.acknowledge);
|
||||||
|
acknowledge.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
String text02 = password.getText().toString();
|
||||||
|
String text03 = password_ack.getText().toString();
|
||||||
|
if(text02.equals("")==true) {
|
||||||
|
Toast.makeText(SettingPassword.this, "密码不能为空", Toast.LENGTH_SHORT).show();
|
||||||
|
}else if (text02.equals(text03) == false) {
|
||||||
|
Toast.makeText(SettingPassword.this, "密码不匹配,请重新输入密码", Toast.LENGTH_SHORT).show();
|
||||||
|
password_ack.setText("");
|
||||||
|
}else if (text02.equals(text03) == true){
|
||||||
|
SharedPreferences.Editor editor=getSharedPreferences("user management",
|
||||||
|
MODE_PRIVATE).edit();
|
||||||
|
editor.putBoolean("user",true);//true表示已经设置登录密码
|
||||||
|
editor.putString("password",text02);
|
||||||
|
editor.apply();
|
||||||
|
Log.d("RegisterLoginPassword","password is "+text02);
|
||||||
|
Toast.makeText(SettingPassword.this, "设置密码成功", Toast.LENGTH_SHORT).show();
|
||||||
|
Intent intent=new Intent(SettingPassword.this,NotesListActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
Intent intent=new Intent(SettingPassword.this,NotesListActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 245 B After Width: | Height: | Size: 245 B |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 443 B After Width: | Height: | Size: 443 B |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 554 KiB After Width: | Height: | Size: 554 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |