Compare commits
4 Commits
master
...
Branch_liu
Author | SHA1 | Date |
---|---|---|
|
a2882c8170 | 3 years ago |
|
c05ae541e4 | 3 years ago |
|
d8062621be | 3 years ago |
|
6ad9df86cd | 3 years ago |
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<item name="m_locker" type="id" />
|
||||
</resources>
|
@ -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
|
@ -1,3 +1,4 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
||||
*
|
@ -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,43 @@
|
||||
package net.micode.notes.ui;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.speech.tts.TextToSpeech;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.Toast;
|
||||
|
||||
import net.micode.notes.R;
|
||||
|
||||
|
||||
public class GetLocation extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
this.setContentView(R.layout.local);
|
||||
Toast.makeText(GetLocation.this,"init",Toast.LENGTH_SHORT).show();
|
||||
Button local_1 = new Button(this);
|
||||
Button local_2 = new Button(this);
|
||||
local_1.setOnClickListener(new View.OnClickListener() {
|
||||
private static final String TAG = "GetLocation";
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Log.i(TAG, "onClick: button1");
|
||||
Toast.makeText(GetLocation.this,"button1",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
local_2.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Toast.makeText(GetLocation.this, "button2", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package net.micode.notes.ui.translate_demo;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface BaiduTranslateService {
|
||||
@POST("translate")
|
||||
@FormUrlEncoded
|
||||
Call<RespondBean> translate(@Field("q") String q, @Field("from") String from, @Field("to") String to, @Field("appid") String appid, @Field("salt") String salt,
|
||||
@Field("sign") String sign);
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package net.micode.notes.ui.translate_demo;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
|
||||
/**
|
||||
* 加密解密工具类(对字符串加密) MD5加密
|
||||
*/
|
||||
public class MD5Utils {
|
||||
|
||||
/**
|
||||
* MD5加密算法使用 对字符串加密
|
||||
*
|
||||
* @param info 参数为需要加密的String
|
||||
* @return 返回加密后的String
|
||||
*/
|
||||
public static String getMD5Code(String info) {
|
||||
try {
|
||||
MessageDigest md5 = MessageDigest.getInstance("MD5");
|
||||
md5.update(info.getBytes("utf-8"));//设置编码格式
|
||||
byte[] encryption = md5.digest();
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
for (int i = 0; i < encryption.length; i++) {
|
||||
if (Integer.toHexString(0xff & encryption[i]).length() == 1) {
|
||||
stringBuffer.append("0").append(Integer.toHexString(0xff & encryption[i]));
|
||||
} else {
|
||||
stringBuffer.append(Integer.toHexString(0xff & encryption[i]));
|
||||
}
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
} catch (Exception e) {
|
||||
return "MD5加密异常";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package net.micode.notes.ui.translate_demo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RespondBean {
|
||||
|
||||
/**
|
||||
* from : zh
|
||||
* to : en
|
||||
* trans_result : [{"src":"你好","dst":"Hello"}]
|
||||
*/
|
||||
|
||||
private String from;
|
||||
private String to;
|
||||
private List<TransResultBean> trans_result;
|
||||
|
||||
public String getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
public void setFrom(String from) {
|
||||
this.from = from;
|
||||
}
|
||||
|
||||
public String getTo() {
|
||||
return to;
|
||||
}
|
||||
|
||||
public void setTo(String to) {
|
||||
this.to = to;
|
||||
}
|
||||
|
||||
public List<TransResultBean> getTrans_result() {
|
||||
return trans_result;
|
||||
}
|
||||
|
||||
public void setTrans_result(List<TransResultBean> trans_result) {
|
||||
this.trans_result = trans_result;
|
||||
}
|
||||
|
||||
public static class TransResultBean {
|
||||
/**
|
||||
* src : 你好
|
||||
* dst : Hello
|
||||
*/
|
||||
|
||||
private String src;
|
||||
private String dst;
|
||||
|
||||
public String getSrc() {
|
||||
return src;
|
||||
}
|
||||
|
||||
public void setSrc(String src) {
|
||||
this.src = src;
|
||||
}
|
||||
|
||||
public String getDst() {
|
||||
return dst;
|
||||
}
|
||||
|
||||
public void setDst(String dst) {
|
||||
this.dst = dst;
|
||||
}
|
||||
}
|
||||
}
|
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 |
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 |