同意
pull/9/head
pvqf6mep3 3 years ago
commit fee5ff4369

@ -36,6 +36,8 @@ public class DeletePasscodeActivity extends AppCompatActivity {
Toast.makeText(DeletePasscodeActivity.this, R.string.note_passcode_deleted, Toast.LENGTH_SHORT).show();
mWorkingNote.setPasscode("");
mWorkingNote.saveNote();
NoteEditActivity Activity = new NoteEditActivity();
Activity.NoteEditActivity.finish();
Intent intent = new Intent(DeletePasscodeActivity.this, NoteEditActivity.class);
intent.setAction(Intent.ACTION_VIEW);
intent.putExtra(Intent.EXTRA_UID, noteId);

@ -155,14 +155,14 @@ public class NoteEditActivity extends Activity implements OnClickListener,
private Pattern mPattern;
private boolean Locked; /* 用以判断是否已解锁 */
private boolean verified = false;
static Activity NoteEditActivity;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.note_edit);
NoteEditActivity = this;
if (savedInstanceState == null && !initActivityState(getIntent())) {
finish();
return;
@ -273,10 +273,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
if (intent.hasExtra("lock")) {
Locked = false;
}
if (intent.hasExtra("verified")){
verified = true;
}
return true;
}
@ -575,6 +571,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
break;
case R.id.menu_set_star:
mWorkingNote.setStar(mWorkingNote.getStarId()==1? "0" : "1");
System.out.println(mWorkingNote.hasPasscode());
break;
//设置密码
case R.id.menu_set_passcode:
@ -582,6 +579,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
break;
//删除密码
case R.id.menu_delete_passcode:
System.out.println(mWorkingNote.hasPasscode());
deletePasscode();
break;
case R.id.menu_delete:
@ -953,7 +951,8 @@ public class NoteEditActivity extends Activity implements OnClickListener,
Intent intent = new Intent(this,DeletePasscodeActivity.class);
intent.putExtra(Intent.EXTRA_UID, mWorkingNote.getNoteId());
startActivity(intent);
finish();
//finish();
saveNote();
}
saveNote();
}

@ -27,6 +27,7 @@ public class SetLockActivity extends AppCompatActivity {
*/
private boolean isFirst = true;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -35,7 +36,17 @@ public class SetLockActivity extends AppCompatActivity {
initViews();
initEvents();
}
public void onBackPressed() {
super.onBackPressed();//注释掉这行,back键不退出activity
Intent pre = getIntent();
//将密码写入数据库
long noteId = pre.getLongExtra(Intent.EXTRA_UID, 0);
Intent intent = new Intent(SetLockActivity.this, NoteEditActivity.class);
intent.setAction(Intent.ACTION_VIEW);
intent.putExtra("lock",0);
intent.putExtra(Intent.EXTRA_UID, noteId);
startActivity(intent);
}
private void initEvents() {
mLockPatternView.setLockListener(new LockPatternView.OnLockListener() {
@Override

@ -35,7 +35,7 @@ public class UnlockActivity extends AppCompatActivity {
public boolean isPassword() {
if (mPasswordStr.equals(password)) {
Toast.makeText(UnlockActivity.this, "密码正确", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(UnlockActivity.this, NoteEditActivity.class);
Intent intent = new Intent(UnlockActivity.this,NoteEditActivity.class);
intent.setAction(Intent.ACTION_VIEW);
intent.putExtra("lock",0);
intent.putExtra(Intent.EXTRA_UID, noteId);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -92,8 +92,8 @@
<ImageView
android:id="@+id/iv_lock"
android:layout_width="17dp"
android:layout_height="17dp"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_gravity="top|left"
android:layout_marginRight="15sp" />
</FrameLayout>

Loading…
Cancel
Save