You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
139 lines
3.0 KiB
139 lines
3.0 KiB
.class public Lcom/viatech/util/LruBitmapCache; |
|
.super Landroid/support/v4/util/LruCache; |
|
.source "LruBitmapCache.java" |
|
|
|
# interfaces |
|
.implements Lcom/android/volley/toolbox/ImageLoader$ImageCache; |
|
|
|
|
|
# annotations |
|
.annotation system Ldalvik/annotation/Signature; |
|
value = { |
|
"Landroid/support/v4/util/LruCache", |
|
"<", |
|
"Ljava/lang/String;", |
|
"Landroid/graphics/Bitmap;", |
|
">;", |
|
"Lcom/android/volley/toolbox/ImageLoader$ImageCache;" |
|
} |
|
.end annotation |
|
|
|
|
|
# direct methods |
|
.method public constructor <init>(I)V |
|
.locals 0 |
|
|
|
.prologue |
|
.line 28 |
|
invoke-direct {p0, p1}, Landroid/support/v4/util/LruCache;-><init>(I)V |
|
|
|
.line 29 |
|
return-void |
|
.end method |
|
|
|
.method public constructor <init>(Landroid/content/Context;)V |
|
.locals 1 |
|
|
|
.prologue |
|
.line 32 |
|
invoke-static {p1}, Lcom/viatech/util/LruBitmapCache;->getCacheSize(Landroid/content/Context;)I |
|
|
|
move-result v0 |
|
|
|
invoke-direct {p0, v0}, Lcom/viatech/util/LruBitmapCache;-><init>(I)V |
|
|
|
.line 33 |
|
return-void |
|
.end method |
|
|
|
.method public static getCacheSize(Landroid/content/Context;)I |
|
.locals 2 |
|
|
|
.prologue |
|
.line 37 |
|
invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources; |
|
|
|
move-result-object v0 |
|
|
|
.line 38 |
|
invoke-virtual {v0}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics; |
|
|
|
move-result-object v0 |
|
|
|
.line 39 |
|
iget v1, v0, Landroid/util/DisplayMetrics;->widthPixels:I |
|
|
|
.line 40 |
|
iget v0, v0, Landroid/util/DisplayMetrics;->heightPixels:I |
|
|
|
.line 42 |
|
mul-int/2addr v0, v1 |
|
|
|
mul-int/lit8 v0, v0, 0x4 |
|
|
|
.line 44 |
|
mul-int/lit8 v0, v0, 0x3 |
|
|
|
return v0 |
|
.end method |
|
|
|
|
|
# virtual methods |
|
.method public getBitmap(Ljava/lang/String;)Landroid/graphics/Bitmap; |
|
.locals 1 |
|
|
|
.prologue |
|
.line 54 |
|
invoke-virtual {p0, p1}, Lcom/viatech/util/LruBitmapCache;->get(Ljava/lang/Object;)Ljava/lang/Object; |
|
|
|
move-result-object v0 |
|
|
|
check-cast v0, Landroid/graphics/Bitmap; |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method public putBitmap(Ljava/lang/String;Landroid/graphics/Bitmap;)V |
|
.locals 0 |
|
|
|
.prologue |
|
.line 59 |
|
invoke-virtual {p0, p1, p2}, Lcom/viatech/util/LruBitmapCache;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; |
|
|
|
.line 60 |
|
return-void |
|
.end method |
|
|
|
.method protected bridge synthetic sizeOf(Ljava/lang/Object;Ljava/lang/Object;)I |
|
.locals 1 |
|
|
|
.prologue |
|
.line 24 |
|
check-cast p1, Ljava/lang/String; |
|
|
|
check-cast p2, Landroid/graphics/Bitmap; |
|
|
|
invoke-virtual {p0, p1, p2}, Lcom/viatech/util/LruBitmapCache;->sizeOf(Ljava/lang/String;Landroid/graphics/Bitmap;)I |
|
|
|
move-result v0 |
|
|
|
return v0 |
|
.end method |
|
|
|
.method protected sizeOf(Ljava/lang/String;Landroid/graphics/Bitmap;)I |
|
.locals 2 |
|
|
|
.prologue |
|
.line 49 |
|
invoke-virtual {p2}, Landroid/graphics/Bitmap;->getRowBytes()I |
|
|
|
move-result v0 |
|
|
|
invoke-virtual {p2}, Landroid/graphics/Bitmap;->getHeight()I |
|
|
|
move-result v1 |
|
|
|
mul-int/2addr v0, v1 |
|
|
|
return v0 |
|
.end method
|
|
|