Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
tortuvshin committed Feb 1, 2018
1 parent 0f35963 commit c01c569
Show file tree
Hide file tree
Showing 9 changed files with 309 additions and 328 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 26
Expand Down Expand Up @@ -30,5 +31,9 @@ dependencies {
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

}
repositories {
mavenCentral()
}
41 changes: 0 additions & 41 deletions app/src/main/java/cloud/techstar/imageloader/FileCache.java

This file was deleted.

38 changes: 38 additions & 0 deletions app/src/main/java/cloud/techstar/imageloader/FileCache.kt
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 app/src/main/java/cloud/techstar/imageloader/ImageLoader.java

This file was deleted.

Loading

0 comments on commit c01c569

Please sign in to comment.