Commit 811d6f1a authored by fallenstardust's avatar fallenstardust

变更workdir

parent c020ed46
...@@ -135,7 +135,7 @@ public class AppsSettings { ...@@ -135,7 +135,7 @@ public class AppsSettings {
} }
public float getXScale(int w, int h) { public float getXScale(int w, int h) {
if(isKeepScale()){ if (isKeepScale()) {
float sx = getScreenHeight() / w; float sx = getScreenHeight() / w;
float sy = getScreenWidth() / h; float sy = getScreenWidth() / h;
return Math.min(sx, sy); return Math.min(sx, sy);
...@@ -144,7 +144,7 @@ public class AppsSettings { ...@@ -144,7 +144,7 @@ public class AppsSettings {
} }
public float getYScale(int w, int h) { public float getYScale(int w, int h) {
if(isKeepScale()){ if (isKeepScale()) {
//固定比例,取最小值 //固定比例,取最小值
float sx = getScreenHeight() / w; float sx = getScreenHeight() / w;
float sy = getScreenWidth() / h; float sy = getScreenWidth() / h;
...@@ -153,7 +153,7 @@ public class AppsSettings { ...@@ -153,7 +153,7 @@ public class AppsSettings {
return getScreenWidth() / h; return getScreenWidth() / h;
} }
public boolean isKeepScale(){ public boolean isKeepScale() {
return mSharedPreferences.getBoolean(PREF_KEEP_SCALE, DEF_PREF_KEEP_SCALE); return mSharedPreferences.getBoolean(PREF_KEEP_SCALE, DEF_PREF_KEEP_SCALE);
} }
...@@ -179,7 +179,7 @@ public class AppsSettings { ...@@ -179,7 +179,7 @@ public class AppsSettings {
h = mScreenSize.y; h = mScreenSize.y;
} }
int ret = Math.max(w, h); int ret = Math.max(w, h);
if(isImmerSiveMode()){ if (isImmerSiveMode()) {
//刘海高度 //刘海高度
ret -= getNotchHeight(); ret -= getNotchHeight();
} }
...@@ -339,11 +339,12 @@ public class AppsSettings { ...@@ -339,11 +339,12 @@ public class AppsSettings {
/** /**
* 根据卡密获取卡图的路径 * 根据卡密获取卡图的路径
*
* @param code 卡密 * @param code 卡密
* @return * @return
*/ */
public String getCardImagePath(int code){ public String getCardImagePath(int code) {
return new File(getCardImagePath(),code+".jpg").getAbsolutePath(); return new File(getCardImagePath(), code + ".jpg").getAbsolutePath();
} }
/*** /***
...@@ -451,11 +452,7 @@ public class AppsSettings { ...@@ -451,11 +452,7 @@ public class AppsSettings {
*/ */
public String getResourcePath() { public String getResourcePath() {
String defPath; String defPath;
try { defPath = new File(String.valueOf(context.getExternalFilesDir(Constants.PREF_DEF_GAME_DIR))).getAbsolutePath();
defPath = new File(Environment.getExternalStorageDirectory(), Constants.PREF_DEF_GAME_DIR).getAbsolutePath();
} catch (Exception e) {
defPath = new File(context.getFilesDir(), Constants.PREF_DEF_GAME_DIR).getAbsolutePath();
}
return mSharedPreferences.getString(Constants.PREF_GAME_PATH, defPath); return mSharedPreferences.getString(Constants.PREF_GAME_PATH, defPath);
} }
......
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