Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/news-android.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schaal <daniel@schaal.email>2015-07-11 22:57:57 +0300
committerDaniel Schaal <daniel@schaal.email>2015-07-19 10:14:48 +0300
commit195106876301ee900b8dc394116e2b2df887e145 (patch)
treee656e14a2d21ce5fedc96d52f115919c1e861503 /News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/helper/FileUtils.java
parent0014549ac22415f55c285880fa92036f638c1b92 (diff)
Use Universal Image Loader, remove Picasso and custom cache
Diffstat (limited to 'News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/helper/FileUtils.java')
-rw-r--r--News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/helper/FileUtils.java40
1 files changed, 8 insertions, 32 deletions
diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/helper/FileUtils.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/helper/FileUtils.java
index 85aaf3f7..d2e6bf66 100644
--- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/helper/FileUtils.java
+++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/helper/FileUtils.java
@@ -67,30 +67,17 @@ public class FileUtils {
}
}
-
-
-
-
public static String getPath(Context context) {
- String url;
- Boolean isSDPresent = android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);
- if(isSDPresent)
- {
- url = Environment.getExternalStorageDirectory().getAbsolutePath();
- if (android.os.Build.DEVICE.contains("Samsung") || android.os.Build.MANUFACTURER.contains("Samsung")) {
- url = url + "/external_sd";
- }
- //url = url + "/" + context.getString(R.string.app_name);
- url = url + "/ownCloud News Reader";
- }
- else
- url = context.getCacheDir().getAbsolutePath();
-
- return url;
+ File externalCacheDir = context.getExternalCacheDir();
+ final String cachePath =
+ (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()) ||
+ !Environment.isExternalStorageRemovable()) && externalCacheDir != null ?
+ externalCacheDir.getPath() :
+ context.getCacheDir().getPath();
+
+ return cachePath;
}
-
-
public static boolean DeletePodcastFile(Context context, String url) {
try {
File file = new File(PodcastDownloadService.getUrlToPodcastFile(context, url, false));
@@ -106,15 +93,4 @@ public class FileUtils {
{
return getPath(context) + "/podcasts";
}
-
- public static String getPathFavIcons(Context context)
- {
- return getPath(context) + "/favIcons";
- }
-
- public static String getPathImageCache(Context context)
- {
- return getPath(context) + "/imgCache";
- }
-
}