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
4792f85f
Commit
4792f85f
authored
Sep 14, 2023
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
直接在addserver时初始化xmlfile
parent
dbafd310
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardListFragment.java
.../java/cn/garymb/ygomobile/ex_card/ExCardListFragment.java
+1
-3
mobile/src/main/java/cn/garymb/ygomobile/utils/ServerUtil.java
...e/src/main/java/cn/garymb/ygomobile/utils/ServerUtil.java
+2
-1
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ex_card/ExCardListFragment.java
View file @
4792f85f
...
...
@@ -67,7 +67,6 @@ public class ExCardListFragment extends Fragment implements View.OnClickListener
private
RecyclerView
mExCardListView
;
private
LinearLayout
ll_Download
;
private
TextView
textDownload
;
private
File
xmlFile
;
private
int
FailedCount
;
/**
...
...
@@ -90,7 +89,6 @@ public class ExCardListFragment extends Fragment implements View.OnClickListener
layoutView
=
inflater
.
inflate
(
R
.
layout
.
fragment_ex_card_list
,
container
,
false
);
this
.
context
=
getContext
();
xmlFile
=
new
File
(
context
.
getFilesDir
(),
Constants
.
SERVER_FILE
);
//读取文件路径下的server_list.xml
initView
(
layoutView
);
if
(!
EventBus
.
getDefault
().
isRegistered
(
this
))
{
//加上判断
...
...
@@ -181,7 +179,7 @@ public class ExCardListFragment extends Fragment implements View.OnClickListener
servername
=
"YGOPRO 사전 게시 중국서버"
;
if
(
AppsSettings
.
get
().
getDataLanguage
()
==
2
)
servername
=
"Mercury23333 OCG/TCG Pre-release"
;
AddServer
(
getActivity
(),
xmlFile
,
servername
,
"s1.ygo233.com"
,
23333
,
"Knight of Hanoi"
);
AddServer
(
getActivity
(),
servername
,
"s1.ygo233.com"
,
23333
,
"Knight of Hanoi"
);
//changeDownloadButton();在下载完成后,通过EventBus通知下载完成(加入用户点击下载后临时切出本fragment,又在下载完成后切回,通过eventbus能保证按钮样式正确更新
/* 注意,要先更新版本号 */
...
...
mobile/src/main/java/cn/garymb/ygomobile/utils/ServerUtil.java
View file @
4792f85f
...
...
@@ -105,7 +105,8 @@ public class ServerUtil {
* @param port
* @param playerName
*/
public
static
void
AddServer
(
Context
context
,
File
xmlFile
,
String
name
,
String
Addr
,
int
port
,
String
playerName
)
{
public
static
void
AddServer
(
Context
context
,
String
name
,
String
Addr
,
int
port
,
String
playerName
)
{
File
xmlFile
=
new
File
(
context
.
getFilesDir
(),
Constants
.
SERVER_FILE
);
//读取文件路径下的server_list.xml
List
<
ServerInfo
>
serverInfos
=
new
ArrayList
<>();
ServerInfo
mServerInfo
=
new
ServerInfo
();
mServerInfo
.
setName
(
name
);
...
...
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