Commit acbbba8c authored by feihuaduo's avatar feihuaduo

最后保存的卡组名改为最后保存的卡组绝对路径

parent 2219108c
...@@ -483,16 +483,16 @@ public class AppsSettings { ...@@ -483,16 +483,16 @@ public class AppsSettings {
} }
/*** /***
* 获得最后卡组 * 获得最后卡组绝对路径
*/ */
public String getLastDeck() { public String getLastDeckPath() {
return mSharedPreferences.getString(Constants.PREF_LAST_YDK, Constants.PREF_DEF_LAST_YDK); return mSharedPreferences.getString(Constants.PREF_LAST_YDK, Constants.PREF_DEF_LAST_YDK);
} }
/*** /***
* 保存最后卡组 * 保存最后卡组绝对路径
*/ */
public void setLastDeck(String name) { public void setLastDeckPath(String name) {
if (TextUtils.equals(name, getCurLastDeck())) { if (TextUtils.equals(name, getCurLastDeck())) {
//一样 //一样
return; return;
...@@ -592,7 +592,7 @@ public class AppsSettings { ...@@ -592,7 +592,7 @@ public class AppsSettings {
public void saveSettings(String key, String value) { public void saveSettings(String key, String value) {
if ("lastdeck".equals(key)) { if ("lastdeck".equals(key)) {
setLastDeck(value); setLastDeckPath(value);
} else { } else {
mSharedPreferences.putString(Constants.PREF_START + key, value); mSharedPreferences.putString(Constants.PREF_START + key, value);
} }
...@@ -600,7 +600,7 @@ public class AppsSettings { ...@@ -600,7 +600,7 @@ public class AppsSettings {
public String getSettings(String key) { public String getSettings(String key) {
if ("lastdeck".equals(key)) { if ("lastdeck".equals(key)) {
String val = getLastDeck(); String val = getLastDeckPath();
return val; return val;
} }
return mSharedPreferences.getString(Constants.PREF_START + key, null); return mSharedPreferences.getString(Constants.PREF_START + key, null);
......
...@@ -70,7 +70,7 @@ public class DeckManagerActivity3 extends BaseActivity implements OnItemDragList ...@@ -70,7 +70,7 @@ public class DeckManagerActivity3 extends BaseActivity implements OnItemDragList
DialogPlus dlg = DialogPlus.show(this, null, getString(R.string.loading)); DialogPlus dlg = DialogPlus.show(this, null, getString(R.string.loading));
VUiKit.defer().when(() -> { VUiKit.defer().when(() -> {
mCardLoader.setLimitList(mLimitManager.getTopLimit()); mCardLoader.setLimitList(mLimitManager.getTopLimit());
File file = new File(mSettings.getResourcePath(), Constants.CORE_DECK_PATH + "/" + mSettings.getLastDeck() + Constants.YDK_FILE_EX); File file = new File( mSettings.getLastDeckPath());
if (!TextUtils.isEmpty(mPreLoad)) { if (!TextUtils.isEmpty(mPreLoad)) {
file = new File(mPreLoad); file = new File(mPreLoad);
mPreLoad = null; mPreLoad = null;
......
...@@ -142,7 +142,7 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView ...@@ -142,7 +142,7 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
} else { } else {
mPreLoadFile = null; mPreLoadFile = null;
//最后卡组 //最后卡组
_file = new File(mSettings.getResourcePath(), Constants.CORE_DECK_PATH + "/" + mSettings.getLastDeck() + Constants.YDK_FILE_EX); _file = new File(mSettings.getLastDeckPath());
} }
init(_file); init(_file);
EventBus.getDefault().register(this); EventBus.getDefault().register(this);
...@@ -275,7 +275,7 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView ...@@ -275,7 +275,7 @@ class DeckManagerActivityImpl extends BaseCardsAcitivity implements RecyclerView
setActionBarSubTitle(name); setActionBarSubTitle(name);
if (inDeckDir(file)) { if (inDeckDir(file)) {
//deck文件夹里面的,则保存文件 //deck文件夹里面的,则保存文件
mSettings.setLastDeck(name); mSettings.setLastDeckPath(file.getAbsolutePath());
} }
} else { } else {
setActionBarSubTitle(getString(R.string.noname)); setActionBarSubTitle(getString(R.string.noname));
......
...@@ -188,7 +188,7 @@ class DeckManagerActivityImpl2 extends BaseActivity implements CardLoader.CallBa ...@@ -188,7 +188,7 @@ class DeckManagerActivityImpl2 extends BaseActivity implements CardLoader.CallBa
if (mLimitManager.getCount() > 0) { if (mLimitManager.getCount() > 0) {
mCardLoader.setLimitList(mLimitManager.getTopLimit()); mCardLoader.setLimitList(mLimitManager.getTopLimit());
} }
File file = new File(mSettings.getResourcePath(), Constants.CORE_DECK_PATH + "/" + mSettings.getLastDeck() + YDK_FILE_EX); File file = new File(mSettings.getLastDeckPath());
if (!TextUtils.isEmpty(mPreLoad)) { if (!TextUtils.isEmpty(mPreLoad)) {
file = new File(mPreLoad); file = new File(mPreLoad);
mPreLoad = null; mPreLoad = null;
...@@ -361,7 +361,7 @@ class DeckManagerActivityImpl2 extends BaseActivity implements CardLoader.CallBa ...@@ -361,7 +361,7 @@ class DeckManagerActivityImpl2 extends BaseActivity implements CardLoader.CallBa
String name = IOUtils.tirmName(file.getName(), YDK_FILE_EX); String name = IOUtils.tirmName(file.getName(), YDK_FILE_EX);
setActionBarSubTitle(name); setActionBarSubTitle(name);
if (!noSaveLast) { if (!noSaveLast) {
mSettings.setLastDeck(name); mSettings.setLastDeckPath(file.getAbsolutePath());
} }
} else { } else {
setActionBarSubTitle(getString(R.string.noname)); setActionBarSubTitle(getString(R.string.noname));
......
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