AvatarManager.java
2.97 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
package com.bitstrips.imoji.identity;
import android.content.Context;
import android.content.res.Resources;
import com.bitstrips.imoji.abv3.AvatarBuilderGender;
import com.bitstrips.imoji.abv3.model.AvatarGetV3;
import com.bitstrips.imoji.api.BitmojiApi;
import com.bitstrips.imoji.injection.ForApplication;
import com.bitstrips.imoji.models.AvatarInfo;
import com.bitstrips.imoji.util.PreferenceUtils;
import java.util.Collections;
import java.util.Set;
import java.util.WeakHashMap;
import javax.inject.Inject;
import javax.inject.Singleton;
import retrofit.Callback;
import retrofit.RetrofitError;
import retrofit.client.Response;
@Singleton
public class AvatarManager
{
private static final String a = AvatarManager.class.getSimpleName();
private final BitmojiApi b;
private final PreferenceUtils c;
private final Set<OnAvatarIdUpdateListener> d = Collections.newSetFromMap(new WeakHashMap());
private int e;
@Inject
public AvatarManager(@ForApplication Context paramContext, BitmojiApi paramBitmojiApi, PreferenceUtils paramPreferenceUtils)
{
this.b = paramBitmojiApi;
this.c = paramPreferenceUtils;
this.e = paramContext.getResources().getInteger(2131558411);
}
public void addOnAvatarIdUpdateListener(OnAvatarIdUpdateListener paramOnAvatarIdUpdateListener)
{
this.d.add(paramOnAvatarIdUpdateListener);
}
public String getAvatarId()
{
return this.c.getString(2131231175, null);
}
@Deprecated
public AvatarBuilderGender getGender()
{
return AvatarBuilderGender.fromValue(this.c.getInt(2131231172, -1).intValue());
}
@Deprecated
public String getLegacyAvatarId()
{
return this.c.getString(2131231270, null);
}
public void removeOnAvatarIdUpdateListner(OnAvatarIdUpdateListener paramOnAvatarIdUpdateListener)
{
this.d.remove(paramOnAvatarIdUpdateListener);
}
public void updateAvatarInfo(final int paramInt, final UpdateAvatarInfoCallback paramUpdateAvatarInfoCallback)
{
this.b.getAvatarV3(new Callback()
{
public final void failure(RetrofitError paramAnonymousRetrofitError)
{
if (paramUpdateAvatarInfoCallback != null) {
paramUpdateAvatarInfoCallback.onFailure();
}
}
});
}
public void updateAvatarInfo(UpdateAvatarInfoCallback paramUpdateAvatarInfoCallback)
{
updateAvatarInfo(this.e, paramUpdateAvatarInfoCallback);
}
public Response updateAvatarInfoBackgroundSynchronous()
{
return this.b.getAvatarInfo(this.e, 1);
}
public static abstract interface OnAvatarIdUpdateListener
{
public abstract void onAvatarIdUpdate(String paramString);
}
public static abstract interface UpdateAvatarInfoCallback
{
public abstract void onFailure();
public abstract void onSuccess(String paramString1, String paramString2);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/identity/AvatarManager.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/