Skip to content

Commit

Permalink
fix: #372 search string is encoded.
Browse files Browse the repository at this point in the history
  • Loading branch information
plateaukao committed May 24, 2024
1 parent f16d70a commit 74d0221
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# generated files
gen/

.kotlin/

# Local configuration file (sdk path, etc)
local.properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ object HelperUnit {
@JvmStatic
// return true if need permissions
fun needGrantStoragePermission(activity: Activity): Boolean {
@SuppressLint("NewApi")
if (Build.VERSION.SDK_INT in 23..28) {
val hasWriteExternalStoragePermission =
activity.checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ class ExternalSearchViewModel: ViewModel(), KoinComponent {
splitSearchItemInfo: SplitSearchItemInfo = currentSearchAction,
): String {
currentSearchText = searchText
val correctPattern =
if (splitSearchItemInfo.stringPattern.contains("%s")) splitSearchItemInfo.stringPattern
else "${splitSearchItemInfo.stringPattern}%s"
return correctPattern.format(URLEncoder.encode(searchText, "UTF-8"))
return if (splitSearchItemInfo.stringPattern.contains("%s"))
splitSearchItemInfo.stringPattern.format(URLEncoder.encode(searchText, "UTF-8"))
else "${splitSearchItemInfo.stringPattern}$searchText"
}
}

0 comments on commit 74d0221

Please sign in to comment.