Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile-Cn-Ko-En
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-Cn-Ko-En
Commits
a3d9d3fa
Commit
a3d9d3fa
authored
Apr 16, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善和实现连接标记显示
fix箭头上下颠倒
parent
486be731
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
143 additions
and
44 deletions
+143
-44
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
...rc/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
+55
-44
mobile/src/main/res/layout/item_linkmaker_small.xml
mobile/src/main/res/layout/item_linkmaker_small.xml
+88
-0
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
View file @
a3d9d3fa
...
...
@@ -93,6 +93,40 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
private
boolean
isDownloadCardImage
=
true
;
private
CallBack
mCallBack
;
public
static
int
[]
enImgs
=
new
int
[]{
R
.
drawable
.
left_top_1
,
R
.
drawable
.
top_1
,
R
.
drawable
.
right_top_1
,
R
.
drawable
.
left_1
,
0
,
R
.
drawable
.
right_1
,
R
.
drawable
.
left_bottom_1
,
R
.
drawable
.
bottom_1
,
R
.
drawable
.
right_bottom_1
,
};
public
static
int
[]
disImgs
=
new
int
[]{
R
.
drawable
.
left_top_0
,
R
.
drawable
.
top_0
,
R
.
drawable
.
right_top_0
,
R
.
drawable
.
left_0
,
0
,
R
.
drawable
.
right_0
,
R
.
drawable
.
left_bottom_0
,
R
.
drawable
.
bottom_0
,
R
.
drawable
.
right_bottom_0
,
};
public
static
int
[]
ids
=
new
int
[]{
R
.
id
.
iv_7
,
R
.
id
.
iv_8
,
R
.
id
.
iv_9
,
R
.
id
.
iv_4
,
0
,
R
.
id
.
iv_6
,
R
.
id
.
iv_1
,
R
.
id
.
iv_2
,
R
.
id
.
iv_3
,
};
public
interface
CallBack
{
void
onSearchStart
();
...
...
@@ -266,7 +300,7 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
curPosition
=
position
;
mProvider
=
provider
;
if
(
cardInfo
!=
null
)
{
setCardInfo
(
cardInfo
);
setCardInfo
(
cardInfo
,
view
);
}
}
...
...
@@ -282,41 +316,9 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
return
mCardInfo
;
}
private
void
setCardInfo
(
Card
cardInfo
)
{
private
void
setCardInfo
(
Card
cardInfo
,
View
view
)
{
if
(
cardInfo
==
null
)
return
;
int
[]
enImgs
=
new
int
[]{
R
.
drawable
.
left_bottom_1
,
R
.
drawable
.
bottom_1
,
R
.
drawable
.
right_bottom_1
,
R
.
drawable
.
left_1
,
0
,
R
.
drawable
.
right_1
,
R
.
drawable
.
left_top_1
,
R
.
drawable
.
top_1
,
R
.
drawable
.
right_top_1
,
};
int
[]
disImgs
=
new
int
[]{
R
.
drawable
.
left_bottom_0
,
R
.
drawable
.
bottom_0
,
R
.
drawable
.
right_bottom_0
,
R
.
drawable
.
left_0
,
0
,
R
.
drawable
.
right_0
,
R
.
drawable
.
left_top_0
,
R
.
drawable
.
top_0
,
R
.
drawable
.
right_top_0
,
};
int
[]
ids
=
new
int
[]{
R
.
id
.
iv_1
,
R
.
id
.
iv_2
,
R
.
id
.
iv_3
,
R
.
id
.
iv_4
,
R
.
id
.
iv_6
,
R
.
id
.
iv_7
,
R
.
id
.
iv_8
,
R
.
id
.
iv_9
,
};
View
linkarrow
=
new
View
(
mContext
);
mCardInfo
=
cardInfo
;
imageLoader
.
bindImage
(
cardImage
,
cardInfo
.
Code
,
null
,
true
);
dialog
=
DialogUtils
.
getdx
(
context
);
...
...
@@ -382,17 +384,10 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
level
.
setTextColor
(
context
.
getResources
().
getColor
(
R
.
color
.
star
));
}
cardAtk
.
setText
((
cardInfo
.
Attack
<
0
?
"?"
:
String
.
valueOf
(
cardInfo
.
Attack
)));
//连接怪兽设置
if
(
cardInfo
.
isType
(
CardType
.
Link
))
{
cardDef
.
setText
((
cardInfo
.
getStar
()
<
0
?
"?"
:
"LINK-"
+
String
.
valueOf
(
cardInfo
.
getStar
())));
String
LineKey
=
String
.
valueOf
(
cardInfo
.
Defense
);
for
(
int
i
=
0
;
i
<
9
;
i
++)
{
String
arrow
=
String
.
valueOf
(
LineKey
.
indexOf
(
i
));
if
(
arrow
.
equals
(
"1"
))
{
linkarrow
.
findViewById
(
ids
[
i
]).
setBackgroundResource
(
enImgs
[
i
]);
}
else
{
linkarrow
.
findViewById
(
ids
[
i
]).
setBackgroundResource
(
disImgs
[
i
]);
}
}
showLinkArrows
(
cardInfo
,
view
);
}
else
{
cardDef
.
setText
((
cardInfo
.
Defense
<
0
?
"?"
:
String
.
valueOf
(
cardInfo
.
Defense
)));
}
...
...
@@ -402,6 +397,22 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
race
.
setVisibility
(
View
.
GONE
);
monsterlayout
.
setVisibility
(
View
.
GONE
);
level
.
setVisibility
(
View
.
GONE
);
linkArrow
.
setVisibility
(
View
.
GONE
);
}
}
public
void
showLinkArrows
(
Card
cardInfo
,
View
view
){
String
lk
=
Integer
.
toBinaryString
(
cardInfo
.
Defense
);
String
Linekey
=
String
.
format
(
"%09d"
,
Integer
.
parseInt
(
lk
));
for
(
int
i
=
0
;
i
<
ids
.
length
;
i
++)
{
String
arrow
=
Linekey
.
substring
(
i
,
i
+
1
);
if
(
i
!=
4
)
{
if
(
"1"
.
equals
(
arrow
))
{
view
.
findViewById
(
ids
[
i
]).
setBackgroundResource
(
enImgs
[
i
]);
}
else
{
view
.
findViewById
(
ids
[
i
]).
setBackgroundResource
(
disImgs
[
i
]);
}
}
}
}
...
...
mobile/src/main/res/layout/item_linkmaker_small.xml
0 → 100644
View file @
a3d9d3fa
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"26dp"
android:layout_height=
"26dp"
android:gravity=
"center_vertical"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/iv_7"
android:layout_width=
"7dp"
android:layout_height=
"7dp"
android:background=
"@drawable/left_top_0"
android:visibility=
"visible"
/>
<ImageView
android:id=
"@+id/iv_8"
android:layout_width=
"12dp"
android:layout_height=
"5dp"
android:background=
"@drawable/top_0"
android:visibility=
"visible"
/>
<ImageView
android:id=
"@+id/iv_9"
android:layout_width=
"7dp"
android:layout_height=
"7dp"
android:background=
"@drawable/right_top_0"
android:visibility=
"visible"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/iv_4"
android:layout_width=
"5dp"
android:layout_height=
"12dp"
android:background=
"@drawable/left_0"
android:visibility=
"visible"
/>
<View
android:layout_width=
"0dp"
android:layout_height=
"1dp"
android:layout_weight=
"1"
/>
<ImageView
android:id=
"@+id/iv_6"
android:layout_width=
"5dp"
android:layout_height=
"12dp"
android:background=
"@drawable/right_0"
android:visibility=
"visible"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/iv_1"
android:layout_width=
"7dp"
android:layout_height=
"7dp"
android:background=
"@drawable/left_bottom_0"
android:visibility=
"visible"
/>
<ImageView
android:id=
"@+id/iv_2"
android:layout_width=
"12dp"
android:layout_height=
"5dp"
android:layout_gravity=
"bottom"
android:background=
"@drawable/bottom_0"
android:visibility=
"visible"
/>
<ImageView
android:id=
"@+id/iv_3"
android:layout_width=
"7dp"
android:layout_height=
"7dp"
android:background=
"@drawable/right_bottom_0"
/>
</LinearLayout>
</LinearLayout>
\ 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