Rebuilding Downloader

This commit is contained in:
Pupil
2020-01-29 15:46:23 +09:00
parent 8a9ab6b36c
commit 9d80857a38
6 changed files with 237 additions and 89 deletions

View File

@@ -26,20 +26,16 @@ package xyz.quaver.pupil
* See [testing documentation](http://d.android.com/tools/testing).
*/
import android.util.SparseArray
import org.junit.Test
import xyz.quaver.pupil.util.download
import java.io.File
import java.net.URL
class ExampleUnitTest {
@Test
fun test() {
URL("https://github.com/tom5079/Pupil/releases/download/4.2-beta2-hotfix2/Pupil-v4.2-beta2-hotfix2.apk").download(
File(System.getenv("USERPROFILE"), "Pupil.apk")
) { downloaded, fileSize ->
println("%.1f%%".format(downloaded*100.0/fileSize))
}
val arr = SparseArray<Float>()
print(arr.indexOfKey(34))
}
}