Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fallenstardust
YGOMobile
Commits
a35f00d1
Commit
a35f00d1
authored
Oct 06, 2021
by
kenan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
搜索
parent
92aae885
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
45 deletions
+32
-45
mobile/src/main/java/cn/garymb/ygomobile/loader/CardKeyWord.java
...src/main/java/cn/garymb/ygomobile/loader/CardKeyWord.java
+25
-24
mobile/src/main/java/cn/garymb/ygomobile/loader/CardLoader.java
.../src/main/java/cn/garymb/ygomobile/loader/CardLoader.java
+0
-2
mobile/src/main/java/cn/garymb/ygomobile/loader/ImageLoader.java
...src/main/java/cn/garymb/ygomobile/loader/ImageLoader.java
+2
-2
mobile/src/main/java/ocgcore/data/Card.java
mobile/src/main/java/ocgcore/data/Card.java
+2
-2
mobile/src/main/res/xml/shortcuts.xml
mobile/src/main/res/xml/shortcuts.xml
+3
-15
No files found.
mobile/src/main/java/cn/garymb/ygomobile/loader/CardKeyWord.java
View file @
a35f00d1
...
...
@@ -3,6 +3,8 @@ package cn.garymb.ygomobile.loader;
import
android.text.TextUtils
;
import
android.util.Log
;
import
androidx.annotation.NonNull
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -18,33 +20,32 @@ public class CardKeyWord {
public
CardKeyWord
(
String
word
)
{
this
.
word
=
word
;
if
(!
TextUtils
.
isEmpty
(
word
))
{
if
(
TextUtils
.
isDigitsOnly
(
word
))
{
if
(
TextUtils
.
isDigitsOnly
(
word
)
&&
word
.
length
()
>
5
)
{
//搜索卡密
filterList
.
add
(
new
CodeFilter
(
Long
.
parseLong
(
word
)));
}
else
{
String
[]
ws
=
word
.
split
(
" "
);
for
(
String
w
:
ws
)
{
if
(
TextUtils
.
isEmpty
(
w
))
{
continue
;
}
boolean
exclude
=
false
;
if
(
w
.
startsWith
(
"-"
))
{
exclude
=
true
;
}
String
[]
ws
=
word
.
split
(
" "
);
for
(
String
w
:
ws
)
{
if
(
TextUtils
.
isEmpty
(
w
))
{
continue
;
}
boolean
exclude
=
false
;
if
(
w
.
startsWith
(
"-"
))
{
exclude
=
true
;
w
=
w
.
substring
(
1
);
}
boolean
onlyText
=
false
;
if
(
w
.
startsWith
(
"\""
)
||
w
.
startsWith
(
"“"
)
||
w
.
startsWith
(
"”"
))
{
//只搜索文字
onlyText
=
true
;
if
(
w
.
endsWith
(
"\""
)
||
w
.
endsWith
(
"“"
)
||
w
.
endsWith
(
"”"
))
{
w
=
w
.
substring
(
1
,
w
.
length
()
-
1
);
}
else
{
w
=
w
.
substring
(
1
);
}
boolean
onlyText
=
false
;
if
(
w
.
startsWith
(
"\""
)
||
w
.
startsWith
(
"“"
)
||
w
.
startsWith
(
"”"
))
{
//只搜索文字
onlyText
=
true
;
if
(
w
.
endsWith
(
"\""
)
||
w
.
endsWith
(
"“"
)
||
w
.
endsWith
(
"”"
))
{
w
=
w
.
substring
(
1
,
w
.
length
()
-
1
);
}
else
{
w
=
w
.
substring
(
1
);
}
}
Log
.
d
(
TAG
,
"filter:word="
+
w
+
", exclude="
+
exclude
+
", onlyText="
+
onlyText
);
filterList
.
add
(
new
NameFilter
(
w
,
exclude
,
onlyText
));
}
Log
.
d
(
TAG
,
"filter:word="
+
w
+
", exclude="
+
exclude
+
", onlyText="
+
onlyText
);
filterList
.
add
(
new
NameFilter
(
w
,
exclude
,
onlyText
));
}
}
empty
=
filterList
.
size
()
==
0
;
...
...
@@ -72,10 +73,10 @@ public class CardKeyWord {
private
final
long
setcode
;
//包含系列,或者包含名字、描述
public
NameFilter
(
String
word
,
boolean
exclude
,
boolean
onlyText
)
{
public
NameFilter
(
@NonNull
String
word
,
boolean
exclude
,
boolean
onlyText
)
{
this
.
setcode
=
onlyText
?
0
:
DataManager
.
get
().
getStringManager
().
getSetCode
(
word
);
this
.
exclude
=
exclude
;
this
.
word
=
word
;
this
.
word
=
word
.
toLowerCase
()
;
if
(
this
.
setcode
>
0
){
Log
.
d
(
TAG
,
"filter:setcode="
+
setcode
+
", exclude="
+
exclude
+
", word="
+
word
);
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/loader/CardLoader.java
View file @
a35f00d1
...
...
@@ -29,7 +29,6 @@ import ocgcore.enums.LimitType;
public
class
CardLoader
implements
ICardSearcher
{
private
final
LimitManager
mLimitManager
;
private
final
CardManager
mCardManager
;
private
final
StringManager
mStringManager
;
private
final
Context
context
;
private
CallBack
mCallBack
;
private
LimitList
mLimitList
;
...
...
@@ -50,7 +49,6 @@ public class CardLoader implements ICardSearcher {
this
.
context
=
context
;
mLimitManager
=
DataManager
.
get
().
getLimitManager
();
mCardManager
=
DataManager
.
get
().
getCardManager
();
mStringManager
=
DataManager
.
get
().
getStringManager
();
mLimitList
=
mLimitManager
.
getTopLimit
();
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/loader/ImageLoader.java
View file @
a35f00d1
...
...
@@ -68,7 +68,7 @@ public class ImageLoader implements Closeable {
private
final
boolean
useCache
;
private
static
final
String
TAG
=
ImageLoader
.
class
.
getSimpleName
();
private
final
Map
<
String
,
ZipFile
>
zipFileCache
=
new
ConcurrentHashMap
<>();
private
final
Map
<
Long
,
Cache
>
zipDataCache
=
new
ConcurrentHashMap
<>();
private
final
Map
<
Long
,
ImageLoader
.
Cache
>
zipDataCache
=
new
ConcurrentHashMap
<>();
private
ZipFile
mDefaultZipFile
;
private
File
mPicsFile
;
...
...
@@ -182,7 +182,7 @@ public class ImageLoader implements Closeable {
try
{
RequestBuilder
<
Drawable
>
resource
=
GlideCompat
.
with
(
imageview
.
getContext
()).
load
(
file
);
setDefaults
(
resource
,
new
MediaStoreSignature
(
"image/*"
,
file
.
lastModified
(),
Type
.
origin
.
getId
()),
new
MediaStoreSignature
(
"image/*"
,
file
.
lastModified
(),
ImageLoader
.
Type
.
origin
.
getId
()),
pre
,
type
);
resource
.
into
(
imageview
);
}
catch
(
Exception
e
)
{
...
...
mobile/src/main/java/ocgcore/data/Card.java
View file @
a35f00d1
...
...
@@ -153,11 +153,11 @@ public class Card extends CardData implements Parcelable {
}
public
boolean
containsName
(
String
key
){
return
Name
!=
null
&&
Name
.
contains
(
key
);
return
Name
!=
null
&&
Name
.
toLowerCase
().
contains
(
key
);
}
public
boolean
containsDesc
(
String
key
){
return
Desc
!=
null
&&
Desc
.
contains
(
key
);
return
Desc
!=
null
&&
Desc
.
toLowerCase
().
contains
(
key
);
}
/**
...
...
mobile/src/main/res/xml/shortcuts.xml
View file @
a35f00d1
...
...
@@ -8,11 +8,7 @@
android:shortcutLongLabel=
"@string/mycard"
android:shortcutShortLabel=
"@string/mycard"
>
<intent
android:action=
"android.intent.action.VIEW"
android:targetClass=
"cn.garymb.ygomobile.ui.mycard.MyCardActivity"
android:targetPackage=
"cn.garymb.ygomobile"
/>
<categories
android:name=
"android.shortcut.conversation"
/>
<intent
android:targetClass=
"cn.garymb.ygomobile.ui.mycard.MyCardActivity"
/>
</shortcut>
<shortcut
android:enabled=
"true"
...
...
@@ -22,11 +18,7 @@
android:shortcutLongLabel=
"@string/card_search"
android:shortcutShortLabel=
"@string/card_search"
>
<intent
android:action=
"android.intent.action.VIEW"
android:targetClass=
"cn.garymb.ygomobile.ui.cards.CardSearchAcitivity"
android:targetPackage=
"cn.garymb.ygomobile"
/>
<categories
android:name=
"android.shortcut.conversation"
/>
<intent
android:targetClass=
"cn.garymb.ygomobile.ui.cards.CardSearchAcitivity"
/>
</shortcut>
<shortcut
android:enabled=
"true"
...
...
@@ -36,10 +28,6 @@
android:shortcutLongLabel=
"@string/deck_manager"
android:shortcutShortLabel=
"@string/deck_manager"
>
<intent
android:action=
"android.intent.action.VIEW"
android:targetClass=
"cn.garymb.ygomobile.ui.cards.DeckManagerActivity"
android:targetPackage=
"cn.garymb.ygomobile"
/>
<categories
android:name=
"android.shortcut.conversation"
/>
<intent
android:targetClass=
"cn.garymb.ygomobile.ui.cards.DeckManagerActivity"
/>
</shortcut>
</shortcuts>
\ No newline at end of file
Write
Preview
Markdown
is supported
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