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
abb707b5
Commit
abb707b5
authored
Jan 22, 2020
by
feihuaduo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
只下载cards.cdb里面有的卡片的高清卡图
parent
b88c7908
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
42 deletions
+44
-42
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
...rc/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
+44
-42
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
View file @
abb707b5
...
...
@@ -47,6 +47,7 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
private
static
final
int
TYPE_DOWNLOAD_CARD_IMAGE_ING
=
2
;
private
static
final
String
TAG
=
"CardDetail"
;
private
final
CardManager
cardManager
;
private
ImageView
cardImage
;
private
TextView
name
;
private
TextView
desc
;
...
...
@@ -139,7 +140,9 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
attrView
=
bind
(
R
.
id
.
card_attribute
);
lb_setcode
=
bind
(
R
.
id
.
label_setcode
);
cardManager
=
new
CardManager
(
AppsSettings
.
get
().
getDataBaseFile
().
getAbsolutePath
(),
null
);
//加载数据库中所有卡片卡片
cardManager
.
loadCards
();
close
.
setOnClickListener
((
v
)
->
{
if
(
mListener
!=
null
)
{
mListener
.
onClose
();
...
...
@@ -331,33 +334,32 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
dialog
.
dismiss
();
ll_bar
.
setVisibility
(
View
.
VISIBLE
);
ll_bar
.
startAnimation
(
AnimationUtils
.
loadAnimation
(
context
,
R
.
anim
.
in_from_top
));
downloadCardImage
(
code
,
file
);
}
});
dialogPlus
.
show
();
return
true
;
}
});
//先显示普通卡片大图,判断如果没有高清图就下载
imageLoader
.
bindImage
(
photoView
,
code
,
null
,
true
);
if
(!
file
.
exists
())
{
ll_bar
.
setVisibility
(
View
.
VISIBLE
);
ll_bar
.
startAnimation
(
AnimationUtils
.
loadAnimation
(
context
,
R
.
anim
.
in_from_top
));
downloadCardImage
(
code
,
file
);
}
}
private
void
downloadCardImage
(
int
code
,
File
file
)
{
if
(
cardManager
.
getCard
(
code
)
==
null
)
{
YGOUtil
.
show
(
"先行卡没有高清卡图"
);
return
;
}
isDownloadCardImage
=
false
;
CardManager
cdb
=
new
CardManager
(
file
.
getAbsolutePath
(),
null
);
if
(
cdb
.
getCard
(
code
)
!=
null
)
{
ll_bar
.
setVisibility
(
View
.
VISIBLE
);
ll_bar
.
startAnimation
(
AnimationUtils
.
loadAnimation
(
context
,
R
.
anim
.
in_from_top
));
DownloadUtil
.
get
().
download
(
YGOUtil
.
getCardImageDetailUrl
(
code
),
file
.
getParent
(),
file
.
getName
(),
new
DownloadUtil
.
OnDownloadListener
()
{
@Override
public
void
onDownloadSuccess
(
File
file
)
{
...
...
@@ -395,7 +397,7 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
handler
.
sendMessage
(
message
);
}
});
}
}
public
void
onPreCard
()
{
...
...
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