Commit 1493624b authored by fallenstardust's avatar fallenstardust

clean & log

parent 1a7ae14f
package cn.garymb.ygomobile; package cn.garymb.ygomobile;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.util.Log;
import android.widget.ImageView; import android.widget.ImageView;
import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.app.AppCompatDelegate;
...@@ -38,6 +38,7 @@ public class App extends GameApplication { ...@@ -38,6 +38,7 @@ public class App extends GameApplication {
@Override @Override
public NativeInitOptions getNativeInitOptions() { public NativeInitOptions getNativeInitOptions() {
NativeInitOptions options = AppsSettings.get().getNativeInitOptions(); NativeInitOptions options = AppsSettings.get().getNativeInitOptions();
Log.i("我是getNativeInitOptions", options + "");
return options; return options;
} }
...@@ -76,15 +77,18 @@ public class App extends GameApplication { ...@@ -76,15 +77,18 @@ public class App extends GameApplication {
@Override @Override
public void saveSetting(String key, String value) { public void saveSetting(String key, String value) {
AppsSettings.get().saveSettings(key, value); AppsSettings.get().saveSettings(key, value);
Log.i("我是saveSetting的key+value", key + "以及" + value);
} }
@Override @Override
public String getSetting(String key) { public String getSetting(String key) {
Log.i("我是getSetting的key", key);
return AppsSettings.get().getSettings(key); return AppsSettings.get().getSettings(key);
} }
@Override @Override
public int getIntSetting(String key, int def) { public int getIntSetting(String key, int def) {
Log.i("我是getIntSetting的key+def", key + "以及" + def);
return AppsSettings.get().getIntSettings(key, def); return AppsSettings.get().getIntSettings(key, def);
} }
......
...@@ -499,6 +499,10 @@ public class AppsSettings { ...@@ -499,6 +499,10 @@ public class AppsSettings {
return mSharedPreferences.getBoolean(PREF_SENSOR_REFRESH, PREF_DEF_SENSOR_REFRESH); 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) { public void setLastDeckPath(String path) {
if (TextUtils.equals(path, getCurLastDeck())) { if (TextUtils.equals(path, getCurLastDeck())) {
...@@ -534,17 +538,6 @@ public class AppsSettings { ...@@ -534,17 +538,6 @@ public class AppsSettings {
return mSharedPreferences.getString(Constants.PREF_DEF_LAST_YDK, lastDeckName); 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() { public String getCurLastCategory() {
return mSharedPreferences.getString(Constants.PREF_DEF_LAST_CATEGORY, null); return mSharedPreferences.getString(Constants.PREF_DEF_LAST_CATEGORY, null);
} }
...@@ -614,7 +607,8 @@ public class AppsSettings { ...@@ -614,7 +607,8 @@ public class AppsSettings {
}*/ }*/
public void saveSettings(String key, String value) { 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); setLastDeckPath(value);
} else { } else {
mSharedPreferences.putString(Constants.PREF_START + key, value); mSharedPreferences.putString(Constants.PREF_START + key, value);
...@@ -639,7 +633,7 @@ public class AppsSettings { ...@@ -639,7 +633,7 @@ public class AppsSettings {
public String getCategorySettings(String key) { public String getCategorySettings(String key) {
if ("lastcategory".equals(key)) { if ("lastcategory".equals(key)) {
String val = getLastCategory(); String val = getLastCategory(key);
return val; return val;
} }
return mSharedPreferences.getString(Constants.PREF_START + key, null); return mSharedPreferences.getString(Constants.PREF_START + key, null);
......
...@@ -262,7 +262,6 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView ...@@ -262,7 +262,6 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
if (file == null) { if (file == null) {
return new DeckInfo(); return new DeckInfo();
} }
Log.i("最后分类", mSettings.getLastCategory());
Log.i("kk", "load ydk " + file); Log.i("kk", "load ydk " + file);
if (mCardLoader.isOpen() && file.exists()) { if (mCardLoader.isOpen() && file.exists()) {
return mDeckAdapater.read(mCardLoader, file, mCardLoader.getLimitList()); return mDeckAdapater.read(mCardLoader, file, mCardLoader.getLimitList());
......
...@@ -8,7 +8,6 @@ import android.graphics.Color; ...@@ -8,7 +8,6 @@ import android.graphics.Color;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.preference.Preference; import android.preference.Preference;
import android.util.Log;
import android.widget.Toast; import android.widget.Toast;
import com.yuyh.library.imgsel.ISNav; import com.yuyh.library.imgsel.ISNav;
...@@ -18,7 +17,6 @@ import com.yuyh.library.imgsel.ui.ISListActivity; ...@@ -18,7 +17,6 @@ import com.yuyh.library.imgsel.ui.ISListActivity;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
...@@ -27,10 +25,7 @@ import cn.garymb.ygomobile.lite.R; ...@@ -27,10 +25,7 @@ import cn.garymb.ygomobile.lite.R;
import cn.garymb.ygomobile.ui.file.FileActivity; import cn.garymb.ygomobile.ui.file.FileActivity;
import cn.garymb.ygomobile.ui.file.FileOpenType; import cn.garymb.ygomobile.ui.file.FileOpenType;
import cn.garymb.ygomobile.utils.FileUtils; 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_FILE;
import static cn.garymb.ygomobile.Constants.REQUEST_CHOOSE_FOLDER; import static cn.garymb.ygomobile.Constants.REQUEST_CHOOSE_FOLDER;
import static cn.garymb.ygomobile.Constants.REQUEST_CHOOSE_IMG; import static cn.garymb.ygomobile.Constants.REQUEST_CHOOSE_IMG;
...@@ -38,7 +33,6 @@ 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 { public abstract class PreferenceFragmentPlus extends BasePreferenceFragment {
private Preference curPreference; private Preference curPreference;
private CurImageInfo mCurImageInfo; private CurImageInfo mCurImageInfo;
private Uri saveimgUri;
protected void onChooseFileOk(Preference preference, String file) { protected void onChooseFileOk(Preference preference, String file) {
onPreferenceChange(preference, file); onPreferenceChange(preference, 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