Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit 04f789f

Browse files
Ramkishorevitkunall17
authored andcommitted
Fixed #479 conformation added on logout
1 parent b84b919 commit 04f789f

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

app/src/main/java/com/zulip/android/activities/ZulipActivity.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2393,7 +2393,20 @@ public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
23932393
datePickerDialog.show();
23942394
break;
23952395
case R.id.logout:
2396-
logout();
2396+
AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);
2397+
alertDialog.setTitle(getString(R.string.logout));
2398+
alertDialog.setMessage(getString(R.string.logout_title));
2399+
alertDialog.setPositiveButton(getString(android.R.string.yes), new DialogInterface.OnClickListener() {
2400+
public void onClick(DialogInterface dialog, int which) {
2401+
logout();
2402+
}
2403+
});
2404+
alertDialog.setNegativeButton(getString(android.R.string.no), new DialogInterface.OnClickListener() {
2405+
public void onClick(DialogInterface dialog, int which) {
2406+
dialog.cancel();
2407+
}
2408+
});
2409+
alertDialog.show();
23972410
break;
23982411
case R.id.terms:
23992412
openUrl(Constants.END_POINT_TERMS_OF_SERVICE);

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
<string name="cancel">Cancel</string>
172172
<string name="no_message_to_display">Sorry, no messages to display!</string>
173173
<string name="crop">CROP</string>
174-
174+
<string name="logout_title">Are you sure you want to logout?</string>
175175
<!--Placeholder strings-->
176176
<string name="placeholder_my_stream">MyStream</string>
177177
<string name="placeholder_short_stream">Short Stream</string>

0 commit comments

Comments
 (0)