Commit 811d6f1a authored by fallenstardust's avatar fallenstardust

变更workdir

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