This repository has been archived by the owner on Nov 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f35963
commit c01c569
Showing
9 changed files
with
309 additions
and
328 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
app/src/main/java/cloud/techstar/imageloader/FileCache.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package cloud.techstar.imageloader | ||
|
||
import android.content.Context | ||
|
||
import java.io.File | ||
|
||
/** | ||
* @author Turtuvshin Byambaa | ||
* Copyright (C) 2018 Techstar, Inc. | ||
* www.techstar.cloud | ||
*/ | ||
|
||
class FileCache(context: Context) { | ||
|
||
private var cacheDir: File? = null | ||
|
||
init { | ||
|
||
if (android.os.Environment.getExternalStorageState() == android.os.Environment.MEDIA_MOUNTED) | ||
cacheDir = File(android.os.Environment.getExternalStorageDirectory(), "dir") | ||
else | ||
cacheDir = context.cacheDir | ||
if (!cacheDir!!.exists()) | ||
cacheDir!!.mkdirs() | ||
} | ||
|
||
fun getFile(url: String): File { | ||
val filename = url.hashCode().toString() | ||
return File(cacheDir, filename) | ||
|
||
} | ||
|
||
fun clear() { | ||
val files = cacheDir!!.listFiles() ?: return | ||
for (f in files) | ||
f.delete() | ||
} | ||
} |
200 changes: 0 additions & 200 deletions
200
app/src/main/java/cloud/techstar/imageloader/ImageLoader.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.