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
16e97eda
Commit
16e97eda
authored
Jul 12, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善显示
parent
0feab90d
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
173 additions
and
228 deletions
+173
-228
mobile/src/main/java/cn/garymb/ygomobile/YGOStarter.java
mobile/src/main/java/cn/garymb/ygomobile/YGOStarter.java
+17
-27
mobile/src/main/res/layout/dialog_cardinfo_small.xml
mobile/src/main/res/layout/dialog_cardinfo_small.xml
+156
-201
No files found.
mobile/src/main/java/cn/garymb/ygomobile/YGOStarter.java
View file @
16e97eda
...
@@ -67,29 +67,28 @@ public class YGOStarter {
...
@@ -67,29 +67,28 @@ public class YGOStarter {
private
static
ImageLoader
imageLoader
;
private
static
ImageLoader
imageLoader
;
private
static
StringManager
mStringManager
;
private
static
StringManager
mStringManager
;
private
static
SparseArray
<
Card
>
cards
;
private
static
SparseArray
<
Card
>
cards
;
private
static
Context
mContext
;
private
static
View
view
;
private
static
View
view
;
public
static
void
RandomCardDetail
(
Context
context
,
Card
cardInfo
)
{
public
static
void
RandomCardDetail
(
Context
context
,
Card
cardInfo
)
{
mContext
=
context
;
ThreeDLayoutUtil
viewCardDetail
=
(
ThreeDLayoutUtil
)
inflate
(
context
,
R
.
layout
.
dialog_cardinfo_small
,
null
);
View
viewCardDetail
=
inflate
(
mContext
,
R
.
layout
.
dialog_cardinfo_small
,
null
);
cardImage
=
viewCardDetail
.
findViewById
(
R
.
id
.
card_image_toast
);
cardImage
=
viewCardDetail
.
findViewById
(
R
.
id
.
card_image
);
name
=
viewCardDetail
.
findViewById
(
R
.
id
.
card_name_toast
);
name
=
viewCardDetail
.
findViewById
(
R
.
id
.
text_name
);
level
=
viewCardDetail
.
findViewById
(
R
.
id
.
card_level_toast
);
level
=
viewCardDetail
.
findViewById
(
R
.
id
.
card_level
);
linkArrow
=
viewCardDetail
.
findViewById
(
R
.
id
.
link_arrows_toast
);
linkArrow
=
viewCardDetail
.
findViewById
(
R
.
id
.
detail_link_arrows
);
race
=
viewCardDetail
.
findViewById
(
R
.
id
.
card_race_toast
);
race
=
viewCardDetail
.
findViewById
(
R
.
id
.
card_race
);
attrView
=
viewCardDetail
.
findViewById
(
R
.
id
.
card_attr_toast
);
attrView
=
viewCardDetail
.
findViewById
(
R
.
id
.
card_attribute
);
type
=
viewCardDetail
.
findViewById
(
R
.
id
.
card_type_toast
);
type
=
viewCardDetail
.
findViewById
(
R
.
id
.
card_type
);
cardAtk
=
viewCardDetail
.
findViewById
(
R
.
id
.
card_atk_toast
);
cardAtk
=
viewCardDetail
.
findViewById
(
R
.
id
.
card_atk
);
cardDef
=
viewCardDetail
.
findViewById
(
R
.
id
.
card_def_toast
);
cardDef
=
viewCardDetail
.
findViewById
(
R
.
id
.
card_def
);
atkdefView
=
viewCardDetail
.
findViewById
(
R
.
id
.
layout_atkdef2_toast
);
atkdefView
=
viewCardDetail
.
findViewById
(
R
.
id
.
layout_atkdef2
);
desc
=
viewCardDetail
.
findViewById
(
R
.
id
.
text_desc_toast
);
desc
=
viewCardDetail
.
findViewById
(
R
.
id
.
text_desc
);
monsterlayout
=
viewCardDetail
.
findViewById
(
R
.
id
.
layout_monster
);
layout_detail_p_scale
=
viewCardDetail
.
findViewById
(
R
.
id
.
detail_p_scale
);
layout_detail_p_scale
=
viewCardDetail
.
findViewById
(
R
.
id
.
detail_p_scale
);
detail_cardscale
=
viewCardDetail
.
findViewById
(
R
.
id
.
detail_cardscale
);
detail_cardscale
=
viewCardDetail
.
findViewById
(
R
.
id
.
detail_cardscale
);
if
(
cardInfo
==
null
)
return
;
if
(
cardInfo
==
null
)
return
;
mStringManager
=
DataManager
.
get
().
getStringManager
();
imageLoader
=
ImageLoader
.
get
(
context
);
imageLoader
.
bindImage
(
cardImage
,
cardInfo
.
Code
,
null
,
true
);
imageLoader
.
bindImage
(
cardImage
,
cardInfo
.
Code
,
null
,
true
);
name
.
setText
(
cardInfo
.
Name
);
name
.
setText
(
cardInfo
.
Name
);
type
.
setText
(
CardUtils
.
getAllTypeString
(
cardInfo
,
mStringManager
).
replace
(
"/"
,
"|"
));
type
.
setText
(
CardUtils
.
getAllTypeString
(
cardInfo
,
mStringManager
).
replace
(
"/"
,
"|"
));
...
@@ -97,20 +96,13 @@ public class YGOStarter {
...
@@ -97,20 +96,13 @@ public class YGOStarter {
desc
.
setText
(
cardInfo
.
Desc
);
desc
.
setText
(
cardInfo
.
Desc
);
if
(
cardInfo
.
isType
(
CardType
.
Monster
))
{
if
(
cardInfo
.
isType
(
CardType
.
Monster
))
{
atkdefView
.
setVisibility
(
View
.
VISIBLE
);
atkdefView
.
setVisibility
(
View
.
VISIBLE
);
monsterlayout
.
setVisibility
(
View
.
VISIBLE
);
race
.
setVisibility
(
View
.
VISIBLE
);
race
.
setVisibility
(
View
.
VISIBLE
);
String
star
=
"★"
+
cardInfo
.
getStar
();
String
star
=
"★"
+
cardInfo
.
getStar
();
level
.
setText
(
star
);
level
.
setText
(
star
);
if
(
cardInfo
.
isType
(
CardType
.
Xyz
))
{
if
(
cardInfo
.
isType
(
CardType
.
Xyz
))
{
level
.
setTextColor
(
mC
ontext
.
getResources
().
getColor
(
R
.
color
.
star_rank
));
level
.
setTextColor
(
c
ontext
.
getResources
().
getColor
(
R
.
color
.
star_rank
));
}
else
{
}
else
{
level
.
setTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
star
));
level
.
setTextColor
(
context
.
getResources
().
getColor
(
R
.
color
.
star
));
}
if
(
cardInfo
.
isType
(
CardType
.
Pendulum
))
{
layout_detail_p_scale
.
setVisibility
(
View
.
VISIBLE
);
detail_cardscale
.
setText
(
String
.
valueOf
(
cardInfo
.
LScale
));
}
else
{
layout_detail_p_scale
.
setVisibility
(
View
.
GONE
);
}
}
cardAtk
.
setText
((
cardInfo
.
Attack
<
0
?
"?"
:
String
.
valueOf
(
cardInfo
.
Attack
)));
cardAtk
.
setText
((
cardInfo
.
Attack
<
0
?
"?"
:
String
.
valueOf
(
cardInfo
.
Attack
)));
//连接怪兽设置
//连接怪兽设置
...
@@ -128,11 +120,10 @@ public class YGOStarter {
...
@@ -128,11 +120,10 @@ public class YGOStarter {
}
else
{
}
else
{
atkdefView
.
setVisibility
(
View
.
GONE
);
atkdefView
.
setVisibility
(
View
.
GONE
);
race
.
setVisibility
(
View
.
GONE
);
race
.
setVisibility
(
View
.
GONE
);
monsterlayout
.
setVisibility
(
View
.
GONE
);
level
.
setVisibility
(
View
.
GONE
);
level
.
setVisibility
(
View
.
GONE
);
linkArrow
.
setVisibility
(
View
.
GONE
);
linkArrow
.
setVisibility
(
View
.
GONE
);
}
}
Toast
toast
=
new
Toast
(
mC
ontext
);
Toast
toast
=
new
Toast
(
c
ontext
);
toast
.
setView
(
viewCardDetail
);
toast
.
setView
(
viewCardDetail
);
toast
.
setDuration
(
Toast
.
LENGTH_LONG
);
toast
.
setDuration
(
Toast
.
LENGTH_LONG
);
toast
.
show
();
toast
.
show
();
...
@@ -269,7 +260,6 @@ public class YGOStarter {
...
@@ -269,7 +260,6 @@ public class YGOStarter {
//random carddetail first
//random carddetail first
VUiKit
.
defer
().
when
(()
->
{
VUiKit
.
defer
().
when
(()
->
{
mCardManager
=
DataManager
.
get
().
getCardManager
();
mCardManager
=
DataManager
.
get
().
getCardManager
();
mStringManager
=
DataManager
.
get
().
getStringManager
();
cards
=
mCardManager
.
getAllCards
();
cards
=
mCardManager
.
getAllCards
();
}).
fail
((
e
)
->
{
}).
fail
((
e
)
->
{
//if failed, random tips second
//if failed, random tips second
...
...
mobile/src/main/res/layout/dialog_cardinfo_small.xml
View file @
16e97eda
This diff is collapsed.
Click to expand it.
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