RoundedBitmapDrawableFactory.java
2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package android.support.v4.graphics.drawable;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Rect;
import android.os.Build.VERSION;
import android.support.v4.graphics.BitmapCompat;
import android.support.v4.view.GravityCompat;
import android.util.Log;
import de;
import java.io.InputStream;
public final class RoundedBitmapDrawableFactory
{
public static RoundedBitmapDrawable create(Resources paramResources, Bitmap paramBitmap)
{
if (Build.VERSION.SDK_INT >= 21) {
return new de(paramResources, paramBitmap);
}
return new a(paramResources, paramBitmap);
}
public static RoundedBitmapDrawable create(Resources paramResources, InputStream paramInputStream)
{
paramResources = create(paramResources, BitmapFactory.decodeStream(paramInputStream));
if (paramResources.getBitmap() == null) {
Log.w("RoundedBitmapDrawableFactory", "RoundedBitmapDrawable cannot decode " + paramInputStream);
}
return paramResources;
}
public static RoundedBitmapDrawable create(Resources paramResources, String paramString)
{
paramResources = create(paramResources, BitmapFactory.decodeFile(paramString));
if (paramResources.getBitmap() == null) {
Log.w("RoundedBitmapDrawableFactory", "RoundedBitmapDrawable cannot decode " + paramString);
}
return paramResources;
}
static final class a
extends RoundedBitmapDrawable
{
a(Resources paramResources, Bitmap paramBitmap)
{
super(paramBitmap);
}
final void a(int paramInt1, int paramInt2, int paramInt3, Rect paramRect1, Rect paramRect2)
{
GravityCompat.apply(paramInt1, paramInt2, paramInt3, paramRect1, paramRect2, 0);
}
public final boolean hasMipMap()
{
return (this.a != null) && (BitmapCompat.hasMipMap(this.a));
}
public final void setMipMap(boolean paramBoolean)
{
if (this.a != null)
{
BitmapCompat.setHasMipMap(this.a, paramBoolean);
invalidateSelf();
}
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v4/graphics/drawable/RoundedBitmapDrawableFactory.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/