Commit 51f4fee8 authored by fallenstardust's avatar fallenstardust

增加tips

parent d0044273
...@@ -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 = true; boolean PREF_DEF_IMMERSIVE_MODE = false;
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";
......
...@@ -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) {
......
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;
}
}
<?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
<?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
...@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment