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
38f8af59
Commit
38f8af59
authored
May 28, 2022
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
判断是否含有先行卡
parent
398b799e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
28 deletions
+54
-28
mobile/src/main/java/cn/garymb/ygomobile/bean/Deck.java
mobile/src/main/java/cn/garymb/ygomobile/bean/Deck.java
+12
-2
mobile/src/main/java/cn/garymb/ygomobile/bean/DeckInfo.java
mobile/src/main/java/cn/garymb/ygomobile/bean/DeckInfo.java
+5
-3
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/DeckListAdapter.java
...java/cn/garymb/ygomobile/ui/adapters/DeckListAdapter.java
+21
-3
mobile/src/main/res/layout/item_deck_list_swipe.xml
mobile/src/main/res/layout/item_deck_list_swipe.xml
+16
-20
No files found.
mobile/src/main/java/cn/garymb/ygomobile/bean/Deck.java
View file @
38f8af59
...
@@ -46,7 +46,7 @@ public class Deck implements Parcelable {
...
@@ -46,7 +46,7 @@ public class Deck implements Parcelable {
private
static
final
String
CARD_DIVIDE_ID
=
"_"
;
private
static
final
String
CARD_DIVIDE_ID
=
"_"
;
private
static
final
String
CARD_DIVIDE_NUM
=
"*"
;
private
static
final
String
CARD_DIVIDE_NUM
=
"*"
;
private
ArrayList
<
Integer
>
allList
;
private
final
ArrayList
<
Integer
>
mainlist
;
private
final
ArrayList
<
Integer
>
mainlist
;
private
final
ArrayList
<
Integer
>
extraList
;
private
final
ArrayList
<
Integer
>
extraList
;
private
final
ArrayList
<
Integer
>
sideList
;
private
final
ArrayList
<
Integer
>
sideList
;
...
@@ -57,6 +57,7 @@ public class Deck implements Parcelable {
...
@@ -57,6 +57,7 @@ public class Deck implements Parcelable {
mainlist
=
new
ArrayList
<>();
mainlist
=
new
ArrayList
<>();
extraList
=
new
ArrayList
<>();
extraList
=
new
ArrayList
<>();
sideList
=
new
ArrayList
<>();
sideList
=
new
ArrayList
<>();
allList
=
new
ArrayList
<>();
}
}
public
Deck
(
String
name
,
Uri
uri
)
{
public
Deck
(
String
name
,
Uri
uri
)
{
...
@@ -466,7 +467,7 @@ public class Deck implements Parcelable {
...
@@ -466,7 +467,7 @@ public class Deck implements Parcelable {
}
}
public
int
getDeckCount
()
{
public
int
getDeckCount
()
{
return
getMainCount
()
+
getExtraCount
();
return
getMainCount
()
+
getExtraCount
()
+
getSideCount
()
;
}
}
public
File
saveTemp
(
String
dir
)
{
public
File
saveTemp
(
String
dir
)
{
...
@@ -510,6 +511,15 @@ public class Deck implements Parcelable {
...
@@ -510,6 +511,15 @@ public class Deck implements Parcelable {
return
extraList
;
return
extraList
;
}
}
public
List
<
Integer
>
getAlllist
()
{
if
(
allList
.
size
()
==
0
)
{
allList
.
addAll
(
mainlist
);
allList
.
addAll
(
extraList
);
allList
.
addAll
(
sideList
);
}
return
allList
;
}
public
void
addMain
(
Integer
id
)
{
public
void
addMain
(
Integer
id
)
{
if
(
mainlist
.
size
()
>=
Constants
.
DECK_MAIN_MAX
)
{
if
(
mainlist
.
size
()
>=
Constants
.
DECK_MAIN_MAX
)
{
return
;
return
;
...
...
mobile/src/main/java/cn/garymb/ygomobile/bean/DeckInfo.java
View file @
38f8af59
...
@@ -337,6 +337,8 @@ public class DeckInfo {
...
@@ -337,6 +337,8 @@ public class DeckInfo {
allCards
.
addAll
(
mainCards
);
allCards
.
addAll
(
mainCards
);
allCards
.
addAll
(
extraCards
);
allCards
.
addAll
(
extraCards
);
allCards
.
addAll
(
sideCards
);
allCards
.
addAll
(
sideCards
);
}
return
allCards
;
return
allCards
;
}
}
}
}
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/DeckListAdapter.java
View file @
38f8af59
...
@@ -27,6 +27,9 @@ import cn.garymb.ygomobile.ui.cards.deck.DeckAdapater;
...
@@ -27,6 +27,9 @@ import cn.garymb.ygomobile.ui.cards.deck.DeckAdapater;
import
cn.garymb.ygomobile.ui.cards.deck.DeckItem
;
import
cn.garymb.ygomobile.ui.cards.deck.DeckItem
;
import
cn.garymb.ygomobile.ui.cards.deck.ImageTop
;
import
cn.garymb.ygomobile.ui.cards.deck.ImageTop
;
import
cn.garymb.ygomobile.utils.YGOUtil
;
import
cn.garymb.ygomobile.utils.YGOUtil
;
import
ocgcore.DataManager
;
import
ocgcore.LimitManager
;
import
ocgcore.data.Card
;
import
ocgcore.data.LimitList
;
import
ocgcore.data.LimitList
;
public
class
DeckListAdapter
<
T
extends
TextSelect
>
extends
BaseQuickAdapter
<
T
,
DeckViewHolder
>
{
public
class
DeckListAdapter
<
T
extends
TextSelect
>
extends
BaseQuickAdapter
<
T
,
DeckViewHolder
>
{
...
@@ -63,6 +66,7 @@ public class DeckListAdapter<T extends TextSelect> extends BaseQuickAdapter<T, D
...
@@ -63,6 +66,7 @@ public class DeckListAdapter<T extends TextSelect> extends BaseQuickAdapter<T, D
onItemSelectListener
.
onItemSelect
(
position
,
data
.
get
(
position
).
getObject
());
onItemSelectListener
.
onItemSelect
(
position
,
data
.
get
(
position
).
getObject
());
}
}
});
});
//初始化
mCardLoader
=
new
CardLoader
(
context
);
mCardLoader
=
new
CardLoader
(
context
);
imageLoader
=
new
ImageLoader
();
imageLoader
=
new
ImageLoader
();
mLimitList
=
new
LimitList
();
mLimitList
=
new
LimitList
();
...
@@ -77,7 +81,6 @@ public class DeckListAdapter<T extends TextSelect> extends BaseQuickAdapter<T, D
...
@@ -77,7 +81,6 @@ public class DeckListAdapter<T extends TextSelect> extends BaseQuickAdapter<T, D
//item是deckFile类型
//item是deckFile类型
this
.
deckFile
=
(
DeckFile
)
item
;
this
.
deckFile
=
(
DeckFile
)
item
;
this
.
deckInfo
=
mDeckLoader
.
readDeck
(
mCardLoader
,
deckFile
.
getPathFile
(),
mLimitList
);
this
.
deckInfo
=
mDeckLoader
.
readDeck
(
mCardLoader
,
deckFile
.
getPathFile
(),
mLimitList
);
Log
.
i
(
"看看3.9.7"
,
deckInfo
+
""
);
//填入内容
//填入内容
imageLoader
.
bindImage
(
holder
.
cardImage
,
deckFile
.
getFirstCode
(),
ImageLoader
.
Type
.
small
);
imageLoader
.
bindImage
(
holder
.
cardImage
,
deckFile
.
getFirstCode
(),
ImageLoader
.
Type
.
small
);
holder
.
deckName
.
setText
(
item
.
getName
());
holder
.
deckName
.
setText
(
item
.
getName
());
...
@@ -96,9 +99,24 @@ public class DeckListAdapter<T extends TextSelect> extends BaseQuickAdapter<T, D
...
@@ -96,9 +99,24 @@ public class DeckListAdapter<T extends TextSelect> extends BaseQuickAdapter<T, D
}
else
{
}
else
{
holder
.
item_deck_list
.
setBackgroundResource
(
Color
.
TRANSPARENT
);
holder
.
item_deck_list
.
setBackgroundResource
(
Color
.
TRANSPARENT
);
}
}
}
else
{
}
else
{
holder
.
item_deck_list
.
setBackgroundResource
(
Color
.
TRANSPARENT
);
holder
.
item_deck_list
.
setBackgroundResource
(
Color
.
TRANSPARENT
);
}
}
//判断是否含有先行卡
Deck
deck
=
this
.
deckInfo
.
toDeck
();
List
<
Integer
>
intList
=
new
ArrayList
<>();
intList
.
addAll
(
deck
.
getAlllist
());
int
len
;
for
(
int
i
=
0
;
i
<
deck
.
getDeckCount
();
i
++)
{
len
=
intList
.
get
(
i
).
toString
().
length
();
if
(
len
>
8
)
{
holder
.
prerelease_star
.
setVisibility
(
View
.
VISIBLE
);
break
;
}
else
{
holder
.
prerelease_star
.
setVisibility
(
View
.
GONE
);
continue
;
}
}
}
}
...
...
mobile/src/main/res/layout/item_deck_list_swipe.xml
View file @
38f8af59
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/item_deck_list"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
>
android:id=
"@+id/item_deck_list"
>
<RelativeLayout
<RelativeLayout
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
android:layout_marginTop=
"5dp"
android:layout_marginTop=
"5dp"
android:layout_marginBottom=
"5dp"
>
android:layout_marginBottom=
"5dp"
>
<ImageView
<ImageView
android:id=
"@+id/card_image"
android:id=
"@+id/card_image"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
@@ -47,12 +48,20 @@
...
@@ -47,12 +48,20 @@
android:layout_marginTop=
"3dp"
android:layout_marginTop=
"3dp"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/prerelease_star"
android:layout_width=
"15dp"
android:layout_height=
"15dp"
android:layout_marginRight=
"@dimen/dp_10"
android:visibility=
"visible"
android:background=
"@drawable/ic_fav"
/>
<TextView
<TextView
android:id=
"@+id/count_main"
android:id=
"@+id/count_main"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"10sp"
android:textColor=
"@color/holo_blue_bright"
android:textColor=
"@color/holo_blue_bright"
android:textSize=
"10sp"
tools:text=
"40"
/>
tools:text=
"40"
/>
<TextView
<TextView
...
@@ -60,8 +69,8 @@
...
@@ -60,8 +69,8 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"/"
android:text=
"/"
android:text
Size=
"10sp
"
android:text
Color=
"@android:color/holo_green_light
"
android:text
Color=
"@android:color/holo_green_light
"
/>
android:text
Size=
"10sp
"
/>
<TextView
<TextView
android:id=
"@+id/count_ex"
android:id=
"@+id/count_ex"
...
@@ -76,8 +85,8 @@
...
@@ -76,8 +85,8 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"/"
android:text=
"/"
android:text
Size=
"10sp
"
android:text
Color=
"@android:color/holo_green_light
"
android:text
Color=
"@android:color/holo_green_light
"
/>
android:text
Size=
"10sp
"
/>
<TextView
<TextView
android:id=
"@+id/count_side"
android:id=
"@+id/count_side"
...
@@ -89,19 +98,6 @@
...
@@ -89,19 +98,6 @@
android:textSize=
"10sp"
android:textSize=
"10sp"
tools:text=
"15"
/>
tools:text=
"15"
/>
<View
android:layout_width=
"0dp"
android:layout_height=
"1dp"
android:layout_weight=
"1"
/>
<ImageView
android:id=
"@+id/prerelease_star"
android:layout_width=
"@dimen/right_size"
android:layout_height=
"@dimen/right_size"
android:layout_marginRight=
"@dimen/dp_10"
android:visibility=
"visible"
tools:src=
"@drawable/ic_close_black_24dp"
/>
</LinearLayout>
</LinearLayout>
</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