ConnectSnapchatActivity.java
5.98 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
package com.bitstrips.imoji.ui.activities;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.text.SpannableStringBuilder;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.bitstrips.imoji.InjectorApplication;
import com.bitstrips.imoji.analytics.PageViewReporter;
import com.bitstrips.imoji.api.BitmojiApi;
import com.bitstrips.imoji.behaviour.BehaviourHelper;
import com.bitstrips.imoji.browser.ImojiBrowserActivity;
import com.bitstrips.imoji.persistence.MediaCache;
import com.bitstrips.imoji.ui.BitmojiBaseActivity;
import com.bitstrips.imoji.ui.IntentCreatorService;
import com.bitstrips.imoji.util.PreferenceUtils;
import com.squareup.picasso.RequestCreator;
import javax.inject.Inject;
import retrofit.Callback;
import retrofit.RetrofitError;
public class ConnectSnapchatActivity
extends BitmojiBaseActivity
{
public static final String KEY_INTENT_LINKED = "is_linked";
public static final String LOGOUT_ON_EXIT = "logout_on_exit";
public static final int SC_REQUEST_CODE = 55;
public static final String SC_REQUEST_TOKEN_EXTRA = "request_token";
@Inject
IntentCreatorService n;
@Inject
PreferenceUtils o;
@Inject
BitmojiApi p;
@Inject
PageViewReporter q;
@Inject
BehaviourHelper r;
@Inject
MediaCache s;
TextView t;
ImageView u;
ImageView v;
Button w;
private String x;
protected void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
((InjectorApplication)getApplication()).inject(this);
setContentView(2130903069);
this.t = ((TextView)findViewById(2131689634));
this.u = ((ImageView)findViewById(2131689631));
this.v = ((ImageView)findViewById(2131689632));
this.w = ((Button)findViewById(2131689635));
String str = getString(2131230872).replace("%%1$", "%1$").replace("%%2$", "%2$");
paramBundle = getString(2131231043);
Object localObject = str.replace("%1$", paramBundle);
int i = ((String)localObject).indexOf(paramBundle);
if (i != -1)
{
str = getString(2131231008);
localObject = ((String)localObject).replace("%2$", str);
int j = ((String)localObject).indexOf(str);
if (j != -1)
{
localObject = new SpannableStringBuilder((CharSequence)localObject);
((SpannableStringBuilder)localObject).setSpan(new ClickableSpan()
{
public final void onClick(View paramAnonymousView)
{
ConnectSnapchatActivity.this.n.goToTermsOfService(jdField_this);
}
public final void updateDrawState(TextPaint paramAnonymousTextPaint)
{
paramAnonymousTextPaint.setColor(ContextCompat.getColor(jdField_this, 2131624039));
paramAnonymousTextPaint.setFakeBoldText(true);
}
}, i, paramBundle.length() + i, 0);
((SpannableStringBuilder)localObject).setSpan(new ClickableSpan()
{
public final void onClick(View paramAnonymousView)
{
ConnectSnapchatActivity.this.n.goToPrivacyPolicy(jdField_this);
}
public final void updateDrawState(TextPaint paramAnonymousTextPaint)
{
paramAnonymousTextPaint.setColor(ContextCompat.getColor(jdField_this, 2131624039));
paramAnonymousTextPaint.setFakeBoldText(true);
}
}, j, str.length() + j, 0);
this.t.setText((CharSequence)localObject);
this.t.setMovementMethod(LinkMovementMethod.getInstance());
}
}
paramBundle = this.r.getRenderEndpoint();
str = this.o.getString(2131231175, "");
paramBundle = String.format(getString(2131231322), new Object[] { paramBundle, str });
this.s.load(paramBundle).into(this.u);
paramBundle = getIntent();
if (paramBundle != null)
{
this.x = paramBundle.getStringExtra("request_token");
this.q.connectToSnapchatScreenFromSnapchatApp();
}
this.w.setOnClickListener(new View.OnClickListener()
{
public final void onClick(View paramAnonymousView)
{
if (ConnectSnapchatActivity.a(ConnectSnapchatActivity.this) == null)
{
ConnectSnapchatActivity.b(ConnectSnapchatActivity.this);
return;
}
ConnectSnapchatActivity.this.p.linkToSnapchat(ConnectSnapchatActivity.a(ConnectSnapchatActivity.this), new Callback()
{
public final void failure(RetrofitError paramAnonymous2RetrofitError)
{
paramAnonymous2RetrofitError = ConnectSnapchatActivity.this.getString(2131230887);
String str = ConnectSnapchatActivity.this.getString(2131230902);
ConnectSnapchatActivity.this.showAlertDialog(paramAnonymous2RetrofitError, str, new Runnable()
{
public final void run() {}
}, null);
}
});
}
});
this.v.setOnClickListener(new View.OnClickListener()
{
public final void onClick(View paramAnonymousView)
{
if ((ConnectSnapchatActivity.d(ConnectSnapchatActivity.this)) || (ConnectSnapchatActivity.e(ConnectSnapchatActivity.this)))
{
paramAnonymousView = ConnectSnapchatActivity.this;
Intent localIntent = new Intent(paramAnonymousView, ImojiBrowserActivity.class);
localIntent.addFlags(131072);
localIntent.setData(Uri.parse(paramAnonymousView.getString(2131231276)));
paramAnonymousView.startActivity(localIntent);
paramAnonymousView.finish();
return;
}
ConnectSnapchatActivity.this.finish();
}
});
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/ui/activities/ConnectSnapchatActivity.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/