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
4aedbb45
Commit
4aedbb45
authored
Sep 03, 2021
by
qq247321453
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持现实不存在的卡片
parent
0474dbee
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
32 additions
and
249 deletions
+32
-249
mobile/build.gradle
mobile/build.gradle
+3
-0
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
+1
-3
mobile/src/main/java/cn/garymb/ygomobile/GameUriManager.java
mobile/src/main/java/cn/garymb/ygomobile/GameUriManager.java
+2
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/DebugActivity.java
...java/cn/garymb/ygomobile/ui/activities/DebugActivity.java
+0
-33
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/CardListAdapter.java
...java/cn/garymb/ygomobile/ui/adapters/CardListAdapter.java
+0
-4
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardSearchActivity.java
...java/cn/garymb/ygomobile/ui/cards/CardSearchActivity.java
+8
-8
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckAdapater2.java
...java/cn/garymb/ygomobile/ui/cards/deck/DeckAdapater2.java
+0
-155
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckLayoutManager2.java
...cn/garymb/ygomobile/ui/cards/deck/DeckLayoutManager2.java
+0
-25
mobile/src/main/java/cn/garymb/ygomobile/ui/file/FileActivity.java
...c/main/java/cn/garymb/ygomobile/ui/file/FileActivity.java
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/ui/file/FileAdapter.java
...rc/main/java/cn/garymb/ygomobile/ui/file/FileAdapter.java
+6
-6
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
+2
-9
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
+1
-2
mobile/src/main/java/ocgcore/CardManager.java
mobile/src/main/java/ocgcore/CardManager.java
+7
-1
mobile/src/main/java/ocgcore/data/Card.java
mobile/src/main/java/ocgcore/data/Card.java
+1
-0
No files found.
mobile/build.gradle
View file @
4aedbb45
...
@@ -23,14 +23,17 @@ android {
...
@@ -23,14 +23,17 @@ android {
}
}
productFlavors
{
productFlavors
{
cn
{
cn
{
buildConfigField
'String'
,
'URL_DONATE'
,
'"https://afdian.net/@ygomobile"'
manifestPlaceholders
=
[
APP_ID:
"0b6f110306"
]
manifestPlaceholders
=
[
APP_ID:
"0b6f110306"
]
}
}
en
{
en
{
applicationIdSuffix
".EN"
applicationIdSuffix
".EN"
buildConfigField
'String'
,
'URL_DONATE'
,
'"https://www.paypal.me/ygomobile1"'
manifestPlaceholders
=
[
APP_ID:
"9c66525dfa"
]
manifestPlaceholders
=
[
APP_ID:
"9c66525dfa"
]
}
}
ko
{
ko
{
applicationIdSuffix
".KO"
applicationIdSuffix
".KO"
buildConfigField
'String'
,
'URL_DONATE'
,
'"https://www.paypal.me/ygomobile1"'
manifestPlaceholders
=
[
APP_ID:
"0488398d8a"
]
manifestPlaceholders
=
[
APP_ID:
"0488398d8a"
]
}
}
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
View file @
4aedbb45
...
@@ -142,10 +142,8 @@ public interface Constants {
...
@@ -142,10 +142,8 @@ public interface Constants {
int
DECK_SIDE_MAX
=
15
;
int
DECK_SIDE_MAX
=
15
;
int
DECK_EXTRA_COUNT
=
(
DECK_SIDE_MAX
/
DECK_WIDTH_COUNT
*
DECK_WIDTH_COUNT
<
DECK_SIDE_MAX
)
?
DECK_WIDTH_COUNT
*
2
:
DECK_WIDTH_COUNT
;
int
DECK_EXTRA_COUNT
=
(
DECK_SIDE_MAX
/
DECK_WIDTH_COUNT
*
DECK_WIDTH_COUNT
<
DECK_SIDE_MAX
)
?
DECK_WIDTH_COUNT
*
2
:
DECK_WIDTH_COUNT
;
int
DECK_SIDE_COUNT
=
DECK_EXTRA_COUNT
;
int
DECK_SIDE_COUNT
=
DECK_EXTRA_COUNT
;
String
URL_DONATE_CN
=
"https://afdian.net/@ygomobile"
;
String
URL_DONATE
=
"https://www.paypal.me/ygomobile1"
;
String
URL_HELP
=
"http://note.youdao.com/noteshare?id=8ae2dc824b7dc04a95a4665a938e2251"
;
String
URL_HELP
=
"http://note.youdao.com/noteshare?id=8ae2dc824b7dc04a95a4665a938e2251"
;
String
URL_MASTERRULE_CN
=
"https://ocg-rule.readthedocs.io/zh_CN/master/"
;
String
URL_MASTER
_
RULE_CN
=
"https://ocg-rule.readthedocs.io/zh_CN/master/"
;
String
WIKI_SEARCH_URL
=
"https://www.ourocg.cn/S.aspx?key="
;
String
WIKI_SEARCH_URL
=
"https://www.ourocg.cn/S.aspx?key="
;
String
SERVER_FILE
=
"server_list.xml"
;
String
SERVER_FILE
=
"server_list.xml"
;
...
...
mobile/src/main/java/cn/garymb/ygomobile/GameUriManager.java
View file @
4aedbb45
...
@@ -104,7 +104,7 @@ public class GameUriManager {
...
@@ -104,7 +104,7 @@ public class GameUriManager {
}
}
private
File
getDeckFile
(
File
dir
,
String
name
)
{
private
File
getDeckFile
(
File
dir
,
String
name
)
{
File
file
=
new
File
(
dir
,
name
+
".ydk"
);
File
file
=
new
File
(
dir
,
name
);
if
(
file
.
exists
())
{
if
(
file
.
exists
())
{
for
(
int
i
=
2
;
i
<
10
;
i
++)
{
for
(
int
i
=
2
;
i
<
10
;
i
++)
{
file
=
new
File
(
dir
,
name
+
"("
+
i
+
").ydk"
);
file
=
new
File
(
dir
,
name
+
"("
+
i
+
").ydk"
);
...
@@ -158,7 +158,7 @@ public class GameUriManager {
...
@@ -158,7 +158,7 @@ public class GameUriManager {
File
local
;
File
local
;
if
(
name
.
toLowerCase
(
Locale
.
US
).
endsWith
(
".ydk"
))
{
if
(
name
.
toLowerCase
(
Locale
.
US
).
endsWith
(
".ydk"
))
{
File
dir
=
Constants
.
COPY_YDK_FILE
?
new
File
(
AppsSettings
.
get
().
getDeckDir
())
:
new
File
(
getActivity
().
getApplicationInfo
().
dataDir
,
"cache"
);
File
dir
=
Constants
.
COPY_YDK_FILE
?
new
File
(
AppsSettings
.
get
().
getDeckDir
())
:
new
File
(
getActivity
().
getApplicationInfo
().
dataDir
,
"cache"
);
local
=
getDeckFile
(
dir
,
name
);
local
=
getDeckFile
(
dir
,
getPathName
(
path
,
true
)
);
}
else
if
(
name
.
toLowerCase
(
Locale
.
US
).
endsWith
(
".ypk"
))
{
}
else
if
(
name
.
toLowerCase
(
Locale
.
US
).
endsWith
(
".ypk"
))
{
local
=
new
File
(
AppsSettings
.
get
().
getExpansionsPath
(),
name
);
local
=
new
File
(
AppsSettings
.
get
().
getExpansionsPath
(),
name
);
}
else
if
(
name
.
toLowerCase
(
Locale
.
US
).
endsWith
(
".yrp"
))
{
}
else
if
(
name
.
toLowerCase
(
Locale
.
US
).
endsWith
(
".yrp"
))
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/DebugActivity.java
deleted
100644 → 0
View file @
0474dbee
package
cn.garymb.ygomobile.ui.activities
;
import
android.os.Bundle
;
import
androidx.annotation.Nullable
;
import
androidx.appcompat.widget.Toolbar
;
import
androidx.recyclerview.widget.RecyclerView
;
import
cn.garymb.ygomobile.lite.R
;
public
class
DebugActivity
extends
BaseActivity
{
private
RecyclerView
rv_list
;
private
Toolbar
toolbar
;
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
debug_activity
);
initView
();
}
private
void
initView
()
{
rv_list
=
$
(
R
.
id
.
rv_list
);
toolbar
=
$
(
R
.
id
.
toolbar
);
setSupportActionBar
(
toolbar
);
enableBackHome
();
}
}
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/CardListAdapter.java
View file @
4aedbb45
...
@@ -32,7 +32,6 @@ public class CardListAdapter extends BaseRecyclerAdapterPlus<Card, ViewHolder> i
...
@@ -32,7 +32,6 @@ public class CardListAdapter extends BaseRecyclerAdapterPlus<Card, ViewHolder> i
private
boolean
mItemBg
;
private
boolean
mItemBg
;
private
ImageLoader
imageLoader
;
private
ImageLoader
imageLoader
;
private
boolean
mEnableSwipe
=
false
;
private
boolean
mEnableSwipe
=
false
;
private
BaseActivity
mContext
;
public
CardListAdapter
(
Context
context
,
ImageLoader
imageLoader
)
{
public
CardListAdapter
(
Context
context
,
ImageLoader
imageLoader
)
{
super
(
context
);
super
(
context
);
...
@@ -103,10 +102,7 @@ public class CardListAdapter extends BaseRecyclerAdapterPlus<Card, ViewHolder> i
...
@@ -103,10 +102,7 @@ public class CardListAdapter extends BaseRecyclerAdapterPlus<Card, ViewHolder> i
@Override
@Override
public
void
onBindViewHolder
(
ViewHolder
holder
,
int
position
)
{
public
void
onBindViewHolder
(
ViewHolder
holder
,
int
position
)
{
Log
.
e
(
"Cardlist"
,
"num"
+
position
);
Card
item
=
getItem
(
position
);
Card
item
=
getItem
(
position
);
if
(
item
==
null
)
return
;
imageLoader
.
bindImage
(
holder
.
cardImage
,
item
.
Code
);
imageLoader
.
bindImage
(
holder
.
cardImage
,
item
.
Code
);
holder
.
cardName
.
setText
(
item
.
Name
);
holder
.
cardName
.
setText
(
item
.
Name
);
if
(
item
.
isType
(
CardType
.
Monster
))
{
if
(
item
.
isType
(
CardType
.
Monster
))
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/CardSearchActivity.java
View file @
4aedbb45
...
@@ -50,7 +50,7 @@ public class CardSearchActivity extends BaseActivity implements CardLoader.CallB
...
@@ -50,7 +50,7 @@ public class CardSearchActivity extends BaseActivity implements CardLoader.CallB
public
static
final
String
SEARCH_MESSAGE
=
"searchMessage"
;
public
static
final
String
SEARCH_MESSAGE
=
"searchMessage"
;
protected
DrawerLayout
mDrawerlayout
;
protected
DrawerLayout
mDrawerlayout
;
protected
CardSearcher
mCardSelector
;
protected
CardSearcher
mCardSelector
;
protected
CardListAdapter
mCardListAdap
a
ter
;
protected
CardListAdapter
mCardListAdapter
;
protected
CardLoader
mCardLoader
;
protected
CardLoader
mCardLoader
;
protected
boolean
isLoad
=
false
;
protected
boolean
isLoad
=
false
;
protected
StringManager
mStringManager
=
DataManager
.
get
().
getStringManager
();
protected
StringManager
mStringManager
=
DataManager
.
get
().
getStringManager
();
...
@@ -79,10 +79,10 @@ public class CardSearchActivity extends BaseActivity implements CardLoader.CallB
...
@@ -79,10 +79,10 @@ public class CardSearchActivity extends BaseActivity implements CardLoader.CallB
mDrawerlayout
=
$
(
R
.
id
.
drawer_layout
);
mDrawerlayout
=
$
(
R
.
id
.
drawer_layout
);
mImageLoader
=
ImageLoader
.
get
(
this
);
mImageLoader
=
ImageLoader
.
get
(
this
);
mListView
=
$
(
R
.
id
.
list_cards
);
mListView
=
$
(
R
.
id
.
list_cards
);
mCardListAdap
a
ter
=
new
CardListAdapter
(
this
,
mImageLoader
);
mCardListAdapter
=
new
CardListAdapter
(
this
,
mImageLoader
);
mCardListAdap
a
ter
.
setItemBg
(
true
);
mCardListAdapter
.
setItemBg
(
true
);
mListView
.
setLayoutManager
(
new
FastScrollLinearLayoutManager
(
this
));
mListView
.
setLayoutManager
(
new
FastScrollLinearLayoutManager
(
this
));
mListView
.
setAdapter
(
mCardListAdap
a
ter
);
mListView
.
setAdapter
(
mCardListAdapter
);
Button
btn_search
=
$
(
R
.
id
.
btn_search
);
Button
btn_search
=
$
(
R
.
id
.
btn_search
);
btn_search
.
setOnClickListener
((
v
)
->
showSearch
(
true
));
btn_search
.
setOnClickListener
((
v
)
->
showSearch
(
true
));
/*
/*
...
@@ -144,7 +144,7 @@ public class CardSearchActivity extends BaseActivity implements CardLoader.CallB
...
@@ -144,7 +144,7 @@ public class CardSearchActivity extends BaseActivity implements CardLoader.CallB
mListView
.
addOnItemTouchListener
(
new
RecyclerViewItemListener
(
mListView
,
new
RecyclerViewItemListener
.
OnItemListener
()
{
mListView
.
addOnItemTouchListener
(
new
RecyclerViewItemListener
(
mListView
,
new
RecyclerViewItemListener
.
OnItemListener
()
{
@Override
@Override
public
void
onItemClick
(
View
view
,
int
pos
)
{
public
void
onItemClick
(
View
view
,
int
pos
)
{
onCardClick
(
pos
,
mCardListAdap
a
ter
);
onCardClick
(
pos
,
mCardListAdapter
);
}
}
@Override
@Override
...
@@ -206,9 +206,9 @@ public class CardSearchActivity extends BaseActivity implements CardLoader.CallB
...
@@ -206,9 +206,9 @@ public class CardSearchActivity extends BaseActivity implements CardLoader.CallB
@Override
@Override
public
void
onSearchResult
(
List
<
Card
>
cardInfos
,
boolean
isHide
)
{
public
void
onSearchResult
(
List
<
Card
>
cardInfos
,
boolean
isHide
)
{
// Log.d("kk", "find " + (cardInfos == null ? -1 : cardInfos.size()));
// Log.d("kk", "find " + (cardInfos == null ? -1 : cardInfos.size()));
mCardListAdap
a
ter
.
set
(
cardInfos
);
mCardListAdapter
.
set
(
cardInfos
);
mResult_count
.
setText
(
String
.
valueOf
(
cardInfos
.
size
()));
mResult_count
.
setText
(
String
.
valueOf
(
cardInfos
.
size
()));
mCardListAdap
a
ter
.
notifyDataSetChanged
();
mCardListAdapter
.
notifyDataSetChanged
();
if
(
cardInfos
.
size
()
>
0
)
{
if
(
cardInfos
.
size
()
>
0
)
{
mListView
.
smoothScrollToPosition
(
0
);
mListView
.
smoothScrollToPosition
(
0
);
}
}
...
@@ -236,7 +236,7 @@ public class CardSearchActivity extends BaseActivity implements CardLoader.CallB
...
@@ -236,7 +236,7 @@ public class CardSearchActivity extends BaseActivity implements CardLoader.CallB
if
(
mDrawerlayout
.
isDrawerOpen
(
Constants
.
CARD_SEARCH_GRAVITY
))
{
if
(
mDrawerlayout
.
isDrawerOpen
(
Constants
.
CARD_SEARCH_GRAVITY
))
{
mDrawerlayout
.
closeDrawer
(
Constants
.
CARD_SEARCH_GRAVITY
);
mDrawerlayout
.
closeDrawer
(
Constants
.
CARD_SEARCH_GRAVITY
);
}
}
mCardListAdap
a
ter
.
setLimitList
(
limitList
);
mCardListAdapter
.
setLimitList
(
limitList
);
}
}
@Override
@Override
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckAdapater2.java
deleted
100644 → 0
View file @
0474dbee
package
cn.garymb.ygomobile.ui.cards.deck
;
import
android.content.Context
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
androidx.recyclerview.widget.RecyclerView
;
import
cn.garymb.ygomobile.Constants
;
import
cn.garymb.ygomobile.bean.DeckInfo
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.loader.ImageLoader
;
import
ocgcore.data.Card
;
import
ocgcore.data.LimitList
;
import
ocgcore.enums.LimitType
;
public
class
DeckAdapater2
extends
RecyclerView
.
Adapter
<
DeckViewHolder
>
{
private
final
ImageLoader
mImageLoader
;
private
final
DeckInfo
mDeck
;
private
LimitList
mLimitList
;
private
ImageTop
mImageTop
;
private
final
LabelInfo
mLabelInfo
;
private
Context
mContext
;
private
LayoutInflater
mLayoutInflater
;
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_MAX
-
1
;
public
final
static
int
SideLabel
=
ExtraEnd
+
1
;
public
final
static
int
SideStart
=
SideLabel
+
1
;
public
final
static
int
SideEnd
=
SideStart
+
Constants
.
DECK_SIDE_MAX
-
1
;
private
int
cardWidth
,
cardHeight
;
public
DeckAdapater2
(
Context
context
,
int
width
,
int
height
)
{
mContext
=
context
;
cardWidth
=
width
;
cardHeight
=
height
;
mLayoutInflater
=
LayoutInflater
.
from
(
context
);
mImageLoader
=
ImageLoader
.
get
(
context
);
mDeck
=
new
DeckInfo
();
mLabelInfo
=
new
LabelInfo
(
context
);
}
public
Context
getContext
()
{
return
mContext
;
}
public
void
updateDeck
(
DeckInfo
deck
)
{
mDeck
.
update
(
deck
);
mLabelInfo
.
update
(
deck
);
}
public
void
setLimitList
(
LimitList
limitList
)
{
mLimitList
=
limitList
;
}
public
ImageTop
getImageTop
()
{
if
(
mImageTop
==
null
)
{
mImageTop
=
new
ImageTop
(
getContext
());
}
return
mImageTop
;
}
public
boolean
isLabel
(
int
pos
)
{
return
pos
==
ExtraLabel
||
pos
==
MainLabel
||
pos
==
SideLabel
;
}
@Override
public
DeckViewHolder
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
)
{
View
view
=
mLayoutInflater
.
inflate
(
R
.
layout
.
item_deck_card2
,
parent
,
false
);
return
new
DeckViewHolder
(
view
);
}
@Override
public
int
getItemCount
()
{
return
Constants
.
DECK_EXTRA_MAX
+
Constants
.
DECK_MAIN_MAX
+
Constants
.
DECK_SIDE_MAX
+
3
;
}
@Override
public
void
onBindViewHolder
(
DeckViewHolder
holder
,
int
position
)
{
if
(
position
==
ExtraLabel
)
{
//61 62-76
holder
.
setText
(
mLabelInfo
.
getExtraString
());
}
else
if
(
position
==
MainLabel
)
{
//0 1-60
holder
.
setText
(
mLabelInfo
.
getMainString
());
}
else
if
(
position
==
SideLabel
)
{
//77 78-92
holder
.
setText
(
mLabelInfo
.
getSideString
());
}
else
{
holder
.
setSize
(
cardWidth
,
cardHeight
);
Card
card
=
null
;
if
(
inMain
(
position
))
{
card
=
mDeck
.
getMainCard
(
getMainIndex
(
position
));
}
else
if
(
inExtra
(
position
))
{
card
=
mDeck
.
getExtraCard
(
getExtraIndex
(
position
));
}
else
if
(
inSide
(
position
))
{
card
=
mDeck
.
getSideCard
(
getSideIndex
(
position
));
}
if
(
card
==
null
)
{
holder
.
showEmpty
();
}
else
{
holder
.
showImage
();
if
(
mLimitList
!=
null
)
{
if
(
mLimitList
.
check
(
card
,
LimitType
.
Forbidden
))
{
holder
.
setRightImage
(
getImageTop
().
forbidden
);
}
else
if
(
mLimitList
.
check
(
card
,
LimitType
.
Limit
))
{
holder
.
setRightImage
(
getImageTop
().
limit
);
}
else
if
(
mLimitList
.
check
(
card
,
LimitType
.
SemiLimit
))
{
holder
.
setRightImage
(
getImageTop
().
semiLimit
);
}
else
{
holder
.
setRightImage
(
null
);
}
}
else
{
holder
.
setRightImage
(
null
);
}
mImageLoader
.
bindImage
(
holder
.
cardImage
,
card
.
Code
);
}
}
}
private
int
getMainIndex
(
int
pos
)
{
return
pos
-
MainStart
;
}
private
int
getExtraIndex
(
int
pos
)
{
return
pos
-
ExtraStart
;
}
private
int
getSideIndex
(
int
pos
)
{
return
pos
-
SideStart
;
}
private
boolean
inMain
(
int
pos
)
{
return
pos
>=
MainStart
&&
pos
<=
MainEnd
;
}
private
boolean
inExtra
(
int
pos
)
{
return
pos
>=
ExtraStart
&&
pos
<=
ExtraEnd
;
}
private
boolean
inSide
(
int
pos
)
{
return
pos
>=
SideStart
&&
pos
<=
SideEnd
;
}
}
class
DeckData
{
}
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/deck/DeckLayoutManager2.java
deleted
100644 → 0
View file @
0474dbee
package
cn.garymb.ygomobile.ui.cards.deck
;
import
android.content.Context
;
import
androidx.recyclerview.widget.GridLayoutManager
;
public
class
DeckLayoutManager2
extends
GridLayoutManager
{
private
static
final
int
DEF_LINE_COUNT
=
10
;
private
static
final
int
DEF_LINE_MAX_COUNT
=
15
;
public
DeckLayoutManager2
(
Context
context
,
int
span
)
{
super
(
context
,
span
);
setSpanSizeLookup
(
new
SpanSizeLookup
()
{
@Override
public
int
getSpanSize
(
int
position
)
{
if
(
DeckItemUtils
.
isLabel
(
position
))
{
return
getChildCount
();
}
return
1
;
}
});
}
}
mobile/src/main/java/cn/garymb/ygomobile/ui/file/FileActivity.java
View file @
4aedbb45
...
@@ -244,7 +244,7 @@ public class FileActivity extends BaseActivity implements AdapterView.OnItemClic
...
@@ -244,7 +244,7 @@ public class FileActivity extends BaseActivity implements AdapterView.OnItemClic
}
else
{
}
else
{
mFileAdapter
.
setPath
(
mFileOpenInfo
.
getDefPath
());
mFileAdapter
.
setPath
(
mFileOpenInfo
.
getDefPath
());
}
}
mFileAdapter
.
setFile
f
ilter
(
mFileOpenInfo
.
getFileFilter
());
mFileAdapter
.
setFile
F
ilter
(
mFileOpenInfo
.
getFileFilter
());
mFileAdapter
.
setOnlyFolder
(
mFileOpenInfo
.
getType
()
==
FileOpenType
.
SelectFolder
);
mFileAdapter
.
setOnlyFolder
(
mFileOpenInfo
.
getType
()
==
FileOpenType
.
SelectFolder
);
mFileAdapter
.
loadFiles
();
mFileAdapter
.
loadFiles
();
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/file/FileAdapter.java
View file @
4aedbb45
...
@@ -42,17 +42,17 @@ class FileAdapter extends BaseAdapterPlus<File> {
...
@@ -42,17 +42,17 @@ class FileAdapter extends BaseAdapterPlus<File> {
public
FileAdapter
(
Context
context
)
{
public
FileAdapter
(
Context
context
)
{
super
(
context
);
super
(
context
);
rootPath
=
getRootPath
();
try
{
rootPath
=
Environment
.
getExternalStorageDirectory
().
getAbsolutePath
();
}
catch
(
Exception
e
)
{
rootPath
=
"/"
;
}
}
}
public
void
setOnPathChangedListener
(
OnPathChangedListener
onPathChangedListener
)
{
public
void
setOnPathChangedListener
(
OnPathChangedListener
onPathChangedListener
)
{
mOnPathChangedListener
=
onPathChangedListener
;
mOnPathChangedListener
=
onPathChangedListener
;
}
}
private
String
getRootPath
()
{
return
"/"
;
}
public
File
getCurPath
()
{
public
File
getCurPath
()
{
return
mCurPath
;
return
mCurPath
;
}
}
...
@@ -101,7 +101,7 @@ class FileAdapter extends BaseAdapterPlus<File> {
...
@@ -101,7 +101,7 @@ class FileAdapter extends BaseAdapterPlus<File> {
mShowHide
=
showHide
;
mShowHide
=
showHide
;
}
}
public
void
setFile
f
ilter
(
String
filefilter
)
{
public
void
setFile
F
ilter
(
String
filefilter
)
{
mFilefilter
=
filefilter
;
mFilefilter
=
filefilter
;
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
View file @
4aedbb45
...
@@ -92,8 +92,6 @@ import ocgcore.CardManager;
...
@@ -92,8 +92,6 @@ import ocgcore.CardManager;
import
ocgcore.data.Card
;
import
ocgcore.data.Card
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ASSET_SERVER_LIST
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ASSET_SERVER_LIST
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
URL_DONATE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
URL_DONATE_CN
;
public
abstract
class
HomeActivity
extends
BaseActivity
implements
NavigationView
.
OnNavigationItemSelectedListener
,
OnDuelAssistantListener
{
public
abstract
class
HomeActivity
extends
BaseActivity
implements
NavigationView
.
OnNavigationItemSelectedListener
,
OnDuelAssistantListener
{
...
@@ -296,13 +294,8 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
...
@@ -296,13 +294,8 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
switch
(
id
)
{
switch
(
id
)
{
case
R
.
id
.
nav_webpage
:
{
case
R
.
id
.
nav_webpage
:
{
String
url
;
String
url
;
if
(
BuildConfig
.
APPLICATION_ID
==
"cn.garymb.ygomobile.EN"
||
BuildConfig
.
APPLICATION_ID
==
"cn.garymb.ygomobile.KO"
)
{
url
=
URL_DONATE
;
}
else
{
url
=
URL_DONATE_CN
;
}
Intent
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
);
Intent
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
);
intent
.
setData
(
Uri
.
parse
(
url
));
intent
.
setData
(
Uri
.
parse
(
BuildConfig
.
URL_DONATE
));
startActivity
(
intent
);
startActivity
(
intent
);
}
}
break
;
break
;
...
@@ -352,7 +345,7 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
...
@@ -352,7 +345,7 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
Button
btnTutorial
=
viewDialog
.
findViewById
(
R
.
id
.
tutorial
);
Button
btnTutorial
=
viewDialog
.
findViewById
(
R
.
id
.
tutorial
);
btnMasterRule
.
setOnClickListener
((
v
)
->
{
btnMasterRule
.
setOnClickListener
((
v
)
->
{
WebActivity
.
open
(
this
,
getString
(
R
.
string
.
masterrule
),
Constants
.
URL_MASTERRULE_CN
);
WebActivity
.
open
(
this
,
getString
(
R
.
string
.
masterrule
),
Constants
.
URL_MASTER
_
RULE_CN
);
dialog
.
dismiss
();
dialog
.
dismiss
();
});
});
btnTutorial
.
setOnClickListener
((
v
)
->
{
btnTutorial
.
setOnClickListener
((
v
)
->
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
View file @
4aedbb45
...
@@ -22,7 +22,6 @@ import cn.garymb.ygomobile.AppsSettings;
...
@@ -22,7 +22,6 @@ import cn.garymb.ygomobile.AppsSettings;
import
cn.garymb.ygomobile.Constants
;
import
cn.garymb.ygomobile.Constants
;
import
cn.garymb.ygomobile.GameUriManager
;
import
cn.garymb.ygomobile.GameUriManager
;
import
cn.garymb.ygomobile.YGOStarter
;
import
cn.garymb.ygomobile.YGOStarter
;
import
cn.garymb.ygomobile.core.IrrlichtBridge
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.ui.activities.WebActivity
;
import
cn.garymb.ygomobile.ui.activities.WebActivity
;
import
cn.garymb.ygomobile.ui.plus.DialogPlus
;
import
cn.garymb.ygomobile.ui.plus.DialogPlus
;
...
@@ -106,7 +105,7 @@ public class MainActivity extends HomeActivity {
...
@@ -106,7 +105,7 @@ public class MainActivity extends HomeActivity {
Button
btnTutorial
=
viewDialog
.
findViewById
(
R
.
id
.
tutorial
);
Button
btnTutorial
=
viewDialog
.
findViewById
(
R
.
id
.
tutorial
);
btnMasterRule
.
setOnClickListener
((
v
)
->
{
btnMasterRule
.
setOnClickListener
((
v
)
->
{
WebActivity
.
open
(
this
,
getString
(
R
.
string
.
masterrule
),
Constants
.
URL_MASTERRULE_CN
);
WebActivity
.
open
(
this
,
getString
(
R
.
string
.
masterrule
),
Constants
.
URL_MASTER
_
RULE_CN
);
dialog
.
dismiss
();
dialog
.
dismiss
();
});
});
btnTutorial
.
setOnClickListener
((
v
)
->
{
btnTutorial
.
setOnClickListener
((
v
)
->
{
...
...
mobile/src/main/java/ocgcore/CardManager.java
View file @
4aedbb45
...
@@ -110,7 +110,13 @@ public class CardManager {
...
@@ -110,7 +110,13 @@ public class CardManager {
}
}
public
Card
getCard
(
int
code
)
{
public
Card
getCard
(
int
code
)
{
return
cardDataHashMap
.
get
(
Integer
.
valueOf
(
code
));
Card
card
=
cardDataHashMap
.
get
(
code
);
if
(
card
==
null
){
card
=
new
Card
(
code
);
cardDataHashMap
.
put
(
code
,
new
Card
(
code
));
return
card
;
}
return
card
;
}
}
public
int
getCount
()
{
public
int
getCount
()
{
...
...
mobile/src/main/java/ocgcore/data/Card.java
View file @
4aedbb45
...
@@ -35,6 +35,7 @@ public class Card extends CardData implements Parcelable {
...
@@ -35,6 +35,7 @@ public class Card extends CardData implements Parcelable {
public
Card
(
int
code
)
{
public
Card
(
int
code
)
{
super
(
code
);
super
(
code
);
this
.
Name
=
"Unknown"
;
}
}
public
Card
(
CardData
cardData
)
{
public
Card
(
CardData
cardData
)
{
...
...
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