AvatarBuilderUriBuilder.java
6.08 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
package com.bitstrips.imoji.abv3;
import android.net.Uri;
import android.net.Uri.Builder;
import android.support.annotation.NonNull;
import com.bitstrips.imoji.abv3.category.AvatarCategoryDetails;
import com.bitstrips.imoji.abv3.model.AvatarLookAlike;
import com.bitstrips.imoji.abv3.model.AvatarOption;
import com.bitstrips.imoji.behaviour.BehaviourHelper;
import com.bitstrips.imoji.experiments.Experiments;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
public class AvatarBuilderUriBuilder
{
public static final String PATH_AVATAR_BUILDER = "avatar-builder";
public static final String PATH_AVATAR_BUILDER_V3 = "avatar-builder-v3";
public static final String PATH_FASHION = "fashion";
public static final String PATH_LOOKING_GOOD = "looking-good";
public static final String PATH_PREVIEW = "preview";
public static final String QUERY_PARAM_GENDER = "gender";
public static final String QUERY_PARAM_ROTATION = "rotation";
public static final String QUERY_PARAM_SCALE = "scale";
public static final String QUERY_PARAM_STYLE = "style";
private final AvatarBuilderConfig a;
private final AvatarBuilderSelection b;
private final Uri c;
private final String d;
private final BehaviourHelper e;
private final Experiments f;
public AvatarBuilderUriBuilder(String paramString1, String paramString2, AvatarBuilderConfig paramAvatarBuilderConfig, AvatarBuilderSelection paramAvatarBuilderSelection, BehaviourHelper paramBehaviourHelper, Experiments paramExperiments)
{
this.a = paramAvatarBuilderConfig;
this.d = paramString2;
this.b = paramAvatarBuilderSelection;
this.c = Uri.parse(paramString1);
this.e = paramBehaviourHelper;
this.f = paramExperiments;
}
private Uri a(Integer paramInteger, float paramFloat, @NonNull String paramString, Map<String, Integer> paramMap)
{
return a(paramInteger, paramFloat, paramString, paramMap, null);
}
private Uri a(Integer paramInteger, float paramFloat, @NonNull String paramString1, Map<String, Integer> paramMap, String paramString2)
{
Uri.Builder localBuilder = new Uri.Builder();
localBuilder.scheme(this.c.getScheme());
localBuilder.authority(this.c.getAuthority());
localBuilder.appendPath(this.d).appendPath("preview").appendPath(paramString1);
localBuilder.appendQueryParameter("scale", String.valueOf(paramFloat));
localBuilder.appendQueryParameter("gender", String.valueOf(this.a.getGender().getValue()));
localBuilder.appendQueryParameter("style", String.valueOf(this.a.getStyle().getValue()));
if (paramInteger != null) {
localBuilder.appendQueryParameter("rotation", String.valueOf(paramInteger));
}
paramInteger = new TreeSet(paramMap.keySet()).iterator();
while (paramInteger.hasNext())
{
paramString1 = (String)paramInteger.next();
Integer localInteger = (Integer)paramMap.get(paramString1);
if (localInteger != null) {
localBuilder.appendQueryParameter(paramString1, String.valueOf(localInteger));
}
}
if (paramString2 != null) {
localBuilder.appendQueryParameter("format", paramString2);
}
return localBuilder.build();
}
public Uri getLookAlikeUri(@NonNull AvatarCategoryDetails paramAvatarCategoryDetails, @NonNull AvatarLookAlike paramAvatarLookAlike)
{
HashMap localHashMap = new HashMap();
Map localMap1 = this.a.getInitialUserAvatarData();
Map localMap2 = this.b.getSelectedOptions();
localHashMap.putAll(paramAvatarLookAlike.getValueMap());
localHashMap.putAll(localMap1);
localHashMap.putAll(localMap2);
return a(Integer.valueOf(paramAvatarCategoryDetails.getRotation()), 0.75F, paramAvatarCategoryDetails.getDisplayType(), localHashMap);
}
public Uri getOptionUri(@NonNull AvatarCategoryDetails paramAvatarCategoryDetails, @NonNull AvatarOption paramAvatarOption)
{
HashMap localHashMap = new HashMap();
Object localObject1 = this.a.getInitialUserAvatarData();
Object localObject2 = this.b.getSelectedOptionsWithLookAlike();
localHashMap.putAll((Map)localObject1);
localHashMap.putAll((Map)localObject2);
localHashMap.put(paramAvatarCategoryDetails.getCategoryKey(), Integer.valueOf(paramAvatarOption.getValue()));
paramAvatarOption = new UriBuilderWhitelistCategoryHelper(this.e.isFewerOptionTraitsEnabled(this.f), this.a.getGender());
localObject1 = new HashMap();
localObject2 = localHashMap.keySet().iterator();
while (((Iterator)localObject2).hasNext())
{
String str = (String)((Iterator)localObject2).next();
if (paramAvatarOption.shouldKeepCategory(str, paramAvatarCategoryDetails.getCategoryKey())) {
((Map)localObject1).put(str, localHashMap.get(str));
}
}
return a(Integer.valueOf(paramAvatarCategoryDetails.getRotation()), 0.75F, paramAvatarCategoryDetails.getDisplayType(), (Map)localObject1);
}
public Uri getPreviewUri(AvatarCategoryDetails paramAvatarCategoryDetails, int paramInt)
{
return getPreviewUri(paramAvatarCategoryDetails, paramInt, null);
}
public Uri getPreviewUri(AvatarCategoryDetails paramAvatarCategoryDetails, int paramInt, String paramString)
{
paramAvatarCategoryDetails = new HashMap();
Map localMap1 = this.a.getInitialUserAvatarData();
Map localMap2 = this.b.getSelectedOptionsWithLookAlike();
paramAvatarCategoryDetails.putAll(localMap1);
paramAvatarCategoryDetails.putAll(localMap2);
return a(Integer.valueOf(paramInt), 2.5F, "body", paramAvatarCategoryDetails, paramString);
}
public Uri getSaveUri(@NonNull AvatarCategoryDetails paramAvatarCategoryDetails)
{
paramAvatarCategoryDetails = new HashMap();
Map localMap1 = this.a.getInitialUserAvatarData();
Map localMap2 = this.b.getSelectedOptions();
paramAvatarCategoryDetails.putAll(localMap1);
paramAvatarCategoryDetails.putAll(localMap2);
return a(null, 2.5F, "fashion", paramAvatarCategoryDetails);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/abv3/AvatarBuilderUriBuilder.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/