From d562df65b3eaa22f04fbf106737a6667d1cb6515 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 20 May 2021 21:19:29 +0200 Subject: [PATCH] adding un/locking itself --- app/build.gradle | 2 +- app/src/main/AndroidManifest.xml | 5 ++--- .../notes/pro/activities/MainActivity.kt | 21 +++++++++++++++++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 84aa8b85..0d228426 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -56,7 +56,7 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:f07ca31126' + implementation 'com.github.SimpleMobileTools:Simple-Commons:1b7865f1bf' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'androidx.documentfile:documentfile:1.0.1' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e558a4ef..36bd7705 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -8,9 +8,8 @@ - + + + if (success) { + mCurrentNote.protectionHash = hash + mCurrentNote.protectionType = type + NotesHelper(this).insertOrUpdateNote(mCurrentNote) { + invalidateOptionsMenu() + } + } + } } private fun unlockNote() { - + SecurityDialog(this, mCurrentNote.protectionHash, mCurrentNote.protectionType) { hash, type, success -> + if (success) { + mCurrentNote.protectionHash = "" + mCurrentNote.protectionType = PROTECTION_NONE + NotesHelper(this).insertOrUpdateNote(mCurrentNote) { + invalidateOptionsMenu() + } + } + } } fun currentNoteTextChanged(newText: String, showUndo: Boolean, showRedo: Boolean) {