Hide text from locked notes

This closes #659
This commit is contained in:
Ensar Sarajčić
2023-08-03 10:49:10 +02:00
parent 24af1a908e
commit 037d8f0147
4 changed files with 22 additions and 34 deletions

View File

@ -12,6 +12,7 @@ import com.google.gson.reflect.TypeToken
import com.simplemobiletools.commons.activities.BaseSimpleActivity
import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
import com.simplemobiletools.commons.extensions.beGoneIf
import com.simplemobiletools.commons.extensions.beVisibleIf
import com.simplemobiletools.commons.extensions.getColoredDrawableWithColor
import com.simplemobiletools.commons.extensions.isBlackAndWhiteTheme
import com.simplemobiletools.commons.helpers.LOWER_ALPHA_INT
@ -22,6 +23,7 @@ import com.simplemobiletools.notes.pro.extensions.config
import com.simplemobiletools.notes.pro.models.ChecklistItem
import com.simplemobiletools.notes.pro.models.Note
import com.simplemobiletools.notes.pro.models.NoteType
import kotlinx.android.synthetic.main.open_note_item.view.icon_lock
import kotlinx.android.synthetic.main.open_note_item.view.open_note_item_holder
import kotlinx.android.synthetic.main.open_note_item.view.open_note_item_text
import kotlinx.android.synthetic.main.open_note_item.view.open_note_item_title
@ -70,7 +72,8 @@ class OpenNoteAdapter(
setTextColor(properPrimaryColor)
}
val formattedText = note.getFormattedValue(context)
open_note_item_text.beGoneIf(formattedText.isNullOrBlank())
open_note_item_text.beGoneIf(formattedText.isNullOrBlank() || note.isLocked())
icon_lock.beVisibleIf(note.isLocked())
open_note_item_text.apply {
text = formattedText
setTextColor(textColor)