mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-21 02:50:07 +01:00
adding un/locking itself
This commit is contained in:
parent
ae48ce07a3
commit
d562df65b3
@ -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'
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user