mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-22 14:35:03 +01:00
Ask confirmation when starting secret chat and sharing contact info
Thanks to https://github.com/DrKLO/Telegram/pull/401
This commit is contained in:
parent
63ba8a5ac1
commit
cdb39ac30f
4 changed files with 31 additions and 10 deletions
|
@ -82,7 +82,7 @@ android {
|
|||
defaultConfig {
|
||||
minSdkVersion 8
|
||||
targetSdkVersion 19
|
||||
versionCode 237
|
||||
versionCode 238
|
||||
versionName "1.4.15"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2566,6 +2566,12 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
|
|||
topPanel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setMessage(LocaleController.getString("AreYouSure", R.string.AreYouSure));
|
||||
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
|
||||
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
MessagesController.getInstance().hidenAddToContacts.put(currentUser.id, currentUser);
|
||||
topPanel.setVisibility(View.GONE);
|
||||
MessagesController.getInstance().sendMessage(UserConfig.currentUser, dialog_id);
|
||||
|
@ -2577,6 +2583,11 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
|
|||
});
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
visibleDialog = builder.show();
|
||||
visibleDialog.setCanceledOnTouchOutside(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -211,10 +211,20 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
|
|||
startSecretButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setMessage(LocaleController.getString("AreYouSure", R.string.AreYouSure));
|
||||
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
|
||||
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
creatingChat = true;
|
||||
MessagesController.getInstance().startSecretChat(getParentActivity(), MessagesController.getInstance().users.get(user_id));
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
builder.show().setCanceledOnTouchOutside(true);
|
||||
}
|
||||
});
|
||||
if (dialog_id == 0) {
|
||||
startSecretButton.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
|
|
|
@ -326,7 +326,7 @@ public class ActionBarActivity extends Activity {
|
|||
});
|
||||
velocityTracker.recycle();
|
||||
velocityTracker = null;
|
||||
} else if (ev == null) {
|
||||
} else if (ev == null || ev != null && (ev.getAction() == MotionEvent.ACTION_CANCEL || ev.getAction() == MotionEvent.ACTION_UP)) {
|
||||
maybeStartTracking = false;
|
||||
startedTracking = false;
|
||||
if (velocityTracker != null) {
|
||||
|
|
Loading…
Reference in a new issue