Compare commits
59 Commits
master
...
zhangchaoq
@ -1,188 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
package="net.micode.notes"
|
|
||||||
android:versionCode="1"
|
|
||||||
android:versionName="0.1">
|
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="16" />
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
|
||||||
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
|
||||||
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
|
||||||
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
|
|
||||||
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
|
|
||||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
|
||||||
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
|
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
|
||||||
|
|
||||||
<application
|
|
||||||
android:icon="@drawable/my_icon_app"
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:requestLegacyExternalStorage="true"
|
|
||||||
tools:ignore="ExtraText">
|
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name=".ui.RecordActivity"
|
|
||||||
android:label="Notes"
|
|
||||||
android:launchMode="standard" />
|
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name=".ui.LoginActivity"
|
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:launchMode="singleTop"
|
|
||||||
android:theme="@style/NoteTheme"
|
|
||||||
android:windowSoftInputMode="adjustPan">
|
|
||||||
|
|
||||||
<!-- android:uiOptions="splitActionBarWhenNarrow" -->
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name=".ui.SplashActivity"
|
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
|
||||||
android:exported="true"
|
|
||||||
android:label="@string/title_activity_splash"
|
|
||||||
android:theme="@style/Theme.Space2.Fullscreen">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name=".ui.ChangedLoginPassword"
|
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:launchMode="singleTop"
|
|
||||||
android:theme="@style/NoteTheme"
|
|
||||||
android:windowSoftInputMode="adjustPan"></activity>
|
|
||||||
<activity
|
|
||||||
android:name=".ui.RegisterLoginPassword"
|
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:launchMode="singleTop"
|
|
||||||
android:theme="@style/NoteTheme"
|
|
||||||
android:windowSoftInputMode="adjustPan"></activity>
|
|
||||||
<activity
|
|
||||||
android:name=".ui.DeleteLoginPassword"
|
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:launchMode="singleTop"
|
|
||||||
android:theme="@style/NoteTheme"
|
|
||||||
android:windowSoftInputMode="adjustPan"></activity>
|
|
||||||
<activity
|
|
||||||
android:name=".ui.NotesListActivity"
|
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:launchMode="standard"
|
|
||||||
android:theme="@style/NoteTheme"
|
|
||||||
android:windowSoftInputMode="adjustPan">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<action android:name="android.intent.action.SEARCH" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
<meta-data
|
|
||||||
android:name="android.app.searchable"
|
|
||||||
android:resource="@xml/searchable"/>
|
|
||||||
</activity>
|
|
||||||
<activity
|
|
||||||
android:name=".ui.NoteEditActivity"
|
|
||||||
android:configChanges="keyboardHidden|orientation|screenSize"
|
|
||||||
android:launchMode="singleTop"
|
|
||||||
android:theme="@style/NoteTheme">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.VIEW" />
|
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
|
|
||||||
<data android:mimeType="vnd.android.cursor.item/text_note" />
|
|
||||||
<data android:mimeType="vnd.android.cursor.item/call_note" />
|
|
||||||
</intent-filter>
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.INSERT_OR_EDIT" />
|
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
|
|
||||||
<data android:mimeType="vnd.android.cursor.item/text_note" />
|
|
||||||
<data android:mimeType="vnd.android.cursor.item/call_note" />
|
|
||||||
</intent-filter>
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.SEARCH" />
|
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
<meta-data
|
|
||||||
android:name="android.app.searchable"
|
|
||||||
android:resource="@xml/searchable" />
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
<provider
|
|
||||||
android:name=".data.NotesProvider"
|
|
||||||
android:authorities="micode_notes"
|
|
||||||
android:multiprocess="true" />
|
|
||||||
|
|
||||||
<receiver
|
|
||||||
android:name=".widget.NoteWidgetProvider_2x"
|
|
||||||
android:label="@string/app_widget2x2">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
|
||||||
<action android:name="android.appwidget.action.APPWIDGET_DELETED" />
|
|
||||||
<action android:name="android.intent.action.PRIVACY_MODE_CHANGED" />
|
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
<meta-data
|
|
||||||
android:name="android.appwidget.provider"
|
|
||||||
android:resource="@xml/widget_2x_info" />
|
|
||||||
</receiver>
|
|
||||||
<receiver
|
|
||||||
android:name=".widget.NoteWidgetProvider_4x"
|
|
||||||
android:label="@string/app_widget4x4">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
|
||||||
<action android:name="android.appwidget.action.APPWIDGET_DELETED" />
|
|
||||||
<action android:name="android.intent.action.PRIVACY_MODE_CHANGED" />
|
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
<meta-data
|
|
||||||
android:name="android.appwidget.provider"
|
|
||||||
android:resource="@xml/widget_4x_info" />
|
|
||||||
</receiver>
|
|
||||||
<receiver android:name=".ui.AlarmInitReceiver">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
|
||||||
</intent-filter>
|
|
||||||
</receiver>
|
|
||||||
<receiver
|
|
||||||
android:name=".ui.AlarmReceiver"
|
|
||||||
android:process=":remote"></receiver>
|
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name=".ui.AlarmAlertActivity"
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:launchMode="singleInstance"
|
|
||||||
android:theme="@android:style/Theme.Holo.Wallpaper.NoTitleBar"></activity>
|
|
||||||
<activity
|
|
||||||
android:name=".ui.NotesPreferenceActivity"
|
|
||||||
android:label="@string/preferences_title"
|
|
||||||
android:launchMode="singleTop"
|
|
||||||
android:theme="@android:style/Theme.Holo.Light"></activity>
|
|
||||||
|
|
||||||
<service
|
|
||||||
android:name=".gtask.remote.GTaskSyncService"
|
|
||||||
android:exported="false"></service>
|
|
||||||
|
|
||||||
|
|
||||||
</application>
|
|
||||||
|
|
||||||
</manifest>
|
|
@ -1,69 +0,0 @@
|
|||||||
package net.micode.notes.ui;
|
|
||||||
|
|
||||||
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 ChangedLoginPassword extends Activity{
|
|
||||||
EditText OldPassword;
|
|
||||||
EditText NewPassword;
|
|
||||||
EditText AckPassword;
|
|
||||||
Button Acknowledged;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_change_loginpassword);
|
|
||||||
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.Bt_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(ChangedLoginPassword.this, "密码不能为空", Toast.LENGTH_SHORT).show();
|
|
||||||
}else if (new_password.equals(ack_password) == false) {
|
|
||||||
Toast.makeText(ChangedLoginPassword.this, "新建密码与重复密码不匹配,请重新输入密码", Toast.LENGTH_SHORT).show();
|
|
||||||
AckPassword.setText("");
|
|
||||||
}else if(old_password.equals(login_password) == false){
|
|
||||||
Toast.makeText(ChangedLoginPassword.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(ChangedLoginPassword.this, "修改密码成功", Toast.LENGTH_SHORT).show();
|
|
||||||
Intent intent=new Intent(ChangedLoginPassword.this,NotesListActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBackPressed() {
|
|
||||||
Intent intent=new Intent(ChangedLoginPassword.this,NotesListActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,63 +0,0 @@
|
|||||||
package net.micode.notes.ui;
|
|
||||||
|
|
||||||
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 DeleteLoginPassword extends Activity{
|
|
||||||
EditText password01;
|
|
||||||
Button Acknowledged;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_delete_loginpassword);
|
|
||||||
getWindow().setSoftInputMode(
|
|
||||||
WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE
|
|
||||||
| WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
|
|
||||||
password01=(EditText) findViewById(R.id.old_password);
|
|
||||||
Acknowledged=(Button)findViewById(R.id.Bt_Acknowledged);
|
|
||||||
Acknowledged.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
String text02 = password01.getText().toString();
|
|
||||||
if(text02.equals("")==true)
|
|
||||||
Toast.makeText(DeleteLoginPassword.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(DeleteLoginPassword.this, "已经删除登录密码", Toast.LENGTH_SHORT).show();
|
|
||||||
Intent intent=new Intent(DeleteLoginPassword.this,NotesListActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
Toast.makeText(DeleteLoginPassword.this, "密码错误", Toast.LENGTH_SHORT).show();
|
|
||||||
password01.setText("");//把密码框内输入过的错误密码清空
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBackPressed() {
|
|
||||||
Intent intent=new Intent(DeleteLoginPassword.this,NotesListActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,174 +0,0 @@
|
|||||||
package net.micode.notes.ui;
|
|
||||||
|
|
||||||
import static net.micode.notes.R.id.start_record;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.media.MediaRecorder;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Environment;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import net.micode.notes.R;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
|
|
||||||
public class RecordActivity extends Activity {
|
|
||||||
|
|
||||||
private MediaRecorder mediaRecorder;
|
|
||||||
|
|
||||||
private String TAG = "RecordActivity";
|
|
||||||
|
|
||||||
private boolean isRecording;
|
|
||||||
|
|
||||||
private Button start;
|
|
||||||
private Button stop;
|
|
||||||
private Button play;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState){
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
this.setContentView(R.layout.record_activity);
|
|
||||||
start = (Button) findViewById (start_record);
|
|
||||||
stop = (Button) findViewById (R.id.stop_record);
|
|
||||||
play = (Button) findViewById (R.id.play_record);
|
|
||||||
start.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
start();
|
|
||||||
Log.d(TAG, "onClick: Start");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
stop.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
stop();
|
|
||||||
Log.d(TAG, "onClick: Stop");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
play.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
Log.d(TAG, "onClick: play");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//在这里重载Back键执行的操作
|
|
||||||
/*@Override
|
|
||||||
public void onBackPressed(){
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
private boolean checkSDCard() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
//检测SD卡是否插入手机中
|
|
||||||
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开始录音
|
|
||||||
*/
|
|
||||||
protected void start() {
|
|
||||||
try {
|
|
||||||
File path;
|
|
||||||
if (checkSDCard()) {
|
|
||||||
File mpath = Environment.getExternalStorageDirectory();
|
|
||||||
path = new File(mpath.getPath() + File.separator + "audioRecords");
|
|
||||||
Log.d(TAG, "start: "+path);
|
|
||||||
if (!path.mkdirs()) {
|
|
||||||
Log.d("audioRecorder", "创建目录失败");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
Toast.makeText(RecordActivity.this, "SDcard未连接",
|
|
||||||
Toast.LENGTH_LONG).show();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
File file = null;
|
|
||||||
try {
|
|
||||||
file = File.createTempFile(String.valueOf("myrecord_"), ".amr", path);
|
|
||||||
} catch (IOException e) {
|
|
||||||
Log.d("audioRecorder", "文件创建失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (file.exists()) {
|
|
||||||
// 如果文件存在,删除它,演示代码保证设备上只有一个录音文件
|
|
||||||
file.delete();
|
|
||||||
}
|
|
||||||
mediaRecorder = new MediaRecorder();
|
|
||||||
// 设置音频录入源
|
|
||||||
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
|
|
||||||
// 设置录制音频的输出格式
|
|
||||||
mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
|
|
||||||
// 设置音频的编码格式
|
|
||||||
mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
|
|
||||||
// 设置录制音频文件输出文件路径
|
|
||||||
mediaRecorder.setOutputFile(file.getAbsolutePath());
|
|
||||||
|
|
||||||
mediaRecorder.setOnErrorListener(new MediaRecorder.OnErrorListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(MediaRecorder mr, int what, int extra) {
|
|
||||||
// 发生错误,停止录制
|
|
||||||
mediaRecorder.stop();
|
|
||||||
mediaRecorder.release();
|
|
||||||
mediaRecorder = null;
|
|
||||||
isRecording=false;
|
|
||||||
start.setEnabled(true);
|
|
||||||
stop.setEnabled(false);
|
|
||||||
Toast.makeText(RecordActivity.this, "录音发生错误", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 准备、开始
|
|
||||||
mediaRecorder.prepare();
|
|
||||||
mediaRecorder.start();
|
|
||||||
|
|
||||||
isRecording=true;
|
|
||||||
start.setEnabled(false);
|
|
||||||
stop.setEnabled(true);
|
|
||||||
Toast.makeText(RecordActivity.this, "开始录音", Toast.LENGTH_SHORT).show();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 录音结束
|
|
||||||
*/
|
|
||||||
protected void stop() {
|
|
||||||
if (isRecording) {
|
|
||||||
// 如果正在录音,停止并释放资源
|
|
||||||
mediaRecorder.stop();
|
|
||||||
mediaRecorder.release();
|
|
||||||
mediaRecorder = null;
|
|
||||||
isRecording=false;
|
|
||||||
start.setEnabled(true);
|
|
||||||
stop.setEnabled(false);
|
|
||||||
Toast.makeText(RecordActivity.this, "录音结束", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
if (isRecording) {
|
|
||||||
// 如果正在录音,停止并释放资源
|
|
||||||
mediaRecorder.stop();
|
|
||||||
mediaRecorder.release();
|
|
||||||
mediaRecorder = null;
|
|
||||||
}
|
|
||||||
super.onDestroy();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,65 +0,0 @@
|
|||||||
package net.micode.notes.ui;
|
|
||||||
|
|
||||||
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 RegisterLoginPassword extends Activity{
|
|
||||||
EditText password01;
|
|
||||||
EditText password02;
|
|
||||||
Button registered;
|
|
||||||
|
|
||||||
@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);
|
|
||||||
password01=(EditText) findViewById(R.id.rg_password01);
|
|
||||||
password02=(EditText) findViewById(R.id.rg_password02);
|
|
||||||
registered=(Button)findViewById(R.id.rg_registered);
|
|
||||||
registered.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
String text02 = password01.getText().toString();
|
|
||||||
String text03 = password02.getText().toString();
|
|
||||||
if(text02.equals("")==true) {
|
|
||||||
Toast.makeText(RegisterLoginPassword.this, "密码不能为空", Toast.LENGTH_SHORT).show();
|
|
||||||
}else if (text02.equals(text03) == false) {
|
|
||||||
Toast.makeText(RegisterLoginPassword.this, "密码不匹配,请重新输入密码", Toast.LENGTH_SHORT).show();
|
|
||||||
password02.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(RegisterLoginPassword.this, "设置密码成功", Toast.LENGTH_SHORT).show();
|
|
||||||
Intent intent=new Intent(RegisterLoginPassword.this,NotesListActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBackPressed() {
|
|
||||||
Intent intent=new Intent(RegisterLoginPassword.this,NotesListActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
@startuml
|
|
||||||
'https://plantuml.com/class-diagram
|
|
||||||
class net.micode.notes.ui.NoteItemData
|
|
||||||
class net.micode.notes.ui.FoldersListAdapter
|
|
||||||
class net.micode.notes.ui.NotesListItem
|
|
||||||
class net.micode.notes.ui.AlarmInitReceiver
|
|
||||||
class net.micode.notes.ui.DateTimePickerDialog
|
|
||||||
class net.micode.notes.ui.NotesListActivity
|
|
||||||
class net.micode.notes.ui.NotesPreferenceActivity
|
|
||||||
class net.micode.notes.ui.RegisterLoginPassword
|
|
||||||
class net.micode.notes.ui.AlarmAlertActivity
|
|
||||||
class net.micode.notes.ui.DeleteLoginPassword
|
|
||||||
class net.micode.notes.ui.RecordActivity
|
|
||||||
class net.micode.notes.ui.DropdownMenu
|
|
||||||
class net.micode.notes.ui.NoteEditText
|
|
||||||
class net.micode.notes.ui.DateTimePicker
|
|
||||||
class net.micode.notes.ui.LoginActivity
|
|
||||||
class net.micode.notes.ui.NoteEditActivity
|
|
||||||
class net.micode.notes.ui.NotesListAdapter
|
|
||||||
class net.micode.notes.ui.AlarmReceiver
|
|
||||||
class net.micode.notes.ui.ChangedLoginPassword
|
|
||||||
class net.micode.notes.ui.SplashActivity
|
|
||||||
|
|
||||||
|
|
||||||
net.micode.notes.ui.NotesListActivity --> net.micode.notes.ui.NotesPreferenceActivity
|
|
||||||
net.micode.notes.ui.NotesListActivity --> net.micode.notes.ui.DropdownMenu
|
|
||||||
net.micode.notes.ui.NotesListActivity --> net.micode.notes.ui.FoldersListAdapter
|
|
||||||
net.micode.notes.ui.NoteItemData--|>net.micode.notes.ui.NotesListActivity
|
|
||||||
net.micode.notes.ui.NotesListAdapter--|>net.micode.notes.ui.NotesListActivity
|
|
||||||
net.micode.notes.ui.NotesListAdapter-->net.micode.notes.ui.NotesListItem
|
|
||||||
net.micode.notes.ui.NoteEditActivity-->net.micode.notes.ui.NotesPreferenceActivity
|
|
||||||
net.micode.notes.ui.NoteEditActivity-->net.micode.notes.ui.AlarmReceiver
|
|
||||||
net.micode.notes.ui.NoteEditActivity-->net.micode.notes.ui.DateTimePickerDialog
|
|
||||||
net.micode.notes.ui.NoteEditActivity-->net.micode.notes.ui.NoteEditText
|
|
||||||
net.micode.notes.ui.AlarmInitReceiver-->net.micode.notes.ui.AlarmReceiver
|
|
||||||
net.micode.notes.ui.AlarmReceiver-->net.micode.notes.ui.AlarmAlertActivity
|
|
||||||
net.micode.notes.ui.DateTimePicker--|>net.micode.notes.ui.DateTimePickerDialog
|
|
||||||
net.micode.notes.ui.ChangedLoginPassword--net.micode.notes.ui.DeleteLoginPassword
|
|
||||||
net.micode.notes.ui.ChangedLoginPassword--net.micode.notes.ui.LoginActivity
|
|
||||||
net.micode.notes.ui.LoginActivity--net.micode.notes.ui.DeleteLoginPassword
|
|
||||||
net.micode.notes.ui.LoginActivity--net.micode.notes.ui.RegisterLoginPassword
|
|
||||||
net.micode.notes.ui.RegisterLoginPassword--net.micode.notes.ui.DeleteLoginPassword
|
|
||||||
net.micode.notes.ui.RegisterLoginPassword--net.micode.notes.ui.ChangedLoginPassword
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@enduml
|
|
@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item android:state_pressed="true" android:color="#88555555" />
|
|
||||||
<item android:state_selected="true" android:color="#ff999999" />
|
|
||||||
<item android:color="#ff000000" />
|
|
||||||
</selector>
|
|
@ -1,20 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item android:color="#50000000" />
|
|
||||||
</selector>
|
|
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 245 B |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 443 B |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 554 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.2 KiB |