|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bumptech.glide.util.Util
public final class Util
A collection of assorted utility classes.
Method Summary | ||
---|---|---|
static void |
assertBackgroundThread()
Throws an IllegalArgumentException if called on the main thread. |
|
static void |
assertMainThread()
Throws an IllegalArgumentException if called on a thread other than the main thread. |
|
static
|
createQueue(int size)
Returns a Queue of the given size using Glide's preferred implementation. |
|
static int |
getBitmapByteSize(Bitmap bitmap)
Returns the in memory size of the given Bitmap in bytes. |
|
static int |
getBitmapByteSize(int width,
int height,
Bitmap.Config config)
Returns the in memory size of Bitmap with the given width, height, and
Bitmap.Config . |
|
static int |
getSize(Bitmap bitmap)
Deprecated. Use getBitmapByteSize(android.graphics.Bitmap) instead. Scheduled to be removed in Glide
4.0. |
|
static
|
getSnapshot(Collection<T> other)
Returns a copy of the given list that is safe to iterate over and perform actions that may modify the original list. |
|
static boolean |
isOnBackgroundThread()
Returns true if called on the main thread, false otherwise. |
|
static boolean |
isOnMainThread()
Returns true if called on the main thread, false otherwise. |
|
static boolean |
isValidDimensions(int width,
int height)
Returns true if width and height are both > 0 and/or equal to Target.SIZE_ORIGINAL . |
|
static String |
sha1BytesToHex(byte[] bytes)
Returns the hex string of the given byte array representing a SHA1 hash. |
|
static String |
sha256BytesToHex(byte[] bytes)
Returns the hex string of the given byte array representing a SHA256 hash. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String sha256BytesToHex(byte[] bytes)
public static String sha1BytesToHex(byte[] bytes)
@Deprecated public static int getSize(Bitmap bitmap)
getBitmapByteSize(android.graphics.Bitmap)
instead. Scheduled to be removed in Glide
4.0.
getBitmapByteSize(android.graphics.Bitmap)
public static int getBitmapByteSize(Bitmap bitmap)
Bitmap
in bytes.
public static int getBitmapByteSize(int width, int height, Bitmap.Config config)
Bitmap
with the given width, height, and
Bitmap.Config
.
public static boolean isValidDimensions(int width, int height)
Target.SIZE_ORIGINAL
.
public static void assertMainThread()
IllegalArgumentException
if called on a thread other than the main thread.
public static void assertBackgroundThread()
IllegalArgumentException
if called on the main thread.
public static boolean isOnMainThread()
true
if called on the main thread, false
otherwise.
public static boolean isOnBackgroundThread()
true
if called on the main thread, false
otherwise.
public static <T> Queue<T> createQueue(int size)
Queue
of the given size using Glide's preferred implementation.
public static <T> List<T> getSnapshot(Collection<T> other)
See #303 and #375.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |