Commit acbbba8c authored by feihuaduo's avatar feihuaduo

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

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