Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed missing permission prompt on initial "Save as" launch ([#85])
- Fixed printing text files containing a "#" ([#104])

### Changed
- Search now ignores accents and diacritics ([#95])

## [1.2.3] - 2025-09-15
### Fixed
- Fixed folders showing up incorrectly as files in some cases ([#80])
Expand Down Expand Up @@ -79,6 +82,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#267]: https://github.com/FossifyOrg/File-Manager/issues/267
[#250]: https://github.com/FossifyOrg/File-Manager/issues/250
[#85]: https://github.com/FossifyOrg/File-Manager/issues/85
[#95]: https://github.com/FossifyOrg/File-Manager/issues/95
[#104]: https://github.com/FossifyOrg/File-Manager/issues/104

[Unreleased]: https://github.com/FossifyOrg/File-Manager/compare/1.2.3...HEAD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
return files
}

val normalizedText = text.normalizeString()
val sorting = context!!.config.getFolderSorting(path)
FileDirItem.sorting = context!!.config.getFolderSorting(currentPath)
val isSortingBySize = sorting and SORT_BY_SIZE != 0
Expand All @@ -386,7 +387,7 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
}

if (it.isDirectory) {
if (it.name.contains(text, true)) {
if (it.name.normalizeString().contains(normalizedText, true)) {
val fileDirItem = getListItemFromFile(it, isSortingBySize, HashMap(), false)
if (fileDirItem != null) {
files.add(fileDirItem)
Expand All @@ -395,7 +396,7 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF

files.addAll(searchFiles(text, it.absolutePath))
} else {
if (it.name.contains(text, true)) {
if (it.name.normalizeString().contains(normalizedText, true)) {
val fileDirItem = getListItemFromFile(it, isSortingBySize, HashMap(), false)
if (fileDirItem != null) {
files.add(fileDirItem)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import org.fossify.commons.extensions.getDoesFilePathExist
import org.fossify.commons.extensions.getFilenameFromPath
import org.fossify.commons.extensions.getLongValue
import org.fossify.commons.extensions.getStringValue
import org.fossify.commons.extensions.normalizeString
import org.fossify.commons.extensions.showErrorToast
import org.fossify.commons.helpers.VIEW_TYPE_GRID
import org.fossify.commons.helpers.VIEW_TYPE_LIST
Expand Down Expand Up @@ -242,7 +243,11 @@ class RecentsFragment(context: Context, attributeSet: AttributeSet) : MyViewPage

override fun searchQueryChanged(text: String) {
lastSearchedText = text
val filtered = filesIgnoringSearch.filter { it.mName.contains(text, true) }.toMutableList() as ArrayList<ListItem>
val normalizedText = text.normalizeString()
val filtered = filesIgnoringSearch.filter {
it.mName.normalizeString().contains(normalizedText, true)
}.toMutableList() as ArrayList<ListItem>

binding.apply {
(recentsList.adapter as? ItemsAdapter)?.updateItems(filtered, text)
recentsPlaceholder.beVisibleIf(filtered.isEmpty())
Expand Down
Loading