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
a06274f4
Commit
a06274f4
authored
Jan 30, 2023
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getmaincount为空指时显示红“-”避免闪退
卡包展示时不显示额外和副卡组数量 微调ui
parent
aa3a4a43
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
57 deletions
+80
-57
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/DeckListAdapter.java
...java/cn/garymb/ygomobile/ui/adapters/DeckListAdapter.java
+69
-51
mobile/src/main/java/cn/garymb/ygomobile/utils/YGODialogUtil.java
...rc/main/java/cn/garymb/ygomobile/utils/YGODialogUtil.java
+5
-5
mobile/src/main/res/layout/item_deck_list_swipe.xml
mobile/src/main/res/layout/item_deck_list_swipe.xml
+6
-1
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/DeckListAdapter.java
View file @
a06274f4
...
...
@@ -6,6 +6,7 @@ import android.graphics.Color;
import
android.os.Build
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
...
...
@@ -77,13 +78,13 @@ public class DeckListAdapter<T extends TextSelect> extends BaseQuickAdapter<T, D
//item是deckFile类型
this
.
deckFile
=
(
DeckFile
)
item
;
holder
.
deckName
.
setText
(
item
.
getName
());
//
if (!deckFile.getTypeName().equals(YGOUtil.s(R.string.category_pack))) {
//预读卡组信息
this
.
deckInfo
=
mDeckLoader
.
readDeck
(
mCardLoader
,
deckFile
.
getPathFile
(),
mLimitList
);
//加载卡组第一张卡的图
holder
.
cardImage
.
setVisibility
(
View
.
VISIBLE
);
imageLoader
.
bindImage
(
holder
.
cardImage
,
deckFile
.
getFirstCode
(),
ImageLoader
.
Type
.
small
);
//填入内容
//
预读卡组信息
this
.
deckInfo
=
mDeckLoader
.
readDeck
(
mCardLoader
,
deckFile
.
getPathFile
(),
mLimitList
);
//加载卡组第一张卡的图
holder
.
cardImage
.
setVisibility
(
View
.
VISIBLE
);
imageLoader
.
bindImage
(
holder
.
cardImage
,
deckFile
.
getFirstCode
(),
ImageLoader
.
Type
.
middle
);
//填入内容
if
(
String
.
valueOf
(
deckInfo
.
getMainCount
())
!=
null
)
{
holder
.
main
.
setText
(
String
.
valueOf
(
deckInfo
.
getMainCount
()));
if
(
deckInfo
.
getMainCount
()
<
40
)
{
holder
.
main
.
setTextColor
(
Color
.
YELLOW
);
...
...
@@ -92,63 +93,78 @@ public class DeckListAdapter<T extends TextSelect> extends BaseQuickAdapter<T, D
holder
.
main
.
setTextColor
(
mContext
.
getColor
(
R
.
color
.
holo_blue_bright
));
}
}
}
else
{
holder
.
main
.
setText
(
"-"
);
holder
.
main
.
setTextColor
(
Color
.
RED
);
}
if
(
String
.
valueOf
(
deckInfo
.
getExtraCount
())
!=
null
)
{
//有时候主卡数量是空指,原因待查,暂且空指时显示红色“-”
holder
.
extra
.
setText
(
String
.
valueOf
(
deckInfo
.
getExtraCount
()));
}
else
{
holder
.
extra
.
setText
(
"-"
);
holder
.
extra
.
setTextColor
(
Color
.
RED
);
}
if
(
String
.
valueOf
(
deckInfo
.
getExtraCount
())
!=
null
)
{
holder
.
side
.
setText
(
String
.
valueOf
(
deckInfo
.
getSideCount
()));
}
else
{
holder
.
side
.
setText
(
"-"
);
holder
.
side
.
setTextColor
(
Color
.
RED
);
}
if
(
deckFile
.
getTypeName
().
equals
(
YGOUtil
.
s
(
R
.
string
.
category_pack
)))
{
//卡包展示时不显示额外和副卡组数量文本
holder
.
ll_extra_n_side
.
setVisibility
(
View
.
GONE
);
}
else
{
holder
.
ll_extra_n_side
.
setVisibility
(
View
.
VISIBLE
);
}
//判断是否含有先行卡
Deck
deck
=
this
.
deckInfo
.
toDeck
();
List
<
String
>
strList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
deck
.
getDeckCount
();
i
++)
{
strList
.
add
(
deck
.
getAlllist
().
get
(
i
).
toString
());
//判断是否含有先行卡
Deck
deck
=
this
.
deckInfo
.
toDeck
();
List
<
String
>
strList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
deck
.
getDeckCount
();
i
++)
{
strList
.
add
(
deck
.
getAlllist
().
get
(
i
).
toString
());
}
for
(
int
i
=
0
;
i
<
deck
.
getDeckCount
();
i
++)
{
if
(
strList
.
get
(
i
).
length
()
>
8
)
{
holder
.
prerelease_star
.
setVisibility
(
View
.
VISIBLE
);
break
;
}
else
{
holder
.
prerelease_star
.
setVisibility
(
View
.
GONE
);
continue
;
}
}
//判断是否符合默认禁卡表以显示标识
if
(
mLimitList
!=
null
)
{
for
(
int
i
=
0
;
i
<
deck
.
getDeckCount
();
i
++)
{
if
(
strList
.
get
(
i
).
length
()
>
8
)
{
holder
.
prerelease_star
.
setVisibility
(
View
.
VISIBLE
);
if
(
mLimitList
.
getStringForbidden
().
contains
(
strList
.
get
(
i
))
)
{
holder
.
banned_mark
.
setVisibility
(
View
.
VISIBLE
);
break
;
}
else
{
holder
.
prerelease_star
.
setVisibility
(
View
.
GONE
);
continue
;
}
}
//判断是否符合默认禁卡表以显示标识
if
(
mLimitList
!=
null
)
{
for
(
int
i
=
0
;
i
<
deck
.
getDeckCount
();
i
++)
{
if
(
mLimitList
.
getStringForbidden
().
contains
(
strList
.
get
(
i
)))
{
}
else
if
(
mLimitList
.
getStringLimit
().
contains
(
strList
.
get
(
i
)))
{
int
limitcount
=
0
;
for
(
int
j
=
0
;
j
<
deck
.
getDeckCount
();
j
++)
{
if
(
strList
.
get
(
i
).
equals
(
strList
.
get
(
j
)))
{
limitcount
++;
}
}
if
(
limitcount
>
1
)
{
holder
.
banned_mark
.
setVisibility
(
View
.
VISIBLE
);
break
;
}
else
if
(
mLimitList
.
getStringLimit
().
contains
(
strList
.
get
(
i
)))
{
int
limitcount
=
0
;
for
(
int
j
=
0
;
j
<
deck
.
getDeckCount
();
j
++)
{
if
(
strList
.
get
(
i
).
equals
(
strList
.
get
(
j
)))
{
limitcount
++;
}
}
if
(
limitcount
>
1
)
{
holder
.
banned_mark
.
setVisibility
(
View
.
VISIBLE
);
break
;
}
}
else
if
(
mLimitList
.
getStringSemiLimit
().
contains
(
strList
.
get
(
i
)))
{
int
semicount
=
0
;
for
(
int
k
=
0
;
k
<
deck
.
getDeckCount
();
k
++)
{
if
(
strList
.
get
(
i
).
equals
(
strList
.
get
(
k
)))
{
semicount
++;
}
}
else
if
(
mLimitList
.
getStringSemiLimit
().
contains
(
strList
.
get
(
i
)))
{
int
semicount
=
0
;
for
(
int
k
=
0
;
k
<
deck
.
getDeckCount
();
k
++)
{
if
(
strList
.
get
(
i
).
equals
(
strList
.
get
(
k
)))
{
semicount
++;
}
}
if
(
semicount
>
2
)
{
holder
.
banned_mark
.
setVisibility
(
View
.
VISIBLE
);
break
;
}
}
else
{
holder
.
banned_mark
.
setVisibility
(
View
.
GONE
);
continue
;
}
if
(
semicount
>
2
)
{
holder
.
banned_mark
.
setVisibility
(
View
.
VISIBLE
);
break
;
}
}
else
{
holder
.
banned_mark
.
setVisibility
(
View
.
GONE
);
continue
;
}
}
//} else {
// holder.deck_info.setVisibility(View.GONE);
// holder.cardImage.setVisibility(View.GONE);
//}
}
//多选
if
(
isManySelect
)
{
if
(
selectList
.
contains
(
item
))
...
...
@@ -218,6 +234,7 @@ class DeckViewHolder extends com.chad.library.adapter.base.viewholder.BaseViewHo
TextView
main
;
TextView
extra
;
TextView
side
;
LinearLayout
ll_extra_n_side
;
View
item_deck_list
;
View
deck_info
;
...
...
@@ -230,6 +247,7 @@ class DeckViewHolder extends com.chad.library.adapter.base.viewholder.BaseViewHo
main
=
findView
(
R
.
id
.
count_main
);
extra
=
findView
(
R
.
id
.
count_ex
);
side
=
findView
(
R
.
id
.
count_side
);
ll_extra_n_side
=
findView
(
R
.
id
.
ll_extra_n_side
);
prerelease_star
=
findView
(
R
.
id
.
prerelease_star
);
banned_mark
=
findView
(
R
.
id
.
banned_mark
);
deck_info
=
findView
(
R
.
id
.
deck_info
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/utils/YGODialogUtil.java
View file @
a06274f4
...
...
@@ -51,10 +51,9 @@ public class YGODialogUtil {
public
static
ListView
dialogl
(
Context
context
,
String
title
,
String
[]
list
)
{
DialogUtils
dialogUtils
=
DialogUtils
.
getInstance
(
context
);
ListView
listView
=
dialogUtils
.
dialogl1
(
title
,
new
TextBaseAdapter
(
context
,
list
,
YGOUtil
.
c
(
R
.
color
.
white
)
,
16
,
16
,
16
,
16
));
dialogUtils
.
setDialogBackgroundResource
(
R
.
drawable
.
radius
);
ListView
listView
=
dialogUtils
.
dialogl1
(
title
,
new
TextBaseAdapter
(
context
,
list
,
YGOUtil
.
c
(
R
.
color
.
white
),
10
,
20
,
10
,
20
));
dialogUtils
.
setDialogBackgroundResource
(
R
.
drawable
.
window2s
);
dialogUtils
.
setTitleColor
(
YGOUtil
.
c
(
R
.
color
.
holo_blue_light
));
return
listView
;
}
...
...
@@ -85,6 +84,7 @@ public class YGODialogUtil {
private
final
LinearLayout
ll_move
;
private
final
LinearLayout
ll_copy
;
private
final
LinearLayout
ll_del
;
private
final
LinearLayout
ll_add
;
private
final
ImageView
iv_move
;
private
final
ImageView
iv_copy
;
private
final
ImageView
iv_del
;
...
...
@@ -106,7 +106,7 @@ public class YGODialogUtil {
ll_move
=
ygoDialog
.
findViewById
(
R
.
id
.
ll_move
);
ll_copy
=
ygoDialog
.
findViewById
(
R
.
id
.
ll_copy
);
ll_del
=
ygoDialog
.
findViewById
(
R
.
id
.
ll_del
);
LinearLayout
ll_add
=
ygoDialog
.
findViewById
(
R
.
id
.
ll_add
);
ll_add
=
ygoDialog
.
findViewById
(
R
.
id
.
ll_add
);
iv_copy
=
ygoDialog
.
findViewById
(
R
.
id
.
iv_copy
);
iv_move
=
ygoDialog
.
findViewById
(
R
.
id
.
iv_move
);
iv_del
=
ygoDialog
.
findViewById
(
R
.
id
.
iv_del
);
...
...
mobile/src/main/res/layout/item_deck_list_swipe.xml
View file @
a06274f4
...
...
@@ -71,6 +71,11 @@
android:textColor=
"@color/holo_blue_bright"
android:textSize=
"10sp"
tools:text=
"40"
/>
<LinearLayout
android:id=
"@+id/ll_extra_n_side"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/TextExtra"
...
...
@@ -105,7 +110,7 @@
android:textColor=
"@color/holo_blue_bright"
android:textSize=
"10sp"
tools:text=
"15"
/>
</LinearLayout>
</LinearLayout>
</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