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
409e4acf
Commit
409e4acf
authored
Dec 19, 2024
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
卡片详情显示所属卡包名称
parent
1fb142a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
7 deletions
+43
-7
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
...rc/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
+14
-5
mobile/src/main/res/layout/dialog_cardinfo.xml
mobile/src/main/res/layout/dialog_cardinfo.xml
+29
-2
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
View file @
409e4acf
...
...
@@ -63,7 +63,8 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
private
final
TextView
race
;
private
final
TextView
cardAtk
;
private
final
TextView
cardDef
;
private
final
LinearLayout
ll_pack
;
private
final
TextView
packName
;
private
final
TextView
setName
;
private
final
TextView
otView
;
private
final
TextView
attrView
;
...
...
@@ -81,6 +82,7 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
private
final
View
mImageFav
,
atkdefView
;
private
final
StringManager
mStringManager
;
private
final
BaseActivity
mContext
;
private
int
curPosition
;
private
Card
mCardInfo
;
private
CardListProvider
mProvider
;
...
...
@@ -94,7 +96,6 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
private
Button
btn_redownload
;
private
Button
btn_share
;
private
boolean
isDownloadCardImage
=
true
;
private
boolean
mShowAdd
=
false
;
@SuppressLint
(
"HandlerLeak"
)
Handler
handler
=
new
Handler
()
{
...
...
@@ -126,7 +127,7 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
}
}
};
private
final
BaseActivity
mContext
;
private
boolean
mShowAdd
=
false
;
private
OnFavoriteChangedListener
mCallBack
;
public
CardDetail
(
BaseActivity
context
,
ImageLoader
imageLoader
,
StringManager
stringManager
)
{
...
...
@@ -135,6 +136,8 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
cardImage
=
findViewById
(
R
.
id
.
card_image
);
this
.
imageLoader
=
imageLoader
;
mStringManager
=
stringManager
;
ll_pack
=
findViewById
(
R
.
id
.
ll_pack
);
packName
=
findViewById
(
R
.
id
.
pack_name
);
name
=
findViewById
(
R
.
id
.
text_name
);
desc
=
findViewById
(
R
.
id
.
text_desc
);
close
=
findViewById
(
R
.
id
.
btn_close
);
...
...
@@ -271,6 +274,7 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
cardImage
.
setOnClickListener
((
v
)
->
{
showCardImageDetail
(
cardInfo
.
Code
);
});
packName
.
setText
(
getPackName
());
name
.
setText
(
cardInfo
.
Name
);
if
(
cardInfo
.
Name
.
equals
(
"Unknown"
))
{
desc
.
setText
(
R
.
string
.
tip_card_info_diff
);
...
...
@@ -280,8 +284,10 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
cardCode
.
setText
(
String
.
format
(
"%08d"
,
cardInfo
.
getCode
()));
if
(
cardInfo
.
isType
(
CardType
.
Token
))
{
faq
.
setVisibility
(
View
.
INVISIBLE
);
ll_pack
.
setVisibility
(
View
.
INVISIBLE
);
}
else
{
faq
.
setVisibility
(
View
.
VISIBLE
);
ll_pack
.
setVisibility
(
View
.
VISIBLE
);
}
if
(
mShowAdd
)
{
if
(
cardInfo
.
isType
(
CardType
.
Token
))
{
...
...
@@ -361,8 +367,12 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
}
}
private
String
getPackName
(
Card
cardInfo
)
{
String
packname
=
""
;
return
packname
;
}
private
void
showCardImageDetail
(
int
code
)
{
AppsSettings
appsSettings
=
AppsSettings
.
get
();
View
view
=
dialog
.
initDialog
(
context
,
R
.
layout
.
dialog_photo
);
dialog
.
setDialogWidth
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
);
...
...
@@ -545,7 +555,6 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
}
}
public
interface
OnFavoriteChangedListener
{
void
onFavoriteChange
(
Card
card
,
boolean
favorite
);
}
...
...
mobile/src/main/res/layout/dialog_cardinfo.xml
View file @
409e4acf
...
...
@@ -145,9 +145,9 @@
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:layout_gravity=
"center"
android:src=
"@drawable/selector_favorite"
android:paddingRight=
"5dp"
android:scaleType=
"fitCenter"
/>
android:scaleType=
"fitCenter"
android:src=
"@drawable/selector_favorite"
/>
</LinearLayout>
<LinearLayout
...
...
@@ -175,6 +175,33 @@
android:orientation=
"vertical"
android:paddingLeft=
"5dp"
>
<LinearLayout
android:id=
"@+id/ll_pack"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/category_pack"
android:textAppearance=
"@style/TextAppearance.AppCompat.Caption"
android:textColor=
"@color/item_title"
/>
<TextView
android:id=
"@+id/pack_name"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:gravity=
"center_vertical"
android:maxLines=
"1"
android:paddingLeft=
"4dp"
android:singleLine=
"true"
android:textAppearance=
"@style/TextAppearance.AppCompat.Caption"
android:textColor=
"@color/holo_blue_bright"
tools:text=
"2024-12-21 25PP"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
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