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
492ac89e
Commit
492ac89e
authored
Dec 11, 2019
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
具体信息如果有alias也显示
parent
01a9e8d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
29 deletions
+34
-29
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
...rc/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
+34
-29
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
View file @
492ac89e
...
...
@@ -15,6 +15,7 @@ import cn.garymb.ygomobile.ui.adapters.BaseAdapterPlus;
import
cn.garymb.ygomobile.utils.CardUtils
;
import
ocgcore.StringManager
;
import
ocgcore.data.Card
;
import
ocgcore.data.CardData
;
import
ocgcore.enums.CardType
;
/***
...
...
@@ -42,7 +43,7 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
private
TextView
cardcode
;
private
View
lb_setcode
;
private
ImageLoader
imageLoader
;
private
View
mImageOpen
,
atkdefView
;
private
View
mImageOpen
,
atkdefView
;
private
BaseActivity
mContext
;
private
StringManager
mStringManager
;
...
...
@@ -121,10 +122,10 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
mListener
.
onOpenUrl
(
cardInfo
);
}
});
bind
(
R
.
id
.
lastone
).
setOnClickListener
((
v
)
->
{
bind
(
R
.
id
.
lastone
).
setOnClickListener
((
v
)
->
{
onPreCard
();
});
bind
(
R
.
id
.
nextone
).
setOnClickListener
((
v
)
->
{
bind
(
R
.
id
.
nextone
).
setOnClickListener
((
v
)
->
{
onNextCard
();
});
}
...
...
@@ -163,7 +164,11 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
});
name
.
setText
(
cardInfo
.
Name
);
desc
.
setText
(
cardInfo
.
Desc
);
cardcode
.
setText
(
String
.
format
(
"%08d"
,
cardInfo
.
Code
));
if
(
cardInfo
.
Alias
!=
0
)
{
cardcode
.
setText
(
String
.
format
(
"%08d"
,
cardInfo
.
Alias
));
}
else
{
cardcode
.
setText
(
String
.
format
(
"%08d"
,
cardInfo
.
Code
));
}
type
.
setText
(
CardUtils
.
getAllTypeString
(
cardInfo
,
mStringManager
).
replace
(
"/"
,
"|"
));
attrView
.
setText
(
mStringManager
.
getAttributeString
(
cardInfo
.
Attribute
));
otView
.
setText
(
mStringManager
.
getOtString
(
cardInfo
.
Ot
,
""
+
cardInfo
.
Ot
));
...
...
@@ -196,7 +201,7 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
atkdefView
.
setVisibility
(
View
.
VISIBLE
);
monsterlayout
.
setVisibility
(
View
.
VISIBLE
);
race
.
setVisibility
(
View
.
VISIBLE
);
String
star
=
"★"
+
cardInfo
.
getStar
();
String
star
=
"★"
+
cardInfo
.
getStar
();
/* for (int i = 0; i < cardInfo.getStar(); i++) {
star += "★";
}*/
...
...
@@ -241,49 +246,49 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
return
mCardInfo
;
}
public
void
onPreCard
(){
public
void
onPreCard
()
{
int
position
=
getCurPosition
();
CardListProvider
provider
=
getProvider
();
if
(
position
==
0
)
{
getContext
().
showToast
(
"已经是第一张啦"
,
Toast
.
LENGTH_SHORT
);
getContext
().
showToast
(
"已经是第一张啦"
,
Toast
.
LENGTH_SHORT
);
}
else
{
int
index
=
position
;
do
{
if
(
index
==
0
)
{
getContext
().
showToast
(
"已经是第一张啦"
,
Toast
.
LENGTH_SHORT
);
int
index
=
position
;
do
{
if
(
index
==
0
)
{
getContext
().
showToast
(
"已经是第一张啦"
,
Toast
.
LENGTH_SHORT
);
return
;
}
else
{
}
else
{
index
--;
}
}
while
(
provider
.
getCard
(
index
)==
null
||
provider
.
getCard
(
index
).
Name
==
null
||
provider
.
getCard
(
position
).
Name
.
equals
(
provider
.
getCard
(
index
).
Name
));
}
}
while
(
provider
.
getCard
(
index
)
==
null
||
provider
.
getCard
(
index
).
Name
==
null
||
provider
.
getCard
(
position
).
Name
.
equals
(
provider
.
getCard
(
index
).
Name
));
bind
(
provider
.
getCard
(
index
),
index
,
provider
);
if
(
position
==
1
)
{
getContext
().
showToast
(
"已经是第一张啦"
,
Toast
.
LENGTH_SHORT
);
if
(
position
==
1
)
{
getContext
().
showToast
(
"已经是第一张啦"
,
Toast
.
LENGTH_SHORT
);
}
}
}
public
void
onNextCard
(){
public
void
onNextCard
()
{
int
position
=
getCurPosition
();
CardListProvider
provider
=
getProvider
();
if
(
position
<
provider
.
getCardsCount
()
-
1
)
{
int
index
=
position
;
do
{
if
(
index
==
provider
.
getCardsCount
()
-
1
)
{
int
index
=
position
;
do
{
if
(
index
==
provider
.
getCardsCount
()
-
1
)
{
getContext
().
showToast
(
"已经是最后一张啦"
,
Toast
.
LENGTH_SHORT
);
return
;
}
else
{
return
;
}
else
{
index
++;
}
}
while
(
provider
.
getCard
(
index
)==
null
||
provider
.
getCard
(
index
).
Name
==
null
||
provider
.
getCard
(
position
).
Name
.
equals
(
provider
.
getCard
(
index
).
Name
));
}
}
while
(
provider
.
getCard
(
index
)
==
null
||
provider
.
getCard
(
index
).
Name
==
null
||
provider
.
getCard
(
position
).
Name
.
equals
(
provider
.
getCard
(
index
).
Name
));
bind
(
provider
.
getCard
(
index
),
index
,
provider
);
if
(
position
==
provider
.
getCardsCount
()
-
1
)
{
getContext
().
showToast
(
"已经是最后一张啦"
,
Toast
.
LENGTH_SHORT
);
if
(
position
==
provider
.
getCardsCount
()
-
1
)
{
getContext
().
showToast
(
"已经是最后一张啦"
,
Toast
.
LENGTH_SHORT
);
}
}
else
{
getContext
().
showToast
(
"已经是最后一张啦"
,
Toast
.
LENGTH_SHORT
);
getContext
().
showToast
(
"已经是最后一张啦"
,
Toast
.
LENGTH_SHORT
);
}
}
...
...
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