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
5df16924
Commit
5df16924
authored
Sep 27, 2022
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
根据是否是卡包展示动态变更extralabel的位置
微调布局 给卡组最后一行增加透明卡方便划动到底部不和底部按钮重叠
parent
4643a8a1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
13 deletions
+68
-13
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerFragment.java
...ava/cn/garymb/ygomobile/ui/cards/DeckManagerFragment.java
+3
-0
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckItem.java
...main/java/cn/garymb/ygomobile/ui/cards/deck/DeckItem.java
+26
-9
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckItemUtils.java
...java/cn/garymb/ygomobile/ui/cards/deck/DeckItemUtils.java
+9
-1
mobile/src/main/res/layout/fragment_deck_cards.xml
mobile/src/main/res/layout/fragment_deck_cards.xml
+30
-3
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerFragment.java
View file @
5df16924
...
...
@@ -181,12 +181,15 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte
mRecyclerView
.
setPadding
(
mRecyclerView
.
getPaddingLeft
(),
0
,
mRecyclerView
.
getPaddingRight
(),
mRecyclerView
.
getPaddingBottom
());
mRecyclerView
.
setAdapter
((
mDeckAdapater
=
new
DeckAdapater
(
getContext
(),
mRecyclerView
,
getImageLoader
())));
mRecyclerView
.
setLayoutManager
(
new
DeckLayoutManager
(
getContext
(),
Constants
.
DECK_WIDTH_COUNT
));
mDeckItemTouchHelper
=
new
DeckItemTouchHelper
(
mDeckAdapater
);
ItemTouchHelperPlus
touchHelper
=
new
ItemTouchHelperPlus
(
getContext
(),
mDeckItemTouchHelper
);
touchHelper
.
setItemDragListener
(
this
);
touchHelper
.
setEnableClickDrag
(
Constants
.
DECK_SINGLE_PRESS_DRAG
);
touchHelper
.
attachToRecyclerView
(
mRecyclerView
);
mRecyclerView
.
addOnItemTouchListener
(
new
RecyclerViewItemListener
(
mRecyclerView
,
this
));
initBoomMenuButton
(
layoutView
.
findViewById
(
R
.
id
.
bmb
));
layoutView
.
findViewById
(
R
.
id
.
btn_nav_search
).
setOnClickListener
((
v
)
->
doMenu
(
R
.
id
.
action_search
));
layoutView
.
findViewById
(
R
.
id
.
btn_nav_list
).
setOnClickListener
((
v
)
->
doMenu
(
R
.
id
.
action_card_list
));
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckItem.java
View file @
5df16924
package
cn.garymb.ygomobile.ui.cards.deck
;
import
cn.garymb.ygomobile.Constants
;
import
cn.garymb.ygomobile.bean.DeckInfo
;
import
ocgcore.data.Card
;
public
class
DeckItem
{
// public final static int HeadView = 0;
// public final static int HeadView = 0;
public
final
static
int
MainLabel
=
0
;
public
final
static
int
MainStart
=
MainLabel
+
1
;
public
final
static
int
MainEnd
=
MainStart
+
Constants
.
DECK_MAIN_MAX
-
1
;
public
final
static
int
ExtraLabel
=
MainEnd
+
1
;
public
final
static
int
ExtraStart
=
ExtraLabel
+
1
;
public
final
static
int
ExtraEnd
=
ExtraStart
+
Constants
.
DECK_EXTRA_COUNT
-
1
;
public
final
static
int
SideLabel
=
ExtraEnd
+
1
;
public
final
static
int
SideStart
=
SideLabel
+
1
;
public
final
static
int
SideEnd
=
SideStart
+
Constants
.
DECK_SIDE_COUNT
-
1
;
public
static
int
MainEnd
=
MainStart
+
Constants
.
DECK_MAIN_MAX
-
1
;
public
static
int
ExtraLabel
=
MainEnd
+
1
;
public
static
int
ExtraStart
=
ExtraLabel
+
1
;
public
static
int
ExtraEnd
=
ExtraStart
+
Constants
.
DECK_EXTRA_COUNT
-
1
;
public
static
int
SideLabel
=
ExtraEnd
+
1
;
public
static
int
SideStart
=
SideLabel
+
1
;
public
static
int
SideEnd
=
SideStart
+
Constants
.
DECK_SIDE_COUNT
-
1
;
public
static
void
resetLabel
(
DeckInfo
deckInfo
,
boolean
isPack
)
{
if
(!
isPack
)
{
MainEnd
=
MainStart
+
Constants
.
DECK_MAIN_MAX
-
1
;
}
else
{
if
(
deckInfo
.
getMainCount
()
<=
Constants
.
DECK_MAIN_MAX
)
{
MainEnd
=
MainStart
+
Constants
.
DECK_MAIN_MAX
-
1
;
}
else
{
MainEnd
=
MainStart
+
deckInfo
.
getMainCount
()
-
1
;
}
}
ExtraLabel
=
MainEnd
+
1
;
ExtraStart
=
ExtraLabel
+
1
;
ExtraEnd
=
ExtraStart
+
Constants
.
DECK_EXTRA_COUNT
-
1
;
SideLabel
=
ExtraEnd
+
1
;
SideStart
=
SideLabel
+
1
;
SideEnd
=
SideStart
+
Constants
.
DECK_SIDE_COUNT
-
1
;
}
private
DeckItemType
mType
;
private
Card
mCardInfo
;
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckItemUtils.java
View file @
5df16924
...
...
@@ -169,6 +169,7 @@ class DeckItemUtils {
public
static
void
makeItems
(
DeckInfo
deckInfo
,
boolean
isPack
,
DeckAdapater
adapater
)
{
if
(
deckInfo
!=
null
)
{
DeckItem
.
resetLabel
(
deckInfo
,
isPack
);
adapater
.
addItem
(
new
DeckItem
(
DeckItemType
.
MainLabel
));
List
<
Card
>
main
=
deckInfo
.
getMainCards
();
if
(
main
==
null
)
{
...
...
@@ -183,6 +184,12 @@ class DeckItemUtils {
for
(
int
i
=
main
.
size
();
i
<
Constants
.
DECK_MAIN_MAX
;
i
++)
{
adapater
.
addItem
(
new
DeckItem
());
}
}
else
{
//填充空舍的位置便于滚动到底部时不和底部功能按钮重叠
int
emty
=
Constants
.
DECK_WIDTH_COUNT
-
deckInfo
.
getMainCount
()
%
Constants
.
DECK_WIDTH_COUNT
;
for
(
int
i
=
main
.
size
();
i
<
emty
+
deckInfo
.
getMainCount
();
i
++)
{
adapater
.
addItem
(
new
DeckItem
());
}
}
}
List
<
Card
>
extra
=
deckInfo
.
getExtraCards
();
...
...
@@ -216,6 +223,7 @@ class DeckItemUtils {
adapater
.
addItem
(
new
DeckItem
());
}
}
adapater
.
addItem
(
new
DeckItem
(
deckInfo
.
getMainCard
(
1
),
DeckItemType
.
Space
));
}
}
}
...
...
@@ -233,7 +241,7 @@ class DeckItemUtils {
}
public
static
boolean
isLabel
(
int
position
)
{
if
(
position
==
DeckItem
.
MainLabel
||
position
==
DeckItem
.
SideLabel
||
position
==
DeckItem
.
Extra
Label
)
{
if
(
position
==
DeckItem
.
MainLabel
||
position
==
DeckItem
.
ExtraLabel
||
position
==
DeckItem
.
Side
Label
)
{
return
true
;
}
return
false
;
...
...
mobile/src/main/res/layout/fragment_deck_cards.xml
View file @
5df16924
...
...
@@ -42,6 +42,11 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/deck_name"
android:textStyle=
"bold"
android:shadowColor=
"@color/black"
android:shadowDx=
"1"
android:shadowDy=
"1"
android:shadowRadius=
"2"
android:textColor=
"@color/holo_blue_light"
/>
<androidx.appcompat.widget.AppCompatTextView
...
...
@@ -54,6 +59,10 @@
android:text=
"@string/select_deck"
android:textColor=
"@color/white"
android:textSize=
"18sp"
android:shadowColor=
"@color/black"
android:shadowDx=
"1"
android:shadowDy=
"1"
android:shadowRadius=
"2"
android:textStyle=
"bold"
/>
</LinearLayout>
...
...
@@ -83,7 +92,13 @@
android:layout_width=
"60dp"
android:layout_height=
"20dp"
android:gravity=
"bottom|center_horizontal"
android:text=
"@string/searchresult"
/>
android:text=
"@string/searchresult"
android:textColor=
"@color/white"
android:textStyle=
"bold"
android:shadowColor=
"@color/black"
android:shadowDx=
"1"
android:shadowDy=
"1"
android:shadowRadius=
"2"
/>
</LinearLayout>
<LinearLayout
...
...
@@ -104,7 +119,13 @@
android:layout_width=
"60dp"
android:layout_height=
"20dp"
android:gravity=
"bottom|center_horizontal"
android:text=
"@string/card_search"
/>
android:text=
"@string/card_search"
android:textColor=
"@color/white"
android:textStyle=
"bold"
android:shadowColor=
"@color/black"
android:shadowDx=
"1"
android:shadowDy=
"1"
android:shadowRadius=
"2"
/>
</LinearLayout>
<LinearLayout
...
...
@@ -139,7 +160,13 @@
android:layout_width=
"60dp"
android:layout_height=
"20dp"
android:gravity=
"bottom|center_horizontal"
android:text=
"@string/Function_Menu"
/>
android:text=
"@string/Function_Menu"
android:textColor=
"@color/white"
android:textStyle=
"bold"
android:shadowColor=
"@color/black"
android:shadowDx=
"1"
android:shadowDy=
"1"
android:shadowRadius=
"2"
/>
</LinearLayout>
</LinearLayout>
</FrameLayout>
...
...
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