Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
BlissLauncher
Commits
99f8bb10
Commit
99f8bb10
authored
May 16, 2022
by
Aayush Gupta
Browse files
Merge branch '1208-search_ignore_accents' into 'master'
Remove accents from search strings See merge request
!94
parents
15dc8a71
fb442a74
Pipeline
#185961
passed with stage
in 4 minutes and 19 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/build.gradle
View file @
99f8bb10
...
...
@@ -159,6 +159,9 @@ dependencies {
implementation
Libs
.
AndroidX
.
Room
.
runtime
kapt
Libs
.
AndroidX
.
Room
.
compiler
// Apache Commons
implementation
Libs
.
ApacheCommons
.
commonsLang
// Unit test dependencies
testImplementation
Libs
.
junit
testImplementation
Libs
.
robolectric
...
...
app/src/main/java/foundation/e/blisslauncher/core/Utilities.java
View file @
99f8bb10
...
...
@@ -14,6 +14,8 @@ import android.util.TypedValue;
import
android.view.View
;
import
android.view.ViewGroup
;
import
org.apache.commons.lang3.StringUtils
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.lang.reflect.Method
;
...
...
@@ -217,4 +219,8 @@ public class Utilities {
public
static
int
boundToRange
(
int
value
,
int
lowerBound
,
int
upperBound
)
{
return
Math
.
max
(
lowerBound
,
Math
.
min
(
value
,
upperBound
));
}
public
static
String
stripCaseAndAccents
(
String
input
)
{
return
StringUtils
.
stripAccents
(
input
.
toLowerCase
());
}
}
app/src/main/java/foundation/e/blisslauncher/features/launcher/LauncherActivity.java
View file @
99f8bb10
...
...
@@ -79,6 +79,7 @@ import androidx.viewpager.widget.ViewPager;
import
com.jakewharton.rxbinding3.widget.RxTextView
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Collections
;
...
...
@@ -1595,7 +1596,7 @@ public class LauncherActivity extends AppCompatActivity implements
private
Observable
<
SuggestionsResult
>
searchForLauncherItems
(
CharSequence
charSequence
)
{
String
query
=
charSequence
.
toString
()
.
toLowerCase
(
);
String
query
=
Utilities
.
stripCaseAndAccents
(
charSequence
.
toString
());
SuggestionsResult
suggestionsResult
=
new
SuggestionsResult
(
query
);
List
<
LauncherItem
>
launcherItems
=
new
ArrayList
<>();
...
...
@@ -1606,11 +1607,11 @@ public class LauncherActivity extends AppCompatActivity implements
if
(
launcherItem
.
itemType
==
Constants
.
ITEM_TYPE_FOLDER
)
{
FolderItem
folderItem
=
(
FolderItem
)
launcherItem
;
for
(
LauncherItem
item
:
folderItem
.
items
)
{
if
(
item
.
title
.
toString
()
.
toLowerCase
(
).
contains
(
query
))
{
if
(
Utilities
.
stripCaseAndAccents
(
item
.
title
.
toString
()).
contains
(
query
))
{
launcherItems
.
add
(
item
);
}
}
}
else
if
(
launcherItem
.
title
.
toString
()
.
toLowerCase
(
).
contains
(
query
))
{
}
else
if
(
Utilities
.
stripCaseAndAccents
(
launcherItem
.
title
.
toString
()).
contains
(
query
))
{
launcherItems
.
add
(
launcherItem
);
}
}
...
...
@@ -1622,11 +1623,11 @@ public class LauncherActivity extends AppCompatActivity implements
if
(
launcherItem
.
itemType
==
Constants
.
ITEM_TYPE_FOLDER
)
{
FolderItem
folderItem
=
(
FolderItem
)
launcherItem
;
for
(
LauncherItem
item
:
folderItem
.
items
)
{
if
(
item
.
title
.
toString
()
.
toLowerCase
(
).
contains
(
query
))
{
if
(
Utilities
.
stripCaseAndAccents
(
item
.
title
.
toString
()).
contains
(
query
))
{
launcherItems
.
add
(
item
);
}
}
}
else
if
(
launcherItem
.
title
.
toString
()
.
toLowerCase
(
).
contains
(
query
))
{
}
else
if
(
Utilities
.
stripCaseAndAccents
(
launcherItem
.
title
.
toString
()).
contains
(
query
))
{
launcherItems
.
add
(
launcherItem
);
}
}
...
...
buildSrc/src/main/java/foundation/e/blisslauncher/buildsrc/Dependencies.kt
View file @
99f8bb10
...
...
@@ -34,6 +34,10 @@ object Libs {
const
val
robolectric
=
"org.robolectric:robolectric:${Versions.robolectric}"
const
val
mockK
=
"io.mockk:mockk:${Versions.mockK}"
object
ApacheCommons
{
const
val
commonsLang
=
"org.apache.commons:commons-lang3:3.12.0"
}
object
Google
{
const
val
firebaseCore
=
"com.google.firebase:firebase-core:${Versions.firebase_core}"
const
val
crashlytics
=
"com.crashlytics.sdk.android:crashlytics:${Versions.crashlytics}"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment