mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-19 10:00:16 +01:00
Refactored ArrayList to List
This commit is contained in:
parent
8c99986e25
commit
66546df0f1
@ -67,7 +67,7 @@ class MainActivity : SimpleActivity() {
|
||||
private val PICK_EXPORT_NOTES_INTENT = 4
|
||||
|
||||
private lateinit var mCurrentNote: Note
|
||||
private var mNotes = ArrayList<Note>()
|
||||
private var mNotes = listOf<Note>()
|
||||
private var mAdapter: NotesPagerAdapter? = null
|
||||
private var noteViewWithTextSelected: MyEditText? = null
|
||||
private var saveNoteButton: MenuItem? = null
|
||||
|
@ -13,7 +13,7 @@ import com.simplemobiletools.notes.pro.models.Note
|
||||
import java.io.File
|
||||
|
||||
class NotesHelper(val context: Context) {
|
||||
fun getNotes(callback: (notes: ArrayList<Note>) -> Unit) {
|
||||
fun getNotes(callback: (notes: List<Note>) -> Unit) {
|
||||
ensureBackgroundThread {
|
||||
// make sure the initial note has enough time to be precreated
|
||||
if (context.config.appRunCount <= 1) {
|
||||
@ -21,8 +21,8 @@ class NotesHelper(val context: Context) {
|
||||
Thread.sleep(200)
|
||||
}
|
||||
|
||||
val notes = context.notesDB.getNotes() as ArrayList<Note>
|
||||
val notesToDelete = ArrayList<Note>(notes.size)
|
||||
val notes = context.notesDB.getNotes().toMutableList()
|
||||
val notesToDelete = mutableListOf<Note>()
|
||||
notes.forEach {
|
||||
if (it.path.isNotEmpty()) {
|
||||
if (!it.path.startsWith("content://") && !File(it.path).exists()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user