Commit 1493624b authored by fallenstardust's avatar fallenstardust

clean & log

parent 1a7ae14f
package cn.garymb.ygomobile;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.ImageView;
import androidx.appcompat.app.AppCompatDelegate;
......@@ -23,11 +23,11 @@ public class App extends GameApplication {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
AppsSettings.init(this);
//初始化异常工具类
CrashHandler crashHandler = CrashHandler.getInstance();
CrashHandler crashHandler = CrashHandler.getInstance();
crashHandler.init(getApplicationContext());
if (AppsSettings.get().isSoundEffect()) {
initSoundEffectPool();
setInitSoundEffectPool(true);
setInitSoundEffectPool(true);
}
//初始化图片选择器
initImgsel();
......@@ -38,6 +38,7 @@ public class App extends GameApplication {
@Override
public NativeInitOptions getNativeInitOptions() {
NativeInitOptions options = AppsSettings.get().getNativeInitOptions();
Log.i("我是getNativeInitOptions", options + "");
return options;
}
......@@ -76,15 +77,18 @@ public class App extends GameApplication {
@Override
public void saveSetting(String key, String value) {
AppsSettings.get().saveSettings(key, value);
Log.i("我是saveSetting的key+value", key + "以及" + value);
}
@Override
public String getSetting(String key) {
Log.i("我是getSetting的key", key);
return AppsSettings.get().getSettings(key);
}
@Override
public int getIntSetting(String key, int def) {
Log.i("我是getIntSetting的key+def", key + "以及" + def);
return AppsSettings.get().getIntSettings(key, def);
}
......
......@@ -499,6 +499,10 @@ public class AppsSettings {
return mSharedPreferences.getBoolean(PREF_SENSOR_REFRESH, PREF_DEF_SENSOR_REFRESH);
}
public String getCurLastDeck() {
return mSharedPreferences.getString(Constants.PREF_DEF_LAST_YDK, null);
}
//保存最后卡组绝对路径、分类、卡组名
public void setLastDeckPath(String path) {
if (TextUtils.equals(path, getCurLastDeck())) {
......@@ -534,17 +538,6 @@ public class AppsSettings {
return mSharedPreferences.getString(Constants.PREF_DEF_LAST_YDK, lastDeckName);
}
public String getCurLastDeck() {
return mSharedPreferences.getString(Constants.PREF_DEF_LAST_YDK, null);
}
/***
* 获得最后卡组分类名
*/
public String getLastCategory() {
return mSharedPreferences.getString(Constants.PREF_LAST_CATEGORY, Constants.PREF_DEF_LAST_CATEGORY);
}
public String getCurLastCategory() {
return mSharedPreferences.getString(Constants.PREF_DEF_LAST_CATEGORY, null);
}
......@@ -614,7 +607,8 @@ public class AppsSettings {
}*/
public void saveSettings(String key, String value) {
if ("lastdeck".equals(key)) {
Log.i("我是key+value", key + "+" + value);
if ("lastdeck".equals(key) || "lastcategory".equals(key)) {
setLastDeckPath(value);
} else {
mSharedPreferences.putString(Constants.PREF_START + key, value);
......@@ -639,7 +633,7 @@ public class AppsSettings {
public String getCategorySettings(String key) {
if ("lastcategory".equals(key)) {
String val = getLastCategory();
String val = getLastCategory(key);
return val;
}
return mSharedPreferences.getString(Constants.PREF_START + key, null);
......
......@@ -262,7 +262,6 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
if (file == null) {
return new DeckInfo();
}
Log.i("最后分类", mSettings.getLastCategory());
Log.i("kk", "load ydk " + file);
if (mCardLoader.isOpen() && file.exists()) {
return mDeckAdapater.read(mCardLoader, file, mCardLoader.getLimitList());
......
......@@ -8,7 +8,6 @@ import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.preference.Preference;
import android.util.Log;
import android.widget.Toast;
import com.yuyh.library.imgsel.ISNav;
......@@ -18,7 +17,6 @@ import com.yuyh.library.imgsel.ui.ISListActivity;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
......@@ -27,10 +25,7 @@ import cn.garymb.ygomobile.lite.R;
import cn.garymb.ygomobile.ui.file.FileActivity;
import cn.garymb.ygomobile.ui.file.FileOpenType;
import cn.garymb.ygomobile.utils.FileUtils;
import cn.garymb.ygomobile.utils.IOUtils;
import static android.app.Activity.RESULT_OK;
import static cn.garymb.ygomobile.Constants.REQUEST_CHOOSE_FILE;
import static cn.garymb.ygomobile.Constants.REQUEST_CHOOSE_FOLDER;
import static cn.garymb.ygomobile.Constants.REQUEST_CHOOSE_IMG;
......@@ -38,7 +33,6 @@ import static cn.garymb.ygomobile.Constants.REQUEST_CHOOSE_IMG;
public abstract class PreferenceFragmentPlus extends BasePreferenceFragment {
private Preference curPreference;
private CurImageInfo mCurImageInfo;
private Uri saveimgUri;
protected void onChooseFileOk(Preference preference, String file) {
onPreferenceChange(preference, file);
......@@ -99,7 +93,7 @@ public abstract class PreferenceFragmentPlus extends BasePreferenceFragment {
// startActivityForResult(intent, REQUEST_CHOOSE_IMG);
// intent.addCategory(Intent.CATEGORY_OPENABLE);
// intent.setType("image/*");
// intent.setType("image/*");
ISListConfig config = new ISListConfig.Builder()
// 是否多选, 默认true
.multiSelect(false)
......
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