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
aa6f2d2f
Commit
aa6f2d2f
authored
Jun 13, 2023
by
fallenstardust
Committed by
GitHub
Jun 13, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #109 from zhuhongbozhuhongbo/master
这次真的改好了!!
parents
ea1b7f39
d8bd8518
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
89 additions
and
73 deletions
+89
-73
.gitignore
.gitignore
+0
-1
gradle.properties
gradle.properties
+1
-0
mobile/assets/data/windbot/windbot/Dialogs/Zefra.kor.json
mobile/assets/data/windbot/windbot/Dialogs/Zefra.kor.json
+53
-53
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCard.java
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCard.java
+2
-2
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardActivity.java
...main/java/cn/garymb/ygomobile/ex_card/ExCardActivity.java
+2
-1
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardListAdapter.java
...n/java/cn/garymb/ygomobile/ex_card/ExCardListAdapter.java
+5
-4
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardListFragment.java
.../java/cn/garymb/ygomobile/ex_card/ExCardListFragment.java
+19
-6
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardLogFragment.java
...n/java/cn/garymb/ygomobile/ex_card/ExCardLogFragment.java
+3
-3
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeFragment.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeFragment.java
+1
-0
mobile/src/main/res/layout/fragment_ex_card_list.xml
mobile/src/main/res/layout/fragment_ex_card_list.xml
+3
-3
No files found.
.gitignore
View file @
aa6f2d2f
...
...
@@ -58,7 +58,6 @@ output.json
/libcore/.cxx
/libygo/.cxx
/mobile/assets/data/single
/mobile/assets/data/pack
/mobile/assets/en/data/*.cdb
/mobile/assets/kor/data/*.cdb
gradle.properties
View file @
aa6f2d2f
...
...
@@ -16,6 +16,7 @@ org.gradle.parallel=true
android.enableJetifier
=
true
android.useAndroidX
=
true
android.injected.testOnly
=
false
org.gradle.unsafe.configuration-cache
=
true
android.defaults.buildfeatures.buildconfig
=
true
android.nonTransitiveRClass
=
false
android.nonFinalResIds
=
false
\ No newline at end of file
mobile/assets/data/windbot/windbot/Dialogs/Zefra.kor.json
View file @
aa6f2d2f
{
"welcome"
:
[
"안녕하세요. 듀얼리스트분들~"
,
"안녕하세요. 듀얼 필드에 어서오세요."
],
"deckerror"
:
[
"죄송합니다. {0} 덱이 필요합니다."
],
"duelstart"
:
[
"하하, 듀얼 시작이다."
,
"내 덱은 금제를 따르지 않아서, 금지 카드 몇 장이 있을 수 있다고?"
,
"나는 간단한 듀얼만 할 줄 아니까, 금지 카드로 날 이겨보시지."
],
"newturn"
:
[
"아자! 드로우! (카드를 뽑으면서)"
,
"드로우할께요."
],
"endturn"
:
[
"내 턴 종료다. 네 턴이야."
,
"네 턴이구나, 설마 반칙은 하지 않겠지?"
],
"directattack"
:
[
"{0}, 상대를 공격!"
,
"{0}, 박살!"
,
"{0}, 공격!"
],
"attack"
:
[
"{0}, {1}을 박살내!"
,
"하하, {0}, {1}을 공격!"
],
"ondirectattack"
:
[
"아, 공격하지마. 금지 카드 허용해줄께."
,
"아, 너무 맵다. 왜 이러니?"
,
"아파... 랜뽑하고 싶네."
],
"facedownmonstername"
:
"몬스터"
,
"activate"
:
[
"하하, {0} 발동!"
,
"헤헤, 나는 {0}을 발동하겠다!"
],
"summon"
:
[
"나는 {0}을(를) 소환하겠어!"
,
"나와라, 내가 좋아하는 몬스터 {0}!"
],
"setmonster"
:
[
"나는 모를 법한 몬스터 한 마리를 세트한다."
],
"chaining"
:
[
"어이, 나를 금지 카드로 보낼 수 있을까나?"
,
"아, 내가 {0}을(를) 발동할께!"
,
"미안한데, 나는 {0}을(를) 발동할께~"
,
"하하, {0} 효과다!"
]
{
"welcome"
:
[
"안녕하세요. 듀얼리스트분들~"
,
"안녕하세요. 듀얼 필드에 어서오세요."
],
"deckerror"
:
[
"죄송합니다. {0} 덱이 필요합니다."
],
"duelstart"
:
[
"하하, 듀얼 시작이다."
,
"내 덱은 금제를 따르지 않아서, 금지 카드 몇 장이 있을 수 있다고?"
,
"나는 간단한 듀얼만 할 줄 아니까, 금지 카드로 날 이겨보시지."
],
"newturn"
:
[
"아자! 드로우! (카드를 뽑으면서)"
,
"드로우할께요."
],
"endturn"
:
[
"내 턴 종료다. 네 턴이야."
,
"네 턴이구나, 설마 반칙은 하지 않겠지?"
],
"directattack"
:
[
"{0}, 상대를 공격!"
,
"{0}, 박살!"
,
"{0}, 공격!"
],
"attack"
:
[
"{0}, {1}을 박살내!"
,
"하하, {0}, {1}을 공격!"
],
"ondirectattack"
:
[
"아, 공격하지마. 금지 카드 허용해줄께."
,
"아, 너무 맵다. 왜 이러니?"
,
"아파... 랜뽑하고 싶네."
],
"facedownmonstername"
:
"몬스터"
,
"activate"
:
[
"하하, {0} 발동!"
,
"헤헤, 나는 {0}을 발동하겠다!"
],
"summon"
:
[
"나는 {0}을(를) 소환하겠어!"
,
"나와라, 내가 좋아하는 몬스터 {0}!"
],
"setmonster"
:
[
"나는 모를 법한 몬스터 한 마리를 세트한다."
],
"chaining"
:
[
"어이, 나를 금지 카드로 보낼 수 있을까나?"
,
"아, 내가 {0}을(를) 발동할께!"
,
"미안한데, 나는 {0}을(를) 발동할께~"
,
"하하, {0} 효과다!"
]
}
\ No newline at end of file
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCard.java
View file @
aa6f2d2f
...
...
@@ -4,9 +4,9 @@ import android.os.Parcel;
import
android.os.Parcelable
;
/*
This class contains two
information types
:ex-card information and updating log, which is marked
This class contains two
types of card information
:ex-card information and updating log, which is marked
by "type 0" and "type 1", respectively.
本类包括两种
信息,先行卡信息和更新日志(分别对应type 0和type 1
)。
本类包括两种
卡牌信息,先行卡信息和更新日志(分别由·type 0和type 1表示
)。
*/
public
class
ExCard
implements
Parcelable
{
private
String
name
;
...
...
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardActivity.java
View file @
aa6f2d2f
...
...
@@ -13,6 +13,7 @@ import cn.garymb.ygomobile.lite.R;
import
cn.garymb.ygomobile.ui.activities.BaseActivity
;
public
class
ExCardActivity
extends
BaseActivity
{
private
static
final
String
TAG
=
String
.
valueOf
(
ExCardActivity
.
class
);
private
Context
context
;
private
Toolbar
toolbar
;
public
static
TabLayout
tabLayout
;
...
...
@@ -35,7 +36,7 @@ public class ExCardActivity extends BaseActivity {
protected
void
onDestroy
()
{
super
.
onDestroy
();
Log
.
i
(
"webCrawler"
,
"excard activity destroy"
);
Log
.
i
(
TAG
,
"excard activity destroy"
);
}
private
void
createTabFragment
()
{
adapter
=
new
PackageTabAdapter
(
getSupportFragmentManager
(),
tabLayout
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardListAdapter.java
View file @
aa6f2d2f
...
...
@@ -2,6 +2,7 @@ package cn.garymb.ygomobile.ex_card;
import
android.graphics.drawable.Drawable
;
import
android.util.Log
;
import
android.widget.ImageView
;
import
com.bumptech.glide.RequestBuilder
;
...
...
@@ -23,7 +24,7 @@ import cn.garymb.ygomobile.ui.plus.VUiKit;
import
cn.garymb.ygomobile.utils.glide.GlideCompat
;
public
class
ExCardListAdapter
extends
BaseQuickAdapter
<
ExCard
,
BaseViewHolder
>
{
private
static
final
String
TAG
=
String
.
valueOf
(
ExCardListAdapter
.
class
);
private
ImageLoader
imageLoader
;
public
ExCardListAdapter
(
int
layoutResId
)
{
...
...
@@ -39,7 +40,7 @@ public class ExCardListAdapter extends BaseQuickAdapter<ExCard, BaseViewHolder>
Element
pre_card_content
=
document
.
getElementById
(
"pre_release_cards"
);
Element
tbody
=
pre_card_content
.
getElementsByTag
(
"tbody"
).
get
(
0
);
Elements
cards
=
tbody
.
getElementsByTag
(
"tr"
);
if
(
cards
.
size
()
>
1
000
)
{
//Considering the efficiency of html parse, if the size of
if
(
cards
.
size
()
>
5
000
)
{
//Considering the efficiency of html parse, if the size of
// pre cards list is to large, return null directly.
return
null
;
}
...
...
@@ -70,11 +71,11 @@ public class ExCardListAdapter extends BaseQuickAdapter<ExCard, BaseViewHolder>
}
}
//Log.i("webCrawler"
, "webCrawler fail");
Log
.
i
(
TAG
,
"webCrawler fail"
);
}).
done
(
exCardList
->
{
if
(
exCardList
!=
null
)
{
//Log.i("webCrawler"
, "webCrawler done");
Log
.
i
(
TAG
,
"webCrawler done"
);
getData
().
clear
();
addData
(
exCardList
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardListFragment.java
View file @
aa6f2d2f
...
...
@@ -15,6 +15,7 @@ import android.util.Log;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.Button
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
android.widget.Toast
;
...
...
@@ -57,12 +58,12 @@ import ocgcore.DataManager;
public
class
ExCardListFragment
extends
Fragment
{
private
static
final
String
TAG
=
String
.
valueOf
(
ExCardListFragment
.
class
);
private
Context
context
;
private
View
layoutView
;
private
ExCardListAdapter
mExCardListAdapter
;
private
RecyclerView
mExCardListView
;
private
LinearLayout
btnDownload
;
private
Button
btnDownload
;
private
TextView
textDownload
;
private
List
<
ServerInfo
>
serverInfos
;
private
ServerInfo
mServerInfo
;
...
...
@@ -101,10 +102,11 @@ public class ExCardListFragment extends Fragment {
@Override
public
void
onStop
()
{
super
.
onStop
();
Log
.
i
(
"webCrawler"
,
"excard fragmetn
on stop"
);
Log
.
i
(
TAG
,
"excard fragment
on stop"
);
if
(
EventBus
.
getDefault
().
isRegistered
(
this
))
//加上判断
EventBus
.
getDefault
().
unregister
(
this
);
}
public
void
initView
(
View
layoutView
)
{
mExCardListView
=
layoutView
.
findViewById
(
R
.
id
.
list_ex_card
);
mExCardListAdapter
=
new
ExCardListAdapter
(
R
.
layout
.
item_ex_card
);
...
...
@@ -116,7 +118,17 @@ public class ExCardListFragment extends Fragment {
textDownload
=
layoutView
.
findViewById
(
R
.
id
.
text_download_prerelease
);
btnDownload
=
layoutView
.
findViewById
(
R
.
id
.
btn_download_prerelease
);
//TODO
//偷个懒,两个按钮的回调实现相同。For convenience I set two callbacks of a buttons
// have same implementation.
textDownload
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
if
(
downloadState
!=
DownloadState
.
DOWNLOAD_ING
)
{
downloadState
=
DownloadState
.
DOWNLOAD_ING
;
downloadfromWeb
(
URL_YGO233_FILE
);
}
}
});
btnDownload
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
...
...
@@ -200,7 +212,8 @@ public class ExCardListFragment extends Fragment {
break
;
case
UnzipUtils
.
ZIP_UNZIP_EXCEPTION
:
Toast
.
makeText
(
context
,
getString
(
R
.
string
.
install_failed_bcos
)
+
msg
.
obj
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
context
,
getString
(
R
.
string
.
install_failed_bcos
)
+
msg
.
obj
,
Toast
.
LENGTH_SHORT
).
show
();
break
;
// case HomeFragment.TYPE_GET_DATA_VER_OK:
// WebActivity.exCardVer = msg.obj.toString();
...
...
@@ -310,7 +323,7 @@ public class ExCardListFragment extends Fragment {
if
(
files
.
getName
().
contains
(
"-"
)
&&
files
.
getName
().
contains
(
" new cards"
))
files
.
delete
();
}
UnzipUtils
.
upZipSelectFile
(
file
,
AppsSettings
.
get
().
getResourcePath
(),
".ypk"
);
UnzipUtils
.
upZipSelectFile
(
file
,
AppsSettings
.
get
().
getResourcePath
(),
".ypk"
);
}
catch
(
Exception
e
)
{
message
.
what
=
UnzipUtils
.
ZIP_UNZIP_EXCEPTION
;
}
finally
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardLogFragment.java
View file @
aa6f2d2f
...
...
@@ -24,7 +24,7 @@ import cn.garymb.ygomobile.ui.plus.DialogPlus;
import
cn.garymb.ygomobile.ui.plus.VUiKit
;
public
class
ExCardLogFragment
extends
Fragment
{
private
static
final
String
TAG
=
String
.
valueOf
(
ExCardLogFragment
.
class
);
private
View
layoutView
;
private
ExCardLogAdapter
mExCardLogAdapter
;
...
...
@@ -93,7 +93,7 @@ public class ExCardLogFragment extends Fragment {
}
}
Log
.
i
(
"webCrawler"
,
"webCrawler fail"
);
Log
.
i
(
TAG
,
"webCrawler fail"
);
}).
done
(
exCardLogList
->
{
mExCardLogAdapter
.
setData
(
exCardLogList
);
mExCardLogAdapter
.
notifyDataSetChanged
();
...
...
@@ -102,7 +102,7 @@ public class ExCardLogFragment extends Fragment {
mExCardLogView
.
expandGroup
(
1
);
mExCardLogView
.
expandGroup
(
2
);
if
(
exCardLogList
!=
null
)
{
Log
.
i
(
"webCrawler"
,
"webCrawler parse html complete"
);
Log
.
i
(
TAG
,
"webCrawler parse html complete"
);
}
//关闭异常
if
(
dialog_read_ex
.
isShowing
())
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeFragment.java
View file @
aa6f2d2f
...
...
@@ -139,6 +139,7 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene
if
(!
EventBus
.
getDefault
().
isRegistered
(
this
))
{
//加上判断
EventBus
.
getDefault
().
register
(
this
);
}
ServerUtil
.
initExCardState
();
//HomeActivity中会调用一次本函数,此处再次调用是因为有时候HomeFragment的onCreateView()函数执行较慢,导致initExCardState()中eventbus事件发布完毕后仍未注册,因此在此处再调用一次检查,再次发布
changeColor
();
//showNewbieGuide("homePage");
return
layoutView
;
...
...
mobile/src/main/res/layout/fragment_ex_card_list.xml
View file @
aa6f2d2f
...
...
@@ -15,7 +15,6 @@
android:scrollbars=
"vertical"
/>
<LinearLayout
android:id=
"@+id/btn_download_prerelease"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom|right"
...
...
@@ -24,14 +23,15 @@
android:clickable=
"true"
android:focusableInTouchMode=
"true"
android:orientation=
"vertical"
android:padding=
"
2
0dp"
>
android:padding=
"
1
0dp"
>
<Button
android:id=
"@+id/btn_download_prerelease"
android:layout_width=
"60dp"
android:layout_height=
"60dp"
android:layout_gravity=
"center"
android:layout_marginBottom=
"
10
dp"
android:layout_marginBottom=
"
5
dp"
android:background=
"@drawable/downloadimages"
android:clickable=
"false"
/>
...
...
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