StickerViewHolder.java
3.95 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
package com.bitstrips.imoji.browser.views;
import android.content.res.Resources;
import android.support.v7.widget.RecyclerView.ViewHolder;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import com.bitstrips.imoji.analytics.Action;
import com.bitstrips.imoji.analytics.Category;
import com.bitstrips.imoji.analytics.LegacyAnalyticsService;
import com.bitstrips.imoji.analytics.performance.AnalyticsLabelKey;
import com.bitstrips.imoji.analytics.performance.PerformanceTimer;
import com.bitstrips.imoji.analytics.performance.TimedMetric;
import com.bitstrips.imoji.models.Sticker;
import com.bitstrips.imoji.persistence.MediaCache;
import com.squareup.picasso.Callback;
import com.squareup.picasso.RequestCreator;
import java.util.HashMap;
import java.util.concurrent.TimeUnit;
public class StickerViewHolder
extends RecyclerView.ViewHolder
implements View.OnClickListener
{
private final MediaCache n;
private final LegacyAnalyticsService o;
private final OnStickerSelectedListener p;
private final ImageView q;
private final View r;
private Sticker s;
private String t;
public StickerViewHolder(View paramView, MediaCache paramMediaCache, LegacyAnalyticsService paramLegacyAnalyticsService, OnStickerSelectedListener paramOnStickerSelectedListener)
{
super(paramView);
this.n = paramMediaCache;
this.o = paramLegacyAnalyticsService;
this.r = paramView.findViewById(2131689791);
this.q = ((ImageView)paramView.findViewById(2131689792));
this.p = paramOnStickerSelectedListener;
this.q.setOnClickListener(this);
}
public void cancel()
{
this.n.cancelRequest(this.q);
}
public void onClick(View paramView)
{
if (this.s != null) {
this.p.onStickerSelected(this.s, this.t);
}
}
public StickerViewHolder setCategoryName(String paramString)
{
this.t = paramString;
return this;
}
public StickerViewHolder setSticker(final Sticker paramSticker, final String paramString)
{
this.s = null;
this.r.setBackground(this.q.getResources().getDrawable(2130837884));
this.q.setVisibility(4);
this.r.setVisibility(0);
this.q.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
this.n.load(paramSticker.getImageUrl()).fit().into(this.q, new Callback()
{
public final void onError()
{
StickerViewHolder.b(StickerViewHolder.this).setBackground(StickerViewHolder.a(StickerViewHolder.this).getResources().getDrawable(2130837918));
StickerViewHolder.b(StickerViewHolder.this).setOnClickListener(new View.OnClickListener()
{
public final void onClick(View paramAnonymous2View)
{
StickerViewHolder.this.setSticker(StickerViewHolder.1.this.a, StickerViewHolder.1.this.b);
}
});
}
public final void onSuccess()
{
StickerViewHolder.a(StickerViewHolder.this, paramSticker);
StickerViewHolder.a(StickerViewHolder.this).setVisibility(0);
StickerViewHolder.b(StickerViewHolder.this).setVisibility(8);
long l = PerformanceTimer.stopTimer(TimedMetric.APP_START);
if (l != -1L)
{
float f = (float)(l / TimeUnit.SECONDS.toMillis(1L));
HashMap localHashMap = new HashMap(2);
localHashMap.put(AnalyticsLabelKey.PERFORMANCE_DURATION, Float.valueOf(f));
localHashMap.put(AnalyticsLabelKey.APP_STATE_KEY, "cold");
StickerViewHolder.c(StickerViewHolder.this).sendEvent(Category.PERFORMANCE, Action.PERCEIVED_OPEN, localHashMap);
}
}
});
return this;
}
public static abstract interface OnStickerSelectedListener
{
public abstract void onStickerSelected(Sticker paramSticker, String paramString);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/browser/views/StickerViewHolder.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/