SignUpActivity.java
5.86 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
package com.bitstrips.imoji.ui.activities;
import android.app.AlertDialog.Builder;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import com.bitstrips.imoji.InjectorApplication;
import com.bitstrips.imoji.analytics.LegacyAnalyticsService;
import com.bitstrips.imoji.analytics.PageViewReporter;
import com.bitstrips.imoji.api.BSAuthResponse;
import com.bitstrips.imoji.api.BitmojiApi;
import com.bitstrips.imoji.experiments.Experiments;
import com.bitstrips.imoji.models.BSUser;
import com.bitstrips.imoji.ui.OnboardingFormBaseActivity;
import com.bitstrips.imoji.ui.fragments.BirthdaySignUpFragment;
import com.bitstrips.imoji.ui.fragments.BirthdaySignUpFragment.OnBirthdaySelectedListener;
import com.bitstrips.imoji.ui.fragments.SignUpFormFragment;
import com.bitstrips.imoji.ui.fragments.SignUpFormFragment.FragmentWithValidationContainer;
import com.bitstrips.imoji.util.PreferenceUtils;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import javax.inject.Inject;
import retrofit.Callback;
import retrofit.RetrofitError;
public class SignUpActivity
extends OnboardingFormBaseActivity
implements BirthdaySignUpFragment.OnBirthdaySelectedListener, SignUpFormFragment.FragmentWithValidationContainer
{
public static final String EXTRA_LINK_BSAUTH = "linkBSAuth";
public static final int MIN_PASSWORD_LENGTH = 6;
@Inject
LegacyAnalyticsService n;
@Inject
BitmojiApi o;
@Inject
PreferenceUtils p;
@Inject
Experiments q;
@Inject
PageViewReporter r;
private Boolean s;
private String t;
private void a()
{
((InputMethodManager)getSystemService("input_method")).hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
}
public void doSignUp(final BSUser paramBSUser)
{
paramBSUser.setBirthday(this.t);
disableButtons();
Callback local1 = new Callback()
{
public final void failure(RetrofitError paramAnonymousRetrofitError)
{
SignUpActivity.a(SignUpActivity.this, paramAnonymousRetrofitError);
}
};
Callback local2 = new Callback()
{
public final void failure(RetrofitError paramAnonymousRetrofitError)
{
SignUpActivity.a(SignUpActivity.this, paramAnonymousRetrofitError);
}
};
if (this.s.booleanValue()) {
this.o.linkBSAuth(paramBSUser, local2);
}
for (;;)
{
a();
return;
this.o.createUser(paramBSUser, local1);
}
}
public void onBackPressed()
{
if (getFragmentManager().getBackStackEntryCount() > 0)
{
a();
getFragmentManager().popBackStack();
setTitle(2131230861);
return;
}
super.onBackPressed();
}
public void onBirthdaySelected(Calendar paramCalendar)
{
this.t = new SimpleDateFormat("yyyy-MM-dd", Locale.US).format(paramCalendar.getTime());
Calendar localCalendar = Calendar.getInstance();
localCalendar.setTime(new Date());
int j = localCalendar.get(1) - paramCalendar.get(1);
int i;
if (paramCalendar.get(2) <= localCalendar.get(2))
{
i = j;
if (paramCalendar.get(2) == localCalendar.get(2))
{
i = j;
if (paramCalendar.get(5) <= localCalendar.get(5)) {}
}
}
else
{
i = j - 1;
}
if (i < 13)
{
this.r.enteredInvalidBirthday();
if (isActivityValid()) {
new AlertDialog.Builder(this).setMessage(getString(2131230760)).setNeutralButton(17039370, new DialogInterface.OnClickListener()
{
public final void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt)
{
paramAnonymousDialogInterface.dismiss();
SignUpActivity.this.finish();
}
}).show();
}
return;
}
this.r.enteredValidBirthday();
getFragmentManager().beginTransaction().replace(2131689942, new SignUpFormFragment()).addToBackStack(null).commit();
((InputMethodManager)getSystemService("input_method")).toggleSoftInput(2, 1);
}
protected void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
((InjectorApplication)getApplication()).inject(this);
setContentView(2130903204);
this.s = Boolean.valueOf(getIntent().getBooleanExtra("linkBSAuth", false));
setSupportActionBar((Toolbar)findViewById(2131689623));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
FragmentTransaction localFragmentTransaction = getFragmentManager().beginTransaction();
if (this.s.booleanValue()) {}
for (paramBundle = new SignUpFormFragment();; paramBundle = new BirthdaySignUpFragment())
{
localFragmentTransaction.add(2131689942, paramBundle);
localFragmentTransaction.commit();
this.r.birthdayPageView();
return;
}
}
public boolean onOptionsItemSelected(MenuItem paramMenuItem)
{
if (paramMenuItem.getItemId() == 16908332)
{
onBackPressed();
return true;
}
return super.onOptionsItemSelected(paramMenuItem);
}
protected void onPause()
{
super.onPause();
}
public void onResume()
{
super.onResume();
}
public void setMainButton(Button paramButton)
{
super.setMainButton(paramButton);
}
public void setTitleBasedOnExtras()
{
if (this.s.booleanValue())
{
setTitle(2131230982);
return;
}
setTitle(2131231031);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/ui/activities/SignUpActivity.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/