Skip to content

Commit 4b69110

Browse files
committed
inline startGuestChatActivity impl to make it more localized/readable
1 parent 33431c8 commit 4b69110

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

src/androidchat/app/src/main/java/servicestack/net/androidchat/LoginActivity.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ public void onError(FacebookException exception) {
153153
ImageButton btnAnon = (ImageButton)findViewById(R.id.btnAnon);
154154
btnAnon.setOnClickListener(view -> {
155155
UiHelpers.setStatus(txtStatus, "Opening chat as guest...");
156-
startGuestChatActivity(App.get().getServiceClient());
156+
App.get().getServiceClient().clearCookies();
157+
Intent intent = new Intent(this, MainActivity.class);
158+
startActivity(intent);
157159
});
158160

159161
dtos.Authenticate authDto = App.get().getSavedAccessToken();
@@ -192,11 +194,4 @@ private void stopProgressBar(){
192194
progressBar.setVisibility(View.INVISIBLE);
193195
});
194196
}
195-
196-
private void startGuestChatActivity(AndroidServiceClient client)
197-
{
198-
client.clearCookies();
199-
Intent intent = new Intent(this, MainActivity.class);
200-
startActivity(intent);
201-
}
202197
}

src/androidchat/app/src/main/java/servicestack/net/androidchat/LoginButtonsActivity.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ public void onError(FacebookException exception) {
145145
Button btnGuestLogin = (Button)findViewById(R.id.btnGuestLogin);
146146
btnGuestLogin.setOnClickListener(view -> {
147147
UiHelpers.setStatus(txtStatus, "Opening chat as guest...");
148-
startGuestChatActivity(App.get().getServiceClient());
148+
App.get().getServiceClient().clearCookies();
149+
Intent intent = new Intent(this, MainActivity.class);
150+
startActivity(intent);
149151
});
150152

151153
dtos.Authenticate authDto = App.get().getSavedAccessToken();
@@ -184,11 +186,4 @@ private void stopProgressBar(){
184186
progressBar.setVisibility(View.INVISIBLE);
185187
});
186188
}
187-
188-
private void startGuestChatActivity(AndroidServiceClient client)
189-
{
190-
client.clearCookies();
191-
Intent intent = new Intent(this, MainActivity.class);
192-
startActivity(intent);
193-
}
194189
}

0 commit comments

Comments
 (0)