Commit 36425e43 authored by fallenstardust's avatar fallenstardust

fix 资料语言设定

parent cb86a25c
......@@ -11,6 +11,7 @@ import static cn.garymb.ygomobile.Constants.CORE_STRING_PATH;
import static cn.garymb.ygomobile.Constants.CORE_SYSTEM_PATH;
import static cn.garymb.ygomobile.Constants.DATABASE_NAME;
import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
......@@ -277,12 +278,11 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
IOUtils.copyFilesFromAssets(mContext, getDatapath(Constants.WINDBOT_PATH), mSettings.getResourcePath(), needsUpdate);
//根据系统语言复制特定资料文件
String language = mContext.getResources().getConfiguration().locale.getLanguage();
Log.i(BuildConfig.VERSION_NAME, language);
if (!language.isEmpty()) {
if (mSettings.getDataLanguage() == -1) {
if (language.equals("zh"))
if (language.equals("zh")) {
copyCnData(needsUpdate);
if (language.equals("ko")) {
} else if (language.equals("ko")) {
copyKorData(needsUpdate);
} else {
copyEnData(needsUpdate);
......
......@@ -114,7 +114,6 @@ public class SettingFragment extends PreferenceFragmentPlus {
case TYPE_SETTING_GET_VERSION_OK:
Version = msg.obj.toString().substring(0, msg.obj.toString().indexOf("|"));//截取版本号
Cache_link = msg.obj.toString().substring(msg.obj.toString().indexOf("|") + 1);
Log.i(BuildConfig.VERSION_NAME, Version + "和" + Cache_link);
if (!Version.equals(BuildConfig.VERSION_NAME) && !Version.isEmpty() && !Cache_link.isEmpty()) {
DialogPlus dialog = new DialogPlus(getActivity());
dialog.setMessage(R.string.Found_Update);
......@@ -148,6 +147,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(false);
mSettings = AppsSettings.get();
addPreferencesFromResource(R.xml.preference_game);
......@@ -170,6 +170,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
bind(PREF_DEL_EX, getString(R.string.about_delete_ex));
bind(PERF_TEST_REPLACE_KERNEL, "需root权限,请在开发者的指导下食用");
bind(PREF_WINDOW_TOP_BOTTOM, "" + mSettings.getScreenPadding());
bind(PREF_DATA_LANGUAGE, mSettings.getDataLanguage());
Preference preference = findPreference(PREF_READ_EX);
if (preference != null) {
preference.setSummary(mSettings.getExpansionsPath().getAbsolutePath());
......@@ -294,13 +295,11 @@ public class SettingFragment extends PreferenceFragmentPlus {
message.what = TYPE_SETTING_GET_VERSION_FAILED;
message.obj = e;
handler.sendMessage(message);
Log.i(BuildConfig.VERSION_NAME, "error" + e);
}
@Override
public void onResponse(Call call, Response response) throws IOException {
String json = response.body().string();
Log.i(BuildConfig.VERSION_NAME, json);
Message message = new Message();
message.what = TYPE_SETTING_GET_VERSION_OK;
message.obj = json;
......
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