From 708e0fda5b76d610b204c4cf8a172cd4f3735b4f Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Thu, 3 Jun 2021 20:42:28 +0900 Subject: [PATCH] Some code cleanup --- .../awais/instagrabber/utils/BitmapUtils.kt | 17 ----------------- .../instagrabber/webservices/MediaService.java | 3 --- 2 files changed, 20 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/utils/BitmapUtils.kt b/app/src/main/java/awais/instagrabber/utils/BitmapUtils.kt index 4cbba93b..379ea8db 100644 --- a/app/src/main/java/awais/instagrabber/utils/BitmapUtils.kt +++ b/app/src/main/java/awais/instagrabber/utils/BitmapUtils.kt @@ -17,10 +17,6 @@ import java.io.IOException object BitmapUtils { private val bitmapMemoryCache: LruCache - - // private val appExecutors = AppExecutors - // private val callbackHandlers = Executors - // .newCachedThreadPool { r: Runnable? -> Thread(r, "bm-load-callback-handler#" + random(0, 100)) } const val THUMBNAIL_SIZE = 200f @JvmStatic @@ -53,7 +49,6 @@ object BitmapUtils { * @param reqWidth Required width * @param reqHeight Required height * @param addToCache true if the loaded bitmap should be added to the mem cache - // * @param callback Bitmap load callback */ suspend fun loadBitmap( contentResolver: ContentResolver?, @@ -70,7 +65,6 @@ object BitmapUtils { * @param uri Uri from where Bitmap will be loaded * @param maxDimenSize Max size of the largest side of the image * @param addToCache true if the loaded bitmap should be added to the mem cache - // * @param callback Bitmap load callback */ suspend fun loadBitmap( contentResolver: ContentResolver?, @@ -88,7 +82,6 @@ object BitmapUtils { * @param reqHeight Required height (set to -1 if maxDimenSize provided) * @param maxDimenSize Max size of the largest side of the image (set to -1 if setting reqWidth and reqHeight) * @param addToCache true if the loaded bitmap should be added to the mem cache - // * @param callback Bitmap load callback */ private suspend fun loadBitmap( contentResolver: ContentResolver?, @@ -227,16 +220,6 @@ object BitmapUtils { class BitmapResult(var bitmap: Bitmap?, var width: Int, var height: Int) - interface ThumbnailLoadCallback { - /** - * @param bitmap Resulting bitmap - * @param width width of the bitmap (Only correct if loadBitmap was called or -1) - * @param height height of the bitmap (Only correct if loadBitmap was called or -1) - */ - fun onLoad(bitmap: Bitmap, width: Int, height: Int) - fun onFailure(t: Throwable) - } - init { // Get max available VM memory, exceeding this amount will throw an // OutOfMemory exception. Stored in kilobytes as LruCache takes an diff --git a/app/src/main/java/awais/instagrabber/webservices/MediaService.java b/app/src/main/java/awais/instagrabber/webservices/MediaService.java index 333a526d..65aef412 100644 --- a/app/src/main/java/awais/instagrabber/webservices/MediaService.java +++ b/app/src/main/java/awais/instagrabber/webservices/MediaService.java @@ -6,7 +6,6 @@ import androidx.annotation.NonNull; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import com.google.gson.Gson; import org.json.JSONException; import org.json.JSONObject; @@ -16,9 +15,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.UUID; -import awais.instagrabber.models.Comment; import awais.instagrabber.models.enums.MediaItemType; import awais.instagrabber.repositories.MediaRepository; import awais.instagrabber.repositories.requests.Clip;