|
|
|
@ -19,6 +19,7 @@ package net.micode.notes.ui;
|
|
|
|
|
import android.app.Activity;
|
|
|
|
|
import android.app.AlarmManager;
|
|
|
|
|
import android.app.AlertDialog;
|
|
|
|
|
import android.app.Dialog;
|
|
|
|
|
import android.app.PendingIntent;
|
|
|
|
|
import android.app.SearchManager;
|
|
|
|
|
import android.appwidget.AppWidgetManager;
|
|
|
|
@ -43,6 +44,7 @@ import android.view.MotionEvent;
|
|
|
|
|
import android.view.View;
|
|
|
|
|
import android.view.View.OnClickListener;
|
|
|
|
|
import android.view.WindowManager;
|
|
|
|
|
import android.view.inputmethod.InputMethodManager;
|
|
|
|
|
import android.widget.CheckBox;
|
|
|
|
|
import android.widget.CompoundButton;
|
|
|
|
|
import android.widget.CompoundButton.OnCheckedChangeListener;
|
|
|
|
@ -287,6 +289,8 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
mWorkingNote.getModifiedDate(), DateUtils.FORMAT_SHOW_DATE
|
|
|
|
|
| DateUtils.FORMAT_NUMERIC_DATE | DateUtils.FORMAT_SHOW_TIME
|
|
|
|
|
| DateUtils.FORMAT_SHOW_YEAR));
|
|
|
|
|
// mPasword=mWorkingNote.getPassword();
|
|
|
|
|
// if(mPassword)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* TODO: Add the menu for setting alert. Currently disable it because the DateTimePicker
|
|
|
|
@ -540,6 +544,34 @@ public class NoteEditActivity extends Activity implements OnClickListener,
|
|
|
|
|
} else if (itemId == R.id.menu_delete_remind) {
|
|
|
|
|
mWorkingNote.setAlertDate(0, false);
|
|
|
|
|
}
|
|
|
|
|
else if (itemId == R.id.menu_enter_private_mode){
|
|
|
|
|
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
|
|
|
|
View view = LayoutInflater.from(this).inflate(R.layout.dialog_edit_text,null);
|
|
|
|
|
final EditText etName = (EditText)view.findViewById(R.id.et_foler_name);
|
|
|
|
|
etName.setText("");
|
|
|
|
|
etName.setHint("请输入密码");
|
|
|
|
|
builder.setTitle("为便签设置新密码");
|
|
|
|
|
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
String password = etName.getText().toString();
|
|
|
|
|
mWorkingNote.setPassword(password);
|
|
|
|
|
Toast.makeText(NoteEditActivity.this,"密码设置成功", Toast.LENGTH_SHORT).show();
|
|
|
|
|
InputMethodManager inputMethodManager =(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
|
|
|
inputMethodManager.hideSoftInputFromWindow(etName.getWindowToken(),0);
|
|
|
|
|
dialog.dismiss();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
builder.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
InputMethodManager inputMethodManager = (InputMethodManager)
|
|
|
|
|
getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
|
|
|
inputMethodManager.hideSoftInputFromWindow(etName.getWindowToken(),0);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
final Dialog dialog = builder.setView(view).show();
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|