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
51f4fee8
Commit
51f4fee8
authored
Jun 09, 2018
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加tips
parent
d0044273
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
273 additions
and
2 deletions
+273
-2
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/YGOStarter.java
mobile/src/main/java/cn/garymb/ygomobile/YGOStarter.java
+4
-1
mobile/src/main/java/cn/garymb/ygomobile/utils/ToastUtil.java
...le/src/main/java/cn/garymb/ygomobile/utils/ToastUtil.java
+193
-0
mobile/src/main/res/values-ko/arrays.xml
mobile/src/main/res/values-ko/arrays.xml
+29
-0
mobile/src/main/res/values-zh/arrays.xml
mobile/src/main/res/values-zh/arrays.xml
+29
-0
mobile/src/main/res/values/arrays.xml
mobile/src/main/res/values/arrays.xml
+17
-0
No files found.
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
View file @
51f4fee8
...
@@ -30,7 +30,7 @@ public interface Constants {
...
@@ -30,7 +30,7 @@ public interface Constants {
String
PREF_LOCK_SCREEN
=
"pref_key_game_screen_orientation"
;
String
PREF_LOCK_SCREEN
=
"pref_key_game_screen_orientation"
;
boolean
PREF_DEF_LOCK_SCREEN
=
true
;
boolean
PREF_DEF_LOCK_SCREEN
=
true
;
String
PREF_IMMERSIVE_MODE
=
"pref_key_immersive_mode"
;
String
PREF_IMMERSIVE_MODE
=
"pref_key_immersive_mode"
;
boolean
PREF_DEF_IMMERSIVE_MODE
=
tru
e
;
boolean
PREF_DEF_IMMERSIVE_MODE
=
fals
e
;
String
PREF_SENSOR_REFRESH
=
"pref_key_sensor_refresh"
;
String
PREF_SENSOR_REFRESH
=
"pref_key_sensor_refresh"
;
boolean
PREF_DEF_SENSOR_REFRESH
=
true
;
boolean
PREF_DEF_SENSOR_REFRESH
=
true
;
String
PREF_CHANGE_LOG
=
"pref_key_change_log"
;
String
PREF_CHANGE_LOG
=
"pref_key_change_log"
;
...
...
mobile/src/main/java/cn/garymb/ygomobile/YGOStarter.java
View file @
51f4fee8
...
@@ -159,7 +159,10 @@ public class YGOStarter {
...
@@ -159,7 +159,10 @@ public class YGOStarter {
lasttime
=
System
.
currentTimeMillis
();
lasttime
=
System
.
currentTimeMillis
();
showLoadingBg
(
activity
);
showLoadingBg
(
activity
);
if
(!
ComponentUtils
.
isActivityRunning
(
activity
,
new
ComponentName
(
activity
,
YGOMobileActivity
.
class
)))
{
if
(!
ComponentUtils
.
isActivityRunning
(
activity
,
new
ComponentName
(
activity
,
YGOMobileActivity
.
class
)))
{
Toast
.
makeText
(
activity
,
R
.
string
.
load_game
,
Toast
.
LENGTH_SHORT
).
show
();
String
[]
tipsList
=
activity
.
getResources
().
getStringArray
(
R
.
array
.
tips
);
int
x
=(
int
)(
Math
.
random
()
*
tipsList
.
length
);
String
tips
=
tipsList
[
x
];
Toast
.
makeText
(
activity
,
tips
,
Toast
.
LENGTH_LONG
).
show
();
}
}
Intent
intent
=
new
Intent
(
activity
,
YGOMobileActivity
.
class
);
Intent
intent
=
new
Intent
(
activity
,
YGOMobileActivity
.
class
);
if
(
options
!=
null
)
{
if
(
options
!=
null
)
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/utils/ToastUtil.java
0 → 100644
View file @
51f4fee8
package
cn.garymb.ygomobile.utils
;
import
android.content.Context
;
import
android.view.View
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
android.widget.Toast
;
/*ToastUtil toastUtil=new ToastUtil();
toastUtil.Short(MainActivity.this,"自定义message字体、背景色").setToastColor(Color.WHITE, getResources().getColor(R.color.colorAccent)).show();
*/
public
class
ToastUtil
{
private
Toast
toast
;
private
LinearLayout
toastView
;
/**
* 修改原布局的Toast
*/
public
ToastUtil
()
{
}
/**
* 完全自定义布局Toast
* @param context
* @param view
*/
public
ToastUtil
(
Context
context
,
View
view
,
int
duration
){
toast
=
new
Toast
(
context
);
toast
.
setView
(
view
);
toast
.
setDuration
(
duration
);
}
/**
* 向Toast中添加自定义view
* @param view
* @param postion
* @return
*/
public
ToastUtil
addView
(
View
view
,
int
postion
)
{
toastView
=
(
LinearLayout
)
toast
.
getView
();
toastView
.
addView
(
view
,
postion
);
return
this
;
}
/**
* 设置Toast字体及背景颜色
* @param messageColor
* @param backgroundColor
* @return
*/
public
ToastUtil
setToastColor
(
int
messageColor
,
int
backgroundColor
)
{
View
view
=
toast
.
getView
();
if
(
view
!=
null
){
TextView
message
=((
TextView
)
view
.
findViewById
(
android
.
R
.
id
.
message
));
message
.
setBackgroundColor
(
backgroundColor
);
message
.
setTextColor
(
messageColor
);
}
return
this
;
}
/**
* 设置Toast字体及背景
* @param messageColor
* @param background
* @return
*/
public
ToastUtil
setToastBackground
(
int
messageColor
,
int
background
)
{
View
view
=
toast
.
getView
();
if
(
view
!=
null
){
TextView
message
=((
TextView
)
view
.
findViewById
(
android
.
R
.
id
.
message
));
message
.
setBackgroundResource
(
background
);
message
.
setTextColor
(
messageColor
);
}
return
this
;
}
/**
* 短时间显示Toast
*/
public
ToastUtil
Short
(
Context
context
,
CharSequence
message
){
if
(
toast
==
null
||(
toastView
!=
null
&&
toastView
.
getChildCount
()>
1
)){
toast
=
Toast
.
makeText
(
context
,
message
,
Toast
.
LENGTH_SHORT
);
toastView
=
null
;
}
else
{
toast
.
setText
(
message
);
toast
.
setDuration
(
Toast
.
LENGTH_SHORT
);
}
return
this
;
}
/**
* 短时间显示Toast
*/
public
ToastUtil
Short
(
Context
context
,
int
message
)
{
if
(
toast
==
null
||(
toastView
!=
null
&&
toastView
.
getChildCount
()>
1
)){
toast
=
Toast
.
makeText
(
context
,
message
,
Toast
.
LENGTH_SHORT
);
toastView
=
null
;
}
else
{
toast
.
setText
(
message
);
toast
.
setDuration
(
Toast
.
LENGTH_SHORT
);
}
return
this
;
}
/**
* 长时间显示Toast
*/
public
ToastUtil
Long
(
Context
context
,
CharSequence
message
){
if
(
toast
==
null
||(
toastView
!=
null
&&
toastView
.
getChildCount
()>
1
)){
toast
=
Toast
.
makeText
(
context
,
message
,
Toast
.
LENGTH_LONG
);
toastView
=
null
;
}
else
{
toast
.
setText
(
message
);
toast
.
setDuration
(
Toast
.
LENGTH_LONG
);
}
return
this
;
}
/**
* 长时间显示Toast
*
* @param context
* @param message
*/
public
ToastUtil
Long
(
Context
context
,
int
message
)
{
if
(
toast
==
null
||(
toastView
!=
null
&&
toastView
.
getChildCount
()>
1
)){
toast
=
Toast
.
makeText
(
context
,
message
,
Toast
.
LENGTH_LONG
);
toastView
=
null
;
}
else
{
toast
.
setText
(
message
);
toast
.
setDuration
(
Toast
.
LENGTH_LONG
);
}
return
this
;
}
/**
* 自定义显示Toast时间
*
* @param context
* @param message
* @param duration
*/
public
ToastUtil
Indefinite
(
Context
context
,
CharSequence
message
,
int
duration
)
{
if
(
toast
==
null
||(
toastView
!=
null
&&
toastView
.
getChildCount
()>
1
)){
toast
=
Toast
.
makeText
(
context
,
message
,
duration
);
toastView
=
null
;
}
else
{
toast
.
setText
(
message
);
toast
.
setDuration
(
duration
);
}
return
this
;
}
/**
* 自定义显示Toast时间
*
* @param context
* @param message
* @param duration
*/
public
ToastUtil
Indefinite
(
Context
context
,
int
message
,
int
duration
)
{
if
(
toast
==
null
||(
toastView
!=
null
&&
toastView
.
getChildCount
()>
1
)){
toast
=
Toast
.
makeText
(
context
,
message
,
duration
);
toastView
=
null
;
}
else
{
toast
.
setText
(
message
);
toast
.
setDuration
(
duration
);
}
return
this
;
}
/**
* 显示Toast
* @return
*/
public
ToastUtil
show
(){
toast
.
show
();
return
this
;
}
/**
* 获取Toast
* @return
*/
public
Toast
getToast
(){
return
toast
;
}
}
mobile/src/main/res/values-ko/arrays.xml
0 → 100644
View file @
51f4fee8
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array
name=
"opengl_version_value"
translatable=
"false"
>
<item>
0
</item>
<item>
1
</item>
<item>
2
</item>
</string-array>
<string-array
name=
"card_quality_value"
translatable=
"false"
>
<item>
0
</item>
<item>
1
</item>
</string-array>
<string-array
name=
"tips"
>
<item>
游戏王圈子不大,珍惜一起玩的人
</item>
<item>
点击卡片却偏到另一张?试试去「设置」→打勾/取消「在游戏隐藏虚拟键」
</item>
<item>
主页每个服务器按住左划就会出现「编辑」和「删除」哦
</item>
<item>
试试点击左下角浮动的「贤者之石」会有更多功能
</item>
<item>
想不联网也打人机?左下角→「单人游戏」→「人机模式」
</item>
<item>
卡图怎么没了?点击左下角→「重置资源」
</item>
<item>
卡组自己组更能享受游戏乐趣,自己组也更容易神抽哦
</item>
<item>
看到每个服务器右下的宝石了吗?点点看吧
</item>
<item>
先行卡和正式卡密码不同,打了补丁要注意区分哦
</item>
<item>
觉得遇到BUG先确定是否真的是BUG再进行反馈哈
</item>
<item>
不懂怎么更新?去设置-「检查更新」看看
</item>
<item>
不知道怎么用,可以点开左下-「教程」查看使用方法
</item>
<item>
维护开发不容易,欢迎前往左下角→「支持我们」留下您的心意
</item>
<item>
没有所谓的“大师规则4”只有「新大师规则」哦
</item>
<item>
录像出错就删了吧,暂时还没有解决办法
</item>
</string-array>
</resources>
\ No newline at end of file
mobile/src/main/res/values-zh/arrays.xml
0 → 100644
View file @
51f4fee8
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array
name=
"opengl_version_value"
translatable=
"false"
>
<item>
0
</item>
<item>
1
</item>
<item>
2
</item>
</string-array>
<string-array
name=
"card_quality_value"
translatable=
"false"
>
<item>
0
</item>
<item>
1
</item>
</string-array>
<string-array
name=
"tips"
>
<item>
游戏王圈子不大,珍惜一起玩的人
</item>
<item>
点击卡片却偏到另一张?试试去「设置」→打勾/取消「在游戏隐藏虚拟键」
</item>
<item>
主页每个服务器按住左划就会出现「编辑」和「删除」哦
</item>
<item>
试试点击左下角浮动的「贤者之石」会有更多功能
</item>
<item>
想不联网也打人机?左下角→「单人游戏」→「人机模式」
</item>
<item>
卡图怎么没了?点击左下角→「重置资源」
</item>
<item>
卡组自己组更能享受游戏乐趣,自己组也更容易神抽哦
</item>
<item>
看到每个服务器右下的宝石了吗?点点看吧
</item>
<item>
先行卡和正式卡密码不同,打了补丁要注意区分哦
</item>
<item>
觉得遇到BUG先确定是否真的是BUG再进行反馈哈
</item>
<item>
不懂怎么更新?去设置-「检查更新」看看
</item>
<item>
不知道怎么用,可以点开左下-「教程」查看使用方法
</item>
<item>
维护开发不容易,欢迎前往左下角→「支持我们」留下您的心意
</item>
<item>
没有所谓的“大师规则4”只有「新大师规则」哦
</item>
<item>
录像出错就删了吧,暂时还没有解决办法
</item>
</string-array>
</resources>
\ No newline at end of file
mobile/src/main/res/values/arrays.xml
View file @
51f4fee8
...
@@ -9,4 +9,21 @@
...
@@ -9,4 +9,21 @@
<item>
0
</item>
<item>
0
</item>
<item>
1
</item>
<item>
1
</item>
</string-array>
</string-array>
<string-array
name=
"tips"
>
<item>
游戏王圈子不大,珍惜一起玩的人
</item>
<item>
点击卡片却偏到另一张?试试去「设置」→打勾/取消「在游戏隐藏虚拟键」
</item>
<item>
主页每个服务器按住左划就会出现「编辑」和「删除」哦
</item>
<item>
试试点击左下角浮动的「贤者之石」会有更多功能
</item>
<item>
想不联网也打人机?左下角→「单人游戏」→「人机模式」
</item>
<item>
卡图怎么没了?点击左下角→「重置资源」
</item>
<item>
卡组自己组更能享受游戏乐趣,自己组也更容易神抽哦
</item>
<item>
看到每个服务器右下的宝石了吗?点点看吧
</item>
<item>
先行卡和正式卡密码不同,打了补丁要注意区分哦
</item>
<item>
觉得遇到BUG先确定是否真的是BUG再进行反馈哈
</item>
<item>
不懂怎么更新?去设置-「检查更新」看看
</item>
<item>
不知道怎么用,可以点开左下-「教程」查看使用方法
</item>
<item>
维护开发不容易,欢迎前往左下角→「支持我们」留下您的心意
</item>
<item>
没有所谓的“大师规则4”只有「新大师规则」哦
</item>
<item>
录像出错就删了吧,暂时还没有解决办法
</item>
</string-array>
</resources>
</resources>
\ No newline at end of file
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