adding un/locking itself

This commit is contained in:
tibbi 2021-05-20 21:19:29 +02:00
parent ae48ce07a3
commit d562df65b3
3 changed files with 22 additions and 6 deletions

View File

@ -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'

View File

@ -8,9 +8,8 @@
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="28" />
<uses-permission
android:name="android.permission.USE_FINGERPRINT"
tools:node="remove"/>
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-feature
android:name="android.hardware.faketouch"

View File

@ -23,6 +23,7 @@ import android.widget.TextView
import com.simplemobiletools.commons.dialogs.ConfirmationAdvancedDialog
import com.simplemobiletools.commons.dialogs.FilePickerDialog
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
import com.simplemobiletools.commons.dialogs.SecurityDialog
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.*
import com.simplemobiletools.commons.models.FAQItem
@ -1064,11 +1065,27 @@ class MainActivity : SimpleActivity() {
}
private fun lockNote() {
SecurityDialog(this, "", SHOW_ALL_TABS) { hash, type, success ->
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) {