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
baf0cc48
Commit
baf0cc48
authored
Dec 03, 2023
by
wangfugui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复先行卡页面图片加载时缓存机制存在的问题
parent
305f65ec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
+4
-0
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardListAdapter.java
...n/java/cn/garymb/ygomobile/ex_card/ExCardListAdapter.java
+5
-1
mobile/src/main/java/cn/garymb/ygomobile/utils/ServerUtil.java
...e/src/main/java/cn/garymb/ygomobile/utils/ServerUtil.java
+1
-2
No files found.
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
View file @
baf0cc48
...
...
@@ -166,6 +166,10 @@ public interface Constants {
String
URL_YGO233_ADVANCE
=
""
;
//"https://ygo233.com/pre#pre_release_cards";//关闭233先行卡服务器,但不要删除该字段,许多未调用的遗留代码使用该contant
String
URL_YGO233_DATAVER
=
"https://cdn02.moecube.com:444/ygopro-super-pre/data/version.txt"
;
String
URL_PRE_CARD
=
"https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release.json"
;
// String URL_YGO233_DATAVER = "http://192.168.0.103:8006/ygo/version.txt";
// String URL_PRE_CARD = "http://192.168.0.103:8006/ygo/test-release.json";
String
URL_YGO233_FILE
=
"https://cdn02.moecube.com:444/ygopro-super-pre/archive/ygopro-super-pre.ypk"
;
String
URL_YGO233_FILE_ALT
=
"https://cdn02.moecube.com:444/ygopro-super-pre/archive/ygopro-super-pre.ypk"
;
String
URL_YGO233_BUG_REPORT
=
"https://ygo233.com/pre#faq"
;
...
...
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardListAdapter.java
View file @
baf0cc48
...
...
@@ -26,6 +26,7 @@ import cn.garymb.ygomobile.utils.LogUtil;
import
cn.garymb.ygomobile.utils.OkhttpUtil
;
import
cn.garymb.ygomobile.utils.ServerUtil
;
import
cn.garymb.ygomobile.utils.glide.GlideCompat
;
import
cn.garymb.ygomobile.utils.glide.StringSignature
;
import
okhttp3.Response
;
public
class
ExCardListAdapter
extends
BaseQuickAdapter
<
ExCardData
,
BaseViewHolder
>
{
...
...
@@ -117,9 +118,12 @@ public class ExCardListAdapter extends BaseQuickAdapter<ExCardData, BaseViewHold
/* 如果能查到版本号,则显示图片,利用glide的signature,将版本号和url作为signature,由glide判断是否使用缓存 */
if
(
ServerUtil
.
exCardState
==
ServerUtil
.
ExCardState
.
NEED_UPDATE
||
ServerUtil
.
exCardState
==
ServerUtil
.
ExCardState
.
UPDATED
)
{
//ServerUtil.serverExCardVersion = "1701569942";
StringSignature
signature
=
new
StringSignature
(
ServerUtil
.
serverExCardVersion
);
ObjectKey
key
=
new
ObjectKey
(
ServerUtil
.
serverExCardVersion
);
RequestBuilder
<
Drawable
>
resource
=
GlideCompat
.
with
(
imageview
.
getContext
()).
load
(
item
.
getPicUrl
())
.
signature
(
new
ObjectKey
(
ServerUtil
.
serverExCardVersion
+
item
.
getPicUrl
())
);
.
signature
(
signature
);
resource
.
placeholder
(
R
.
drawable
.
unknown
);
resource
.
error
(
R
.
drawable
.
unknown
);
resource
.
into
(
imageview
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/utils/ServerUtil.java
View file @
baf0cc48
...
...
@@ -78,7 +78,7 @@ public class ServerUtil {
String
newVer
=
response
.
body
().
string
();
/* 服务器有点怪,返回的版本号带个\n,要去掉 */
if
(
newVer
.
endsWith
(
"\n"
))
{
newVer
=
newVer
.
substring
(
0
,
newVer
.
length
()
-
2
);
newVer
=
newVer
.
substring
(
0
,
newVer
.
length
()
-
1
);
}
serverExCardVersion
=
newVer
;
...
...
@@ -218,7 +218,6 @@ public class ServerUtil {
mServerInfo
.
setPlayerName
(
playerName
);
boolean
hasServer
=
false
;
if
(
list
!=
null
)
{
serverInfos
.
clear
();
...
...
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