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
3f7bc660
Commit
3f7bc660
authored
Oct 03, 2021
by
noname
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下载卡图的刷新
parent
09eb188d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
33 deletions
+74
-33
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/CardListAdapter.java
...java/cn/garymb/ygomobile/ui/adapters/CardListAdapter.java
+14
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
...rc/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
+38
-29
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardSearchActivity.java
...java/cn/garymb/ygomobile/ui/cards/CardSearchActivity.java
+5
-0
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerActivity.java
...ava/cn/garymb/ygomobile/ui/cards/DeckManagerActivity.java
+6
-1
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckAdapater.java
.../java/cn/garymb/ygomobile/ui/cards/deck/DeckAdapater.java
+11
-1
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/CardListAdapter.java
View file @
3f7bc660
package
cn.garymb.ygomobile.ui.adapters
;
package
cn.garymb.ygomobile.ui.adapters
;
import
android.content.Context
;
import
android.content.Context
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
com.tubb.smrv.SwipeHorizontalMenuLayout
;
import
com.tubb.smrv.SwipeHorizontalMenuLayout
;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.EventBus
;
...
@@ -63,6 +66,14 @@ public class CardListAdapter extends BaseRecyclerAdapterPlus<Card, ViewHolder> i
...
@@ -63,6 +66,14 @@ public class CardListAdapter extends BaseRecyclerAdapterPlus<Card, ViewHolder> i
return
false
;
return
false
;
}
}
public
void
notifyItemChanged
(
Card
card
)
{
for
(
int
i
=
0
;
i
<
getItemCount
();
i
++)
{
if
(
getCard
(
i
).
Code
==
card
.
Code
)
{
notifyItemChanged
(
i
);
}
}
}
public
void
hideMenu
(
View
view
)
{
public
void
hideMenu
(
View
view
)
{
if
(
view
==
null
)
{
if
(
view
==
null
)
{
view
=
mShowMenuView
;
view
=
mShowMenuView
;
...
@@ -88,6 +99,7 @@ public class CardListAdapter extends BaseRecyclerAdapterPlus<Card, ViewHolder> i
...
@@ -88,6 +99,7 @@ public class CardListAdapter extends BaseRecyclerAdapterPlus<Card, ViewHolder> i
}
}
}
}
@NonNull
@Override
@Override
public
ViewHolder
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
)
{
public
ViewHolder
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
)
{
View
view
=
inflate
(
R
.
layout
.
item_search_card_swipe
,
parent
,
false
);
View
view
=
inflate
(
R
.
layout
.
item_search_card_swipe
,
parent
,
false
);
...
@@ -100,8 +112,8 @@ public class CardListAdapter extends BaseRecyclerAdapterPlus<Card, ViewHolder> i
...
@@ -100,8 +112,8 @@ public class CardListAdapter extends BaseRecyclerAdapterPlus<Card, ViewHolder> i
}
}
@Override
@Override
public
void
onBindViewHolder
(
ViewHolder
holder
,
int
position
)
{
public
void
onBindViewHolder
(
@NonNull
ViewHolder
holder
,
int
position
)
{
Card
item
=
get
Item
(
position
);
Card
item
=
get
Card
(
position
);
if
(
item
==
null
){
if
(
item
==
null
){
return
;
return
;
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardDetail.java
View file @
3f7bc660
...
@@ -107,6 +107,9 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
...
@@ -107,6 +107,9 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
ll_bar
.
setVisibility
(
View
.
GONE
);
ll_bar
.
setVisibility
(
View
.
GONE
);
imageLoader
.
bindImage
(
photoView
,
msg
.
arg1
,
ImageLoader
.
Type
.
origin
);
imageLoader
.
bindImage
(
photoView
,
msg
.
arg1
,
ImageLoader
.
Type
.
origin
);
imageLoader
.
bindImage
(
cardImage
,
msg
.
arg1
,
ImageLoader
.
Type
.
middle
);
imageLoader
.
bindImage
(
cardImage
,
msg
.
arg1
,
ImageLoader
.
Type
.
middle
);
if
(
mListener
!=
null
){
mListener
.
onImageUpdate
(
mCardInfo
);
}
break
;
break
;
case
TYPE_DOWNLOAD_CARD_IMAGE_ING:
case
TYPE_DOWNLOAD_CARD_IMAGE_ING:
tv_loading
.
setText
(
msg
.
arg1
+
"%"
);
tv_loading
.
setText
(
msg
.
arg1
+
"%"
);
...
@@ -128,32 +131,32 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
...
@@ -128,32 +131,32 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
public
CardDetail
(
BaseActivity
context
,
ImageLoader
imageLoader
,
StringManager
stringManager
)
{
public
CardDetail
(
BaseActivity
context
,
ImageLoader
imageLoader
,
StringManager
stringManager
)
{
super
(
context
.
getLayoutInflater
().
inflate
(
R
.
layout
.
dialog_cardinfo
,
null
));
super
(
context
.
getLayoutInflater
().
inflate
(
R
.
layout
.
dialog_cardinfo
,
null
));
mContext
=
context
;
mContext
=
context
;
cardImage
=
bin
d
(
R
.
id
.
card_image
);
cardImage
=
findViewByI
d
(
R
.
id
.
card_image
);
this
.
imageLoader
=
imageLoader
;
this
.
imageLoader
=
imageLoader
;
mStringManager
=
stringManager
;
mStringManager
=
stringManager
;
name
=
bin
d
(
R
.
id
.
text_name
);
name
=
findViewByI
d
(
R
.
id
.
text_name
);
desc
=
bin
d
(
R
.
id
.
text_desc
);
desc
=
findViewByI
d
(
R
.
id
.
text_desc
);
close
=
bin
d
(
R
.
id
.
btn_close
);
close
=
findViewByI
d
(
R
.
id
.
btn_close
);
cardCode
=
bin
d
(
R
.
id
.
card_code
);
cardCode
=
findViewByI
d
(
R
.
id
.
card_code
);
level
=
bin
d
(
R
.
id
.
card_level
);
level
=
findViewByI
d
(
R
.
id
.
card_level
);
linkArrow
=
bin
d
(
R
.
id
.
detail_link_arrows
);
linkArrow
=
findViewByI
d
(
R
.
id
.
detail_link_arrows
);
type
=
bin
d
(
R
.
id
.
card_type
);
type
=
findViewByI
d
(
R
.
id
.
card_type
);
View
faq
=
bin
d
(
R
.
id
.
btn_faq
);
View
faq
=
findViewByI
d
(
R
.
id
.
btn_faq
);
cardAtk
=
bin
d
(
R
.
id
.
card_atk
);
cardAtk
=
findViewByI
d
(
R
.
id
.
card_atk
);
cardDef
=
bin
d
(
R
.
id
.
card_def
);
cardDef
=
findViewByI
d
(
R
.
id
.
card_def
);
atkdefView
=
bin
d
(
R
.
id
.
layout_atkdef2
);
atkdefView
=
findViewByI
d
(
R
.
id
.
layout_atkdef2
);
mImageFav
=
bin
d
(
R
.
id
.
image_fav
);
mImageFav
=
findViewByI
d
(
R
.
id
.
image_fav
);
monsterLayout
=
bin
d
(
R
.
id
.
layout_monster
);
monsterLayout
=
findViewByI
d
(
R
.
id
.
layout_monster
);
layoutDetailPScale
=
bin
d
(
R
.
id
.
detail_p_scale
);
layoutDetailPScale
=
findViewByI
d
(
R
.
id
.
detail_p_scale
);
detailCardScale
=
bin
d
(
R
.
id
.
detail_cardscale
);
detailCardScale
=
findViewByI
d
(
R
.
id
.
detail_cardscale
);
race
=
bin
d
(
R
.
id
.
card_race
);
race
=
findViewByI
d
(
R
.
id
.
card_race
);
setName
=
bin
d
(
R
.
id
.
card_setname
);
setName
=
findViewByI
d
(
R
.
id
.
card_setname
);
addMain
=
bin
d
(
R
.
id
.
btn_add_main
);
addMain
=
findViewByI
d
(
R
.
id
.
btn_add_main
);
addSide
=
bin
d
(
R
.
id
.
btn_add_side
);
addSide
=
findViewByI
d
(
R
.
id
.
btn_add_side
);
otView
=
bin
d
(
R
.
id
.
card_ot
);
otView
=
findViewByI
d
(
R
.
id
.
card_ot
);
attrView
=
bin
d
(
R
.
id
.
card_attribute
);
attrView
=
findViewByI
d
(
R
.
id
.
card_attribute
);
lbSetCode
=
bin
d
(
R
.
id
.
label_setcode
);
lbSetCode
=
findViewByI
d
(
R
.
id
.
label_setcode
);
cardManager
=
DataManager
.
get
().
getCardManager
();
cardManager
=
DataManager
.
get
().
getCardManager
();
close
.
setOnClickListener
((
v
)
->
{
close
.
setOnClickListener
((
v
)
->
{
if
(
mListener
!=
null
)
{
if
(
mListener
!=
null
)
{
...
@@ -187,10 +190,10 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
...
@@ -187,10 +190,10 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
mListener
.
onOpenUrl
(
cardInfo
);
mListener
.
onOpenUrl
(
cardInfo
);
}
}
});
});
bin
d
(
R
.
id
.
lastone
).
setOnClickListener
((
v
)
->
{
findViewByI
d
(
R
.
id
.
lastone
).
setOnClickListener
((
v
)
->
{
onPreCard
();
onPreCard
();
});
});
bin
d
(
R
.
id
.
nextone
).
setOnClickListener
((
v
)
->
{
findViewByI
d
(
R
.
id
.
nextone
).
setOnClickListener
((
v
)
->
{
onNextCard
();
onNextCard
();
});
});
mImageFav
.
setOnClickListener
((
v
)
->
{
mImageFav
.
setOnClickListener
((
v
)
->
{
...
@@ -532,9 +535,6 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
...
@@ -532,9 +535,6 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
}
}
}
}
private
<
T
extends
View
>
T
bind
(
int
id
)
{
return
(
T
)
findViewById
(
id
);
}
public
interface
OnFavoriteChangedListener
{
public
interface
OnFavoriteChangedListener
{
void
onFavoriteChange
(
Card
card
,
boolean
favorite
);
void
onFavoriteChange
(
Card
card
,
boolean
favorite
);
...
@@ -547,6 +547,10 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
...
@@ -547,6 +547,10 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
void
onAddSideCard
(
Card
cardInfo
);
void
onAddSideCard
(
Card
cardInfo
);
void
onImageUpdate
(
Card
cardInfo
);
void
onClose
();
void
onClose
();
}
}
...
@@ -563,6 +567,11 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
...
@@ -563,6 +567,11 @@ public class CardDetail extends BaseAdapterPlus.BaseViewHolder {
public
void
onClose
()
{
public
void
onClose
()
{
}
}
@Override
public
void
onImageUpdate
(
Card
cardInfo
)
{
}
@Override
@Override
public
void
onAddSideCard
(
Card
cardInfo
)
{
public
void
onAddSideCard
(
Card
cardInfo
)
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardSearchActivity.java
View file @
3f7bc660
...
@@ -291,6 +291,11 @@ public class CardSearchActivity extends BaseActivity implements CardLoader.CallB
...
@@ -291,6 +291,11 @@ public class CardSearchActivity extends BaseActivity implements CardLoader.CallB
WebActivity
.
openFAQ
(
getContext
(),
cardInfo
);
WebActivity
.
openFAQ
(
getContext
(),
cardInfo
);
}
}
@Override
public
void
onImageUpdate
(
Card
cardInfo
)
{
mCardListAdapter
.
notifyItemChanged
(
cardInfo
);
}
@Override
@Override
public
void
onClose
()
{
public
void
onClose
()
{
mDialog
.
dismiss
();
mDialog
.
dismiss
();
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerActivity.java
View file @
3f7bc660
...
@@ -38,7 +38,6 @@ import com.feihua.dialogutils.util.DialogUtils;
...
@@ -38,7 +38,6 @@ import com.feihua.dialogutils.util.DialogUtils;
import
com.nightonke.boommenu.BoomButtons.BoomButton
;
import
com.nightonke.boommenu.BoomButtons.BoomButton
;
import
com.nightonke.boommenu.BoomButtons.TextOutsideCircleButton
;
import
com.nightonke.boommenu.BoomButtons.TextOutsideCircleButton
;
import
com.nightonke.boommenu.BoomMenuButton
;
import
com.nightonke.boommenu.BoomMenuButton
;
import
com.ourygo.assistant.service.DuelAssistantService
;
import
com.ourygo.assistant.util.DuelAssistantManagement
;
import
com.ourygo.assistant.util.DuelAssistantManagement
;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.EventBus
;
...
@@ -420,6 +419,12 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
...
@@ -420,6 +419,12 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
WebActivity
.
openFAQ
(
getContext
(),
cardInfo
);
WebActivity
.
openFAQ
(
getContext
(),
cardInfo
);
}
}
@Override
public
void
onImageUpdate
(
Card
cardInfo
)
{
mDeckAdapater
.
notifyItemChanged
(
cardInfo
);
mCardListAdapter
.
notifyItemChanged
(
cardInfo
);
}
@Override
@Override
public
void
onClose
()
{
public
void
onClose
()
{
mDialog
.
dismiss
();
mDialog
.
dismiss
();
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckAdapater.java
View file @
3f7bc660
...
@@ -190,7 +190,7 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement
...
@@ -190,7 +190,7 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement
}
}
@Override
@Override
public
Card
getCard
(
int
posotion
)
{
public
@Nullable
Card
getCard
(
int
posotion
)
{
int
count
=
mMainCount
;
int
count
=
mMainCount
;
int
index
=
0
;
int
index
=
0
;
if
(
posotion
<
count
)
{
if
(
posotion
<
count
)
{
...
@@ -478,6 +478,16 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement
...
@@ -478,6 +478,16 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement
mItems
.
add
(
deckItem
);
mItems
.
add
(
deckItem
);
}
}
public
void
notifyItemChanged
(
Card
card
){
for
(
int
i
=
0
;
i
<
getItemCount
();
i
++)
{
DeckItem
item
=
getItem
(
i
);
Card
c
=
item
.
getCardInfo
();
if
(
c
!=
null
&&
c
.
Code
==
card
.
Code
)
{
notifyItemChanged
(
i
);
}
}
}
public
void
addItem
(
int
pos
,
DeckItem
deckItem
)
{
public
void
addItem
(
int
pos
,
DeckItem
deckItem
)
{
if
(
deckItem
.
getCardInfo
()
!=
null
)
{
if
(
deckItem
.
getCardInfo
()
!=
null
)
{
if
(
pos
>=
DeckItem
.
MainStart
&&
pos
<=
DeckItem
.
MainEnd
)
{
if
(
pos
>=
DeckItem
.
MainStart
&&
pos
<=
DeckItem
.
MainEnd
)
{
...
...
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