add: supports for daily task and disposable task
This commit is contained in:
@@ -47,10 +47,7 @@ public class PFile extends File {
|
||||
} else {
|
||||
mSimplifiedName = PFiles.getNameWithoutExtension(getName());
|
||||
}
|
||||
mSimplifyPath = getPath();
|
||||
if (mSimplifyPath.startsWith(Environment.getExternalStorageDirectory().getPath())) {
|
||||
mSimplifyPath = mSimplifyPath.substring(Environment.getExternalStorageDirectory().getPath().length());
|
||||
}
|
||||
mSimplifyPath = PFiles.getSimplifiedPath(getPath());
|
||||
}
|
||||
|
||||
public boolean renameTo(String newName) {
|
||||
|
||||
@@ -354,4 +354,11 @@ public class PFiles {
|
||||
String pre = "KMGTPE".substring(exp - 1, exp);
|
||||
return String.format(Locale.getDefault(), "%.1f %sB", bytes / Math.pow(unit, exp), pre);
|
||||
}
|
||||
|
||||
public static String getSimplifiedPath(String path) {
|
||||
if (path.startsWith(Environment.getExternalStorageDirectory().getPath())) {
|
||||
return path.substring(Environment.getExternalStorageDirectory().getPath().length());
|
||||
}
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user