feat(ui): modernização visual Material 3 (v0.3.0)
- Edge-to-edge (enableEdgeToEdge) com Scaffold/insets em todas as telas - Compose BOM 2024.12 -> 2025.06; tipografia e tema com dynamic color - SyncBanner colorido removido -> SyncStatusRow compacto com chips M3 acionáveis (sync agora / abrir config / erro em errorContainer) - Lista: busca por título/conteúdo/tag (filterNotes testado), pull-to-refresh, animateItem, contentType, estado vazio com CTA - Ícones no lugar de emoji (pasta, presença, exclusão, aviso) - Editor: chip de presença acessível; imports limpos - Teste unitário de busca (NoteSearchTest) - versionCode 5 / versionName 0.3.0
This commit is contained in:
1 parent
8561ae2f8b
commit
a8c8a5a998
7 files changed
+296
-127
No files matched your search
@@ -0,0 +1,20 @@
|
||||
package com.labexposed.notas.ui
|
||||
|
||||
import com.labexposed.notas.data.local.NoteEntity
|
||||
|
||||
internal fun filterNotes(
|
||||
notes: List<NoteEntity>,
|
||||
query: String,
|
||||
categoryId: String? = null,
|
||||
tag: String? = null,
|
||||
): List<NoteEntity> {
|
||||
val normalizedQuery = query.trim()
|
||||
return notes.filter { note ->
|
||||
(categoryId == null || note.categories.split(",").contains(categoryId)) &&
|
||||
(tag == null || note.tags.split(",").contains(tag)) &&
|
||||
(normalizedQuery.isEmpty() ||
|
||||
note.title.contains(normalizedQuery, ignoreCase = true) ||
|
||||
note.content.contains(normalizedQuery, ignoreCase = true) ||
|
||||
note.tags.split(",").any { it.contains(normalizedQuery, ignoreCase = true) })
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user