Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile-Cn-Ko-En
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-Cn-Ko-En
Commits
3a5df330
Commit
3a5df330
authored
Jul 19, 2019
by
fallenstardust
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/fallenstardust/YGOMobile-cn-ko-en
parents
826024bb
59cdbf17
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
11 deletions
+45
-11
build.gradle
build.gradle
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/BaseActivity.java
.../java/cn/garymb/ygomobile/ui/activities/BaseActivity.java
+0
-5
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/FileLogActivity.java
...va/cn/garymb/ygomobile/ui/activities/FileLogActivity.java
+33
-0
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/mcchat/util/TaxiConnectionListener.java
...omobile/ui/mycard/mcchat/util/TaxiConnectionListener.java
+0
-4
mobile/src/main/java/cn/garymb/ygomobile/utils/FileLogUtil.java
.../src/main/java/cn/garymb/ygomobile/utils/FileLogUtil.java
+11
-1
No files found.
build.gradle
View file @
3a5df330
...
...
@@ -7,7 +7,7 @@ buildscript {
google
()
}
dependencies
{
classpath
'com.android.tools.build:gradle:3.4.
1
'
classpath
'com.android.tools.build:gradle:3.4.
2
'
//classpath 'me.tatarka:gradle-retrolambda:3.2.5'
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/BaseActivity.java
View file @
3a5df330
...
...
@@ -230,11 +230,6 @@ public class BaseActivity extends AppCompatActivity {
@Override
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
try
{
FileLogUtil
.
writeAndTime
(
"resultcode值"
+
resultCode
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
// 拒绝时, 关闭页面, 缺少主要权限, 无法运行
if
(
requestCode
==
REQUEST_PERMISSIONS
&&
resultCode
==
PermissionsActivity
.
PERMISSIONS_DENIED
)
{
showToast
(
"喵不给我权限让我怎么运行?!"
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/FileLogActivity.java
View file @
3a5df330
package
cn.garymb.ygomobile.ui.activities
;
import
android.content.DialogInterface
;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
import
android.support.v7.widget.Toolbar
;
...
...
@@ -9,6 +10,7 @@ import android.widget.TextView;
import
java.io.IOException
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.ui.plus.DialogPlus
;
import
cn.garymb.ygomobile.utils.FileLogUtil
;
public
class
FileLogActivity
extends
BaseActivity
{
...
...
@@ -36,6 +38,37 @@ public class FileLogActivity extends BaseActivity {
}
});
tv_log
.
setOnLongClickListener
(
new
View
.
OnLongClickListener
()
{
@Override
public
boolean
onLongClick
(
View
v
)
{
DialogPlus
dialogPlus
=
new
DialogPlus
(
FileLogActivity
.
this
);
dialogPlus
.
setMessage
(
"确认清空日志?"
);
dialogPlus
.
setLeftButtonText
(
"清空"
);
dialogPlus
.
setRightButtonText
(
"取消"
);
dialogPlus
.
setLeftButtonListener
(
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
try
{
FileLogUtil
.
clear
();
showToast
(
"清空完毕"
);
tv_log
.
setText
(
""
);
}
catch
(
IOException
e
)
{
showToast
(
"清空失败,原因为"
+
e
.
getMessage
());
}
dialog
.
dismiss
();
}
});
dialogPlus
.
setRightButtonListener
(
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
dialog
.
dismiss
();
}
});
dialogPlus
.
show
();
return
true
;
}
});
}
private
void
read
()
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/mycard/mcchat/util/TaxiConnectionListener.java
View file @
3a5df330
...
...
@@ -79,7 +79,6 @@ public class TaxiConnectionListener implements ConnectionListener {
}
catch
(
Exception
e
)
{
tExit
.
schedule
(
new
timetask
(),
logintime
);
}
}
}
...
...
@@ -96,12 +95,9 @@ public class TaxiConnectionListener implements ConnectionListener {
Log
.
e
(
"TaxiConnectionListener"
,
"重新加入房间"
);
tExit
.
schedule
(
new
timeJoin
(),
logintime
);
}
// TODO: Implement this method
}
}
}
}
mobile/src/main/java/cn/garymb/ygomobile/utils/FileLogUtil.java
View file @
3a5df330
...
...
@@ -21,19 +21,29 @@ public class FileLogUtil {
return
new
File
(
AppsSettings
.
get
().
getResourcePath
(),
"YGOMobile.log"
);
}
public
static
void
clear
()
throws
IOException
{
write
(
""
,
false
);
}
public
static
void
writeAndTime
(
String
message
)
throws
IOException
{
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"MM-dd HH:mm"
);
// HH:mm:ss
// 获取当前时间
Date
date
=
new
Date
(
System
.
currentTimeMillis
());
//追加内容写入
write
(
simpleDateFormat
.
format
(
date
)
+
": "
+
message
);
}
public
static
void
write
(
String
message
)
throws
IOException
{
write
(
message
,
true
);
}
public
static
void
write
(
String
message
,
boolean
append
)
throws
IOException
{
FileWriter
fw
=
null
;
//如果文件存在,则追加内容;如果文件不存在,则创建文件
File
f
=
getConfigFile
();
fw
=
new
FileWriter
(
f
,
true
);
fw
=
new
FileWriter
(
f
,
append
);
PrintWriter
pw
=
new
PrintWriter
(
fw
);
if
(
writeNum
==
0
)
...
...
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