Enhance GUI.

This commit is contained in:
B. Petersen
2016-10-23 14:50:09 +02:00
parent 95fee7ec90
commit cc4a68a36d
10 changed files with 98 additions and 277 deletions
+6
View File
@@ -348,6 +348,12 @@ JNIEXPORT jint Java_org_telegram_messenger_MrMailbox_MrChatGetDraftReplyToMsgId(
}
JNIEXPORT jint Java_org_telegram_messenger_MrMailbox_MrChatGetTotalMsgCount(JNIEnv *env, jclass c, jlong hChat)
{
return mrchat_get_total_msg_count((mrchat_t*)hChat); /* mrchat_get_unread_count() checks for nullpointers */
}
JNIEXPORT jint Java_org_telegram_messenger_MrMailbox_MrChatGetUnreadCount(JNIEnv *env, jclass c, jlong hChat)
{
return mrchat_get_unread_count((mrchat_t*)hChat); /* mrchat_get_unread_count() checks for nullpointers */
@@ -162,6 +162,7 @@ public class MrMailbox {
public native static int MrChatGetDraftReplyToMsgId (long hChat); // returns 0 for "no draft"
public native static int MrChatSetDraft (long hChat, String draft/*NULL=delete*/, long replyToMsgId);
public native static int MrChatGetUnreadCount (long hChat);
public native static int MrChatGetTotalMsgCount (long hChat);
public native static long MrChatGetSummary (long hChat); // returns hPoortext
public native static long MrChatGetMsglist (long hChat, int offset, int amount); // returns hMsglist
@@ -317,9 +317,8 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
private float startY = 0;
private final static int copy = 10;
private final static int forward = 11;
private final static int delete = 12;
//private final static int chat_enc_timer = 13;
private final static int id_forward = 11;
private final static int id_delete_messages = 12;
private final static int chat_menu_attach = 14;
private final static int clear_history = 15;
private final static int delete_chat = 16;
@@ -810,41 +809,48 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
chatActivityEnterView.doneEditingMessage();
}
*/
} else if (id == delete) {
} else if (id == id_delete_messages) {
if (getParentActivity() == null) {
return;
}
createDeleteMessagesAlert(null);
} else if (id == forward) {
} else if (id == id_forward) {
Toast.makeText(getParentActivity(), LocaleController.getString("NotYetImplemented", R.string.NotYetImplemented), Toast.LENGTH_LONG).show();
/*
Bundle args = new Bundle();
args.putBoolean("onlySelect", true);
args.putInt("dialogsType", 1);
DialogsActivity fragment = new DialogsActivity(args);
fragment.setDelegate(ChatActivity.this);
presentFragment(fragment);
/*
} else if (id == chat_enc_timer) {
if (getParentActivity() == null) {
return;
}
showDialog(AndroidUtilities.buildTTLAlert(getParentActivity(), currentEncryptedChat).create());
*/
*/
actionBar.hideActionMode();
updateVisibleRows();
} else if (id == clear_history || id == delete_chat) {
if (getParentActivity() == null) {
return;
}
final boolean isChat = (int) dialog_id < 0 && (int) (dialog_id >> 32) != 1;
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
int totalMessagesCount = MrMailbox.MrChatGetTotalMsgCount(m_hChat);
String messageText = LocaleController.formatString("AreYouSureDeleteMessages", R.string.AreYouSureDeleteMessages, LocaleController.formatPluralString("messages", totalMessagesCount));
if (id == clear_history) {
builder.setMessage(LocaleController.getString("AreYouSureClearHistory", R.string.AreYouSureClearHistory));
builder.setTitle(LocaleController.getString("ClearHistory", R.string.ClearHistory));
} else {
if (isChat) {
builder.setMessage(LocaleController.getString("AreYouSureDeleteAndExit", R.string.AreYouSureDeleteAndExit));
if (MrMailbox.MrChatGetType(m_hChat)==MrMailbox.MR_CHAT_GROUP) {
builder.setTitle(LocaleController.getString("DeleteAndExit", R.string.DeleteAndExit));
messageText += "\n\n" + LocaleController.getString("AreYouSureDeleteAndExit", R.string.AreYouSureDeleteAndExit);
} else {
builder.setMessage(LocaleController.getString("AreYouSureDeleteThisChat", R.string.AreYouSureDeleteThisChat));
builder.setTitle(LocaleController.getString("DeleteChat", R.string.DeleteChat));
}
}
builder.setMessage(messageText);
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
@@ -890,7 +896,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
}
else{
// TODO: a normal reply function ...
Toast.makeText(getParentActivity(), LocaleController.getString("NotYetImplemented", R.string.NotYetImplemented), Toast.LENGTH_LONG).show();
/*
MessageObject messageObject = null;
for (int a = 1; a >= 0; a--) {
@@ -904,11 +910,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if (messageObject != null && (messageObject.messageOwner.id > 0 || messageObject.messageOwner.id < 0 && currentEncryptedChat != null)) {
showReplyPanel(true, messageObject, null, null, false, true);
}
*/
cantDeleteMessagesCount = 0;
actionBar.hideActionMode();
updatePinnedMessageView(true);
updateVisibleRows();
*/
}
} else if (id == chat_menu_attach) {
if (getParentActivity() == null) {
@@ -1011,21 +1017,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if (currentUser != null) {
addContactItem = headerItem.addSubItem(share_contact, "", 0);
}
/*
if (currentEncryptedChat != null) {
timeItem2 = headerItem.addSubItem(chat_enc_timer, LocaleController.getString("SetTimer", R.string.SetTimer), 0);
}
*/
/* EDIT BY MR -- it's not yet clear if and how messages can be deleted and/or chats can be leaved; disable this for the moment
if (!ChatObject.isChannel(currentChat)) {
headerItem.addSubItem(clear_history, LocaleController.getString("ClearHistory", R.string.ClearHistory), 0);
if (currentChat != null && !isBroadcast) {
headerItem.addSubItem(delete_chat, LocaleController.getString("DeleteAndExit", R.string.DeleteAndExit), 0);
} else {
headerItem.addSubItem(delete_chat, LocaleController.getString("DeleteChatUser", R.string.DeleteChatUser), 0);
}
}
*/
m_canMute = true;
if( MrMailbox.MrChatGetId(m_hChat)==MrMailbox.MR_CHAT_ID_STRANGERS
@@ -1037,6 +1028,16 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
muteItem = headerItem.addSubItem(mute, null, 0);
}
headerItem.addSubItem(clear_history, LocaleController.getString("ClearHistory", R.string.ClearHistory), 0);
if (MrMailbox.MrChatGetType(m_hChat)==MrMailbox.MR_CHAT_GROUP) {
headerItem.addSubItem(delete_chat, LocaleController.getString("DeleteAndExit", R.string.DeleteAndExit), 0);
} else {
headerItem.addSubItem(delete_chat, LocaleController.getString("DeleteChat", R.string.DeleteChat), 0);
}
/*
if (currentUser != null && currentEncryptedChat == null && currentUser.bot) {
@@ -1128,14 +1129,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
actionModeSubTextView.setGravity(Gravity.LEFT);
actionModeSubTextView.setTextColor(Theme.ACTION_BAR_ACTION_MODE_TEXT_COLOR);
actionModeTitleContainer.addView(actionModeSubTextView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));
if( MrMailbox.MrChatGetId(m_hChat)==MrMailbox.MR_CHAT_ID_STRANGERS) { // for normal chats, reply is not yet implemented, just use the normal "send" function
actionModeViews.add(actionMode.addItem(id_reply, R.drawable.ic_ab_reply, Theme.ACTION_BAR_MODE_SELECTOR_COLOR, null, AndroidUtilities.dp(54)));
}
actionModeViews.add(actionMode.addItem(id_reply, R.drawable.ic_ab_reply, Theme.ACTION_BAR_MODE_SELECTOR_COLOR, null, AndroidUtilities.dp(54)));
actionModeViews.add(actionMode.addItem(copy, R.drawable.ic_ab_fwd_copy, Theme.ACTION_BAR_MODE_SELECTOR_COLOR, null, AndroidUtilities.dp(54)));
actionModeViews.add(actionMode.addItem(delete, R.drawable.ic_ab_fwd_delete, Theme.ACTION_BAR_MODE_SELECTOR_COLOR, null, AndroidUtilities.dp(54)));
actionModeViews.add(actionMode.addItem(forward, R.drawable.ic_ab_fwd_forward, Theme.ACTION_BAR_MODE_SELECTOR_COLOR, null, AndroidUtilities.dp(54)));
actionModeViews.add(actionMode.addItem(id_delete_messages, R.drawable.ic_ab_fwd_delete, Theme.ACTION_BAR_MODE_SELECTOR_COLOR, null, AndroidUtilities.dp(54)));
actionModeViews.add(actionMode.addItem(id_forward, R.drawable.ic_ab_fwd_forward, Theme.ACTION_BAR_MODE_SELECTOR_COLOR, null, AndroidUtilities.dp(54)));
//actionModeViews.add(editDoneItem = actionMode.addItem(edit_done, R.drawable.check_blue, Theme.ACTION_BAR_MODE_SELECTOR_COLOR, null, AndroidUtilities.dp(54)));
//editDoneItem.setVisibility(View.GONE);
//editDoneItemProgress = new ContextProgressView(context);
@@ -1144,7 +1141,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
actionMode.getItem(copy).setVisibility(selectedMessagesCanCopyIds[0].size() + selectedMessagesCanCopyIds[1].size() != 0 ? View.VISIBLE : View.GONE);
actionMode.getItem(delete).setVisibility(cantDeleteMessagesCount == 0 ? View.VISIBLE : View.GONE);
actionMode.getItem(id_delete_messages).setVisibility(cantDeleteMessagesCount == 0 ? View.VISIBLE : View.GONE);
checkActionBarMenu();
fragmentView = new SizeNotifierFrameLayout(context) {
@@ -2032,17 +2029,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
mentionLayoutManager.scrollToPositionWithOffset(0, 10000);
}
if (allowStickersPanel && (!mentionsAdapter.isBotContext() || (allowContextBotPanel || allowContextBotPanelSecond))) {
/*if (currentEncryptedChat != null && mentionsAdapter.isBotContext()) {
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
if (!preferences.getBoolean("secretbot", false)) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setMessage(LocaleController.getString("SecretChatContextBotAlert", R.string.SecretChatContextBotAlert));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
showDialog(builder.create());
preferences.edit().putBoolean("secretbot", true).commit();
}
}*/
mentionContainer.setVisibility(View.VISIBLE);
mentionContainer.setTag(null);
mentionListAnimation = new AnimatorSet();
@@ -2140,7 +2126,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
mentionsAdapter.setChatInfo(info);
mentionsAdapter.setNeedUsernames(currentChat != null);
mentionsAdapter.setNeedBotContext(currentEncryptedChat == null || AndroidUtilities.getPeerLayerVersion(currentEncryptedChat.layer) >= 46);
//mentionsAdapter.setBotsCount(currentChat != null ? botsCount : 1);
mentionListView.setOnItemClickListener(mentionsOnItemClickListener = new RecyclerListView.OnItemClickListener() {
@Override
public void onItemClick(View view, int position) {
@@ -2184,8 +2169,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
chatActivityEnterView.setFieldText("");
showReplyPanel(false, null, null, null, false, true);
SearchQuery.increaseInlineRaiting(uid);
} else if (object instanceof TLRPC.TL_inlineBotSwitchPM) {
//processInlineBotContextPM((TLRPC.TL_inlineBotSwitchPM) object);
}
}
});
@@ -2628,7 +2611,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
updateContactStatus();
updateBottomOverlay();
//updateSecretStatus(); -- EDIT BY MR
updateSpamView();
updatePinnedMessageView(true);
@@ -3190,7 +3172,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
} else if (which == attach_location ) {
/* Telegram-FOSS Disabled for now.*/
Toast.makeText(getParentActivity(), "Disabled for now.", Toast.LENGTH_LONG).show();
Toast.makeText(getParentActivity(), LocaleController.getString("NotYetImplemented", R.string.NotYetImplemented), Toast.LENGTH_LONG).show();
/*AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() {
@@ -4247,7 +4229,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
int copyVisible = actionBar.createActionMode().getItem(copy).getVisibility();
actionBar.createActionMode().getItem(copy).setVisibility(selectedMessagesCanCopyIds[0].size() + selectedMessagesCanCopyIds[1].size() != 0 ? View.VISIBLE : View.GONE);
int newCopyVisible = actionBar.createActionMode().getItem(copy).getVisibility();
actionBar.createActionMode().getItem(delete).setVisibility(cantDeleteMessagesCount == 0 ? View.VISIBLE : View.GONE);
actionBar.createActionMode().getItem(id_delete_messages).setVisibility(cantDeleteMessagesCount == 0 ? View.VISIBLE : View.GONE);
final ActionBarMenuItem replyItem = actionBar.createActionMode().getItem(id_reply);
if (replyItem != null) {
boolean allowChatActions = true;
@@ -4799,15 +4781,22 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
*/
long hMsglist = MrMailbox.MrChatGetMsglist(m_hChat, 0, 100);
int mrCount = MrMailbox.MrMsglistGetCnt(hMsglist);
for (int a = 0; a < mrCount; a++ ) {
long hMsg = MrMailbox.MrMsglistGetMsgByIndex(hMsglist, a);
MessageObject mo = new MessageObject(MrMailbox.hMsg2Message(hMsg), null, true);
messages.add(0, mo);
MrMailbox.MrMsgUnref(hMsg);
}
int mrCount = MrMailbox.MrMsglistGetCnt(hMsglist);
for (int a = 0; a < mrCount; a++ ) {
long hMsg = MrMailbox.MrMsglistGetMsgByIndex(hMsglist, a);
MessageObject mo = new MessageObject(MrMailbox.hMsg2Message(hMsg), null, true);
messages.add(0, mo);
MrMailbox.MrMsgUnref(hMsg);
}
if( MrMailbox.MrChatGetId(m_hChat)==MrMailbox.MR_CHAT_ID_STRANGERS ) {
updateBottomOverlay();
}
MrMailbox.MrMsglistUnref(hMsglist);
int approximateHeightSum = 0;
/* EDIT BY MR -- the add loop
@@ -5073,6 +5062,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
first = false;
}
if (messages.isEmpty() && currentEncryptedChat == null && currentUser != null && currentUser.bot && botUser == null) {
botUser = "";
updateBottomOverlay();
@@ -7001,10 +6993,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
private void createDeleteMessagesAlert(final MessageObject finalSelectedObject) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setMessage(LocaleController.formatString("AreYouSureDeleteMessages", R.string.AreYouSureDeleteMessages, LocaleController.formatPluralString("messages", finalSelectedObject != null ? 1 : selectedMessagesIds[0].size() + selectedMessagesIds[1].size())));
builder.setTitle(LocaleController.getString("Message", R.string.Message));
final boolean[] checks = new boolean[3];
TLRPC.User user = null;
//final boolean[] checks = new boolean[3];
//TLRPC.User user = null;
/*
if (currentChat != null && currentChat.megagroup) {
if (finalSelectedObject != null) {
if (finalSelectedObject.messageOwner.action == null || finalSelectedObject.messageOwner.action instanceof TLRPC.TL_messageActionEmpty) {
@@ -7065,12 +7057,17 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
user = null;
}
}
final TLRPC.User userFinal = user;
*/
//final TLRPC.User userFinal = user;
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Toast.makeText(getParentActivity(), LocaleController.getString("NotYetImplemented", R.string.NotYetImplemented), Toast.LENGTH_LONG).show();
ArrayList<Integer> ids = null;
if (finalSelectedObject != null) {
// delete a single selected message by the single-click-message menu (we don't use this approach)
/*
ids = new ArrayList<>();
ids.add(finalSelectedObject.getId());
ArrayList<Long> random_ids = null;
@@ -7079,7 +7076,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
random_ids.add(finalSelectedObject.messageOwner.random_id);
}
MessagesController.getInstance().deleteMessages(ids, random_ids, currentEncryptedChat, finalSelectedObject.messageOwner.to_id.channel_id);
*/
} else {
// delete all selected messages
/*
for (int a = 1; a >= 0; a--) {
ids = new ArrayList<>(selectedMessagesIds[a].keySet());
ArrayList<Long> random_ids = null;
@@ -7101,9 +7101,12 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
MessagesController.getInstance().deleteMessages(ids, random_ids, currentEncryptedChat, channelId);
}
*/
actionBar.hideActionMode();
updatePinnedMessageView(true);
updateVisibleRows();
}
/*
if (userFinal != null) {
if (checks[0]) {
MessagesController.getInstance().deleteUserFromChat(currentChat.id, userFinal, info);
@@ -7124,6 +7127,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
MessagesController.getInstance().deleteUserChannelHistory(currentChat, userFinal, 0);
}
}
*/
}
});
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
@@ -7377,11 +7381,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
// handle long clicks
final ActionBarMenu actionMode = actionBar.createActionMode();
View item = actionMode.getItem(forward);
View item = actionMode.getItem(id_forward);
if (item != null) {
item.setVisibility(View.VISIBLE);
}
item = actionMode.getItem(delete);
item = actionMode.getItem(id_delete_messages);
if (item != null) {
item.setVisibility(View.VISIBLE);
}
@@ -8260,7 +8264,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
chatMessageCell.setDelegate(new ChatMessageCell.ChatMessageCellDelegate() {
@Override
public void didPressedShare(ChatMessageCell cell) {
// a click on the icon rignt of a stranger's messages
createChatByStrangerMsgId(cell.getMessageObject().getId());
}
@@ -459,159 +459,6 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
}
}
});
listView.setOnItemLongClickListener(new RecyclerListView.OnItemLongClickListener() {
@Override
public boolean onItemClick(View view, int position) {
if (onlySelect || searching && searchWas || getParentActivity() == null) {
if (searchWas && searching || dialogsSearchAdapter.isRecentSearchDisplayed()) {
RecyclerView.Adapter adapter = listView.getAdapter();
if (adapter == dialogsSearchAdapter) {
Object item = dialogsSearchAdapter.getItem(position);
if (item instanceof String || dialogsSearchAdapter.isRecentSearchDisplayed()) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setMessage(LocaleController.getString("ClearSearch", R.string.ClearSearch));
builder.setPositiveButton(LocaleController.getString("ClearButton", R.string.ClearButton).toUpperCase(), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if (dialogsSearchAdapter.isRecentSearchDisplayed()) {
dialogsSearchAdapter.clearRecentSearch();
} else {
dialogsSearchAdapter.clearRecentHashtags();
}
}
});
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
showDialog(builder.create());
return true;
}
}
}
return false;
}
TLRPC.TL_dialog dialog;
ArrayList<TLRPC.TL_dialog> dialogs = getDialogsArray();
if (position < 0 || position >= dialogs.size()) {
return false;
}
dialog = dialogs.get(position);
selectedDialog = dialog.id;
BottomSheet.Builder builder = new BottomSheet.Builder(getParentActivity());
int lower_id = (int) selectedDialog;
int high_id = (int) (selectedDialog >> 32);
if (DialogObject.isChannel(dialog)) {
final TLRPC.Chat chat = MessagesController.getInstance().getChat(-lower_id);
CharSequence items[];
if (chat != null && chat.megagroup) {
items = new CharSequence[]{LocaleController.getString("ClearHistoryCache", R.string.ClearHistoryCache), chat == null || !chat.creator ? LocaleController.getString("LeaveMegaMenu", R.string.LeaveMegaMenu) : LocaleController.getString("DeleteMegaMenu", R.string.DeleteMegaMenu)};
} else {
items = new CharSequence[]{LocaleController.getString("ClearHistoryCache", R.string.ClearHistoryCache), chat == null || !chat.creator ? LocaleController.getString("LeaveChannelMenu", R.string.LeaveChannelMenu) : LocaleController.getString("ChannelDeleteMenu", R.string.ChannelDeleteMenu)};
}
builder.setItems(items, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, final int which) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
if (which == 0) {
if (chat != null && chat.megagroup) {
builder.setMessage(LocaleController.getString("AreYouSureClearHistorySuper", R.string.AreYouSureClearHistorySuper));
} else {
builder.setMessage(LocaleController.getString("AreYouSureClearHistoryChannel", R.string.AreYouSureClearHistoryChannel));
}
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
MessagesController.getInstance().deleteDialog(selectedDialog, 2);
}
});
} else {
if (chat != null && chat.megagroup) {
if (!chat.creator) {
builder.setMessage(LocaleController.getString("MegaLeaveAlert", R.string.MegaLeaveAlert));
} else {
builder.setMessage(LocaleController.getString("MegaDeleteAlert", R.string.MegaDeleteAlert));
}
} else {
if (chat == null || !chat.creator) {
builder.setMessage(LocaleController.getString("ChannelLeaveAlert", R.string.ChannelLeaveAlert));
} else {
builder.setMessage(LocaleController.getString("ChannelDeleteAlert", R.string.ChannelDeleteAlert));
}
}
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
MessagesController.getInstance().deleteUserFromChat((int) -selectedDialog, UserConfig.getCurrentUser(), null);
if (AndroidUtilities.isTablet()) {
NotificationCenter.getInstance().postNotificationName(NotificationCenter.closeChats, selectedDialog);
}
}
});
}
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
showDialog(builder.create());
}
});
showDialog(builder.create());
} else {
final boolean isChat = lower_id < 0 && high_id != 1;
TLRPC.User user = null;
if (!isChat && lower_id > 0 && high_id != 1) {
user = MessagesController.getInstance().getUser(lower_id);
}
final boolean isBot = user != null && user.bot;
builder.setItems(new CharSequence[]{LocaleController.getString("ClearHistory", R.string.ClearHistory),
isChat ? LocaleController.getString("DeleteChat", R.string.DeleteChat) :
isBot ? LocaleController.getString("DeleteAndStop", R.string.DeleteAndStop) : LocaleController.getString("Delete", R.string.Delete)}, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, final int which) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
if (which == 0) {
builder.setMessage(LocaleController.getString("AreYouSureClearHistory", R.string.AreYouSureClearHistory));
} else {
if (isChat) {
builder.setMessage(LocaleController.getString("AreYouSureDeleteAndExit", R.string.AreYouSureDeleteAndExit));
} else {
builder.setMessage(LocaleController.getString("AreYouSureDeleteThisChat", R.string.AreYouSureDeleteThisChat));
}
}
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if (which != 0) {
if (isChat) {
TLRPC.Chat currentChat = MessagesController.getInstance().getChat((int) -selectedDialog);
if (currentChat != null && ChatObject.isNotInChat(currentChat)) {
MessagesController.getInstance().deleteDialog(selectedDialog, 0);
} else {
MessagesController.getInstance().deleteUserFromChat((int) -selectedDialog, MessagesController.getInstance().getUser(UserConfig.getClientUserId()), null);
}
} else {
MessagesController.getInstance().deleteDialog(selectedDialog, 0);
}
if (isBot) {
MessagesController.getInstance().blockUser((int) selectedDialog);
}
if (AndroidUtilities.isTablet()) {
NotificationCenter.getInstance().postNotificationName(NotificationCenter.closeChats, selectedDialog);
}
} else {
MessagesController.getInstance().deleteDialog(selectedDialog, 1);
}
}
});
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
showDialog(builder.create());
}
});
showDialog(builder.create());
}
return true;
}
});
searchEmptyView = new EmptyTextProgressView(context);
searchEmptyView.setVisibility(View.GONE);
@@ -43,9 +43,8 @@
<string name="WaitingForNetwork">Warte auf Netzwerk...</string>
<string name="Connecting">Verbinde…</string>
<string name="Updating">Aktualisiere…</string>
<string name="ClearHistory">Verlauf löschen</string>
<string name="ClearHistoryCache">Cache leeren</string>
<string name="DeleteChat">Löschen und beenden</string>
<string name="ClearHistory">Alle Nachrichten löschen</string>
<string name="DeleteChat">Chat löschen</string>
<string name="DeleteChatUser">Chat löschen</string>
<string name="HiddenName">Gelöschtes Konto</string>
<string name="SelectChat">Chat auswählen</string>
@@ -56,7 +55,6 @@
<string name="MuteFor">Stumm für %1$s</string>
<string name="UnmuteNotifications">Stumm aus</string>
<string name="WillUnmuteIn">In %1$s</string>
<string name="MuteDisable">Dauerhaft Stumm</string>
<string name="Hashtags">HASHTAGS</string>
<string name="Recent">LETZTE</string>
<string name="ChatHints">CHATS</string>
@@ -599,9 +597,6 @@
<string name="AlwaysShareWithPlaceholder">Immer teilen mit...</string>
<string name="NeverShareWithTitle">Niemals teilen</string>
<string name="NeverShareWithPlaceholder">Niemals teilen mit...</string>
<string name="EmpryUsersPlaceholder">Hinzufügen</string>
<string name="PrivacyFloodControlError">Du hast zu oft probiert, deine Einstellungen zu ändern; bitte warte kurz.</string>
<string name="ClearOtherSessionsHelp">Alle Geräte außer diesem werden abgemeldet.</string>
<string name="RemoveFromListText">Auf Nutzer tippen und halten um zu löschen.</string>
<string name="GroupsAndChannels">Gruppen</string>
<string name="WhoCanAddMe">Wer kann mich in Gruppen einladen?</string>
@@ -722,10 +717,8 @@
<string name="AreYouSureDeleteContact">Diesen Kontakt wirklich löschen?</string>
<string name="AreYouSureSecretChat">Geheimen Chat starten?</string>
<string name="AreYouSureRegistration">Bist du dir sicher, dass du die Registrierung abbrechen willst?</string>
<string name="AreYouSureClearHistory">Möchtest du wirklich den Verlauf löschen?</string>
<string name="AreYouSureClearHistoryChannel">Cache des Kanals wirklich löschen?</string>
<string name="AreYouSureClearHistorySuper">Cache dieser Gruppe wirklich löschen?</string>
<string name="AreYouSureDeleteMessages">Sicher, dass du %1$s löschen willst?</string>
<string name="AreYouSureClearHistory">Wirklich alle Nachrichten in diesem Chat löschen?\n\nHiermit werden auch die entsprechenden Nachrichten auf dem Server gelöscht.</string>
<string name="AreYouSureDeleteMessages">Wirklich %1$s löschen?\n\nHiermit werden die Nachrichten auch auf dem Server gelöscht.</string>
<string name="SendMessagesToGroup">Nachricht an %1$s senden?</string>
<string name="SendContactToGroup">Kontakt senden an %1$s?</string>
<string name="ForwardMessagesToGroup">Weiterleiten an %1$s?</string>
@@ -922,4 +915,5 @@
<string name="MuteAlways">Dauerhaft stumm</string>
<string name="AskStartChatWith">Chat mit <![CDATA[<b>]]>%1$s<![CDATA[</b>]]> starten?</string>
<string name="StrangersHint">Ein Klick auf die Antwort-Pfeile startet einen Chat.</string>
<string name="NotYetImplemented">Diese Funktion ist in dieser Version noch nicht eingebaut.</string>
</resources>
@@ -45,8 +45,7 @@
<string name="Updating">Actualizando...</string>
<string name="NewSecretChat">Nuevo chat secreto</string>
<string name="ClearHistory">Borrar historial</string>
<string name="ClearHistoryCache">Eliminar de la caché</string>
<string name="DeleteChat">Eliminar y salir</string>
<string name="DeleteChat">Eliminar chat</string>
<string name="DeleteChatUser">Eliminar chat</string>
<string name="HiddenName">Cuenta eliminada</string>
<string name="SelectChat">Elige el chat</string>
@@ -599,9 +598,6 @@
<string name="AlwaysShareWithPlaceholder">Siempre compartir con...</string>
<string name="NeverShareWithTitle">Nunca compartir</string>
<string name="NeverShareWithPlaceholder">Nunca compartir con...</string>
<string name="EmpryUsersPlaceholder">Añadir usuarios</string>
<string name="PrivacyFloodControlError">Lo sentimos, hay demasiadas solicitudes. Es imposible cambiar los ajustes de privacidad ahora. Por favor, espera.</string>
<string name="ClearOtherSessionsHelp">Salir de todos los dispositivos, excepto este.</string>
<string name="RemoveFromListText">Mantén pulsado sobre un usuario para eliminarlo.</string>
<string name="GroupsAndChannels">Grupos</string>
<string name="WhoCanAddMe">¿Quién puede añadirme a grupos?</string>
@@ -723,8 +719,6 @@
<string name="AreYouSureSecretChat">¿Quieres iniciar un chat secreto?</string>
<string name="AreYouSureRegistration">¿Quieres cancelar el registro?</string>
<string name="AreYouSureClearHistory">¿Quieres eliminar el historial?</string>
<string name="AreYouSureClearHistoryChannel">¿Eliminar de la caché los mensajes y multimedia de este canal?</string>
<string name="AreYouSureClearHistorySuper">¿Eliminar de la caché los mensajes y multimedia de este grupo?</string>
<string name="AreYouSureDeleteMessages">¿Quieres eliminar %1$s?</string>
<string name="SendMessagesToGroup">¿Enviar mensajes a %1$s?</string>
<string name="SendContactToGroup">¿Enviar contacto a %1$s?</string>
@@ -45,8 +45,7 @@
<string name="Updating">Aggiorno…</string>
<string name="NewSecretChat">Nuova chat segreta</string>
<string name="ClearHistory">Cancella cronologia</string>
<string name="ClearHistoryCache">Elimina dalla cache</string>
<string name="DeleteChat">Elimina ed esci</string>
<string name="DeleteChat">Elimina chat</string>
<string name="DeleteChatUser">Elimina chat</string>
<string name="HiddenName">Account eliminato</string>
<string name="SelectChat">Seleziona chat</string>
@@ -599,9 +598,6 @@
<string name="AlwaysShareWithPlaceholder">Condividi con gli utenti...</string>
<string name="NeverShareWithTitle">Non condividere</string>
<string name="NeverShareWithPlaceholder">Non condividere con gli utenti...</string>
<string name="EmpryUsersPlaceholder">Aggiungi utenti</string>
<string name="PrivacyFloodControlError">Spiacenti, troppe richieste. Impossibile cambiare le impostazioni di privacy ora, attendi.</string>
<string name="ClearOtherSessionsHelp">Esce da tutti i dispositivi tranne questo.</string>
<string name="RemoveFromListText">Tieni premuto sull\'utente per eliminarlo.</string>
<string name="GroupsAndChannels">Gruppi</string>
<string name="WhoCanAddMe">Chi può aggiungermi ai gruppi?</string>
@@ -723,8 +719,6 @@
<string name="AreYouSureSecretChat">Iniziare una chat segreta?</string>
<string name="AreYouSureRegistration">Sei sicuro di volere eliminare questa registrazione?</string>
<string name="AreYouSureClearHistory">Sei sicuro di volere eliminare la cronologia?</string>
<string name="AreYouSureClearHistoryChannel">Eliminare tutti i testi e i media nella cache per questo canale?</string>
<string name="AreYouSureClearHistorySuper">Eliminare tutti i testi e i media nella cache per questo gruppo?</string>
<string name="AreYouSureDeleteMessages">Sei sicuro di voler eliminare %1$s?</string>
<string name="SendMessagesToGroup">Inviare messaggi a %1$s?</string>
<string name="SendContactToGroup">Inviare contatto a %1$s?</string>
@@ -45,8 +45,7 @@
<string name="Updating">Bijwerken</string>
<string name="NewSecretChat">Nieuwe geheime chat</string>
<string name="ClearHistory">Geschiedenis wissen</string>
<string name="ClearHistoryCache">Cache opschonen</string>
<string name="DeleteChat">Verwijder en verlaat</string>
<string name="DeleteChat">Chat verwijderen</string>
<string name="DeleteChatUser">Chat verwijderen</string>
<string name="HiddenName">Verwijderd account</string>
<string name="SelectChat">Kies een chat</string>
@@ -599,9 +598,6 @@
<string name="AlwaysShareWithPlaceholder">Altijd delen met gebruikers</string>
<string name="NeverShareWithTitle">Nooit delen</string>
<string name="NeverShareWithPlaceholder">Nooit delen met gebruikers</string>
<string name="EmpryUsersPlaceholder">Toevoegen</string>
<string name="PrivacyFloodControlError">Sorry, te veel verzoeken. Momenteel is het niet mogelijk om de privacyinstellingen te wijzigen, even geduld alsjeblieft.</string>
<string name="ClearOtherSessionsHelp">Logt alle apparaten behalve deze uit.</string>
<string name="RemoveFromListText">Gebruiker vasthouden om te verwijderen.</string>
<string name="GroupsAndChannels">Groepen</string>
<string name="WhoCanAddMe">Wie kan me toevoegen aan groepchats?</string>
@@ -723,8 +719,6 @@
<string name="AreYouSureSecretChat">Weet je zeker dat je een geheime chat wilt starten?</string>
<string name="AreYouSureRegistration">Weet je zeker dat je de registratie wilt annuleren?</string>
<string name="AreYouSureClearHistory">Geschiedenis echt wissen? </string>
<string name="AreYouSureClearHistoryChannel">Kanaalcache opschonen?</string>
<string name="AreYouSureClearHistorySuper">Groepscache echt opschonen?</string>
<string name="AreYouSureDeleteMessages">%1$s echt verwijderen?</string>
<string name="SendMessagesToGroup">Berichten naar %1$s versturen?</string>
<string name="SendContactToGroup">Contact delen met %1$s?</string>
@@ -45,8 +45,7 @@
<string name="Updating">Atualizando...</string>
<string name="NewSecretChat">Novo Chat Secreto</string>
<string name="ClearHistory">Limpar histórico</string>
<string name="ClearHistoryCache">Apagar do cache</string>
<string name="DeleteChat">Apagar e sair</string>
<string name="DeleteChat">Apagar conversa</string>
<string name="DeleteChatUser">Apagar conversa</string>
<string name="HiddenName">Conta Excluída</string>
<string name="SelectChat">Selecione um Chat</string>
@@ -599,9 +598,6 @@
<string name="AlwaysShareWithPlaceholder">Sempre compartilhar para os usuários...</string>
<string name="NeverShareWithTitle">Nunca Mostrar</string>
<string name="NeverShareWithPlaceholder">Nunca mostrar para os usuários...</string>
<string name="EmpryUsersPlaceholder">Adicionar Usuários</string>
<string name="PrivacyFloodControlError">Desculpe, muitas solicitações. Impossível alterar os ajustes de privacidade agora, por favor aguarde.</string>
<string name="ClearOtherSessionsHelp">Sair de todos os dispositivos, exceto este.</string>
<string name="RemoveFromListText">Toque e segure no usuário para remover.</string>
<string name="GroupsAndChannels">Grupos</string>
<string name="WhoCanAddMe">Quem pode me adicionar em grupos?</string>
@@ -723,8 +719,6 @@
<string name="AreYouSureSecretChat">Você tem certeza que deseja começar um chat secreto?</string>
<string name="AreYouSureRegistration">Você tem certeza que deseja cancelar o registro?</string>
<string name="AreYouSureClearHistory">Você tem certeza que deseja limpar o histórico?</string>
<string name="AreYouSureClearHistoryChannel">Apagar todos os textos e mídias em cache desse canal?</string>
<string name="AreYouSureClearHistorySuper">Apagar todos os textos e mídias em cache desse grupo?</string>
<string name="AreYouSureDeleteMessages">Você tem certeza que deseja apagar %1$s?</string>
<string name="SendMessagesToGroup">Enviar mensagens para %1$s?</string>
<string name="SendContactToGroup">Enviar contato para %1$s?</string>
+5 -12
View File
@@ -44,9 +44,8 @@
<string name="Connecting">Connecting...</string>
<string name="Updating">Updating...</string>
<string name="NewSecretChat">New Secret Chat</string>
<string name="ClearHistory">Clear history</string>
<string name="ClearHistoryCache">Delete from cache</string>
<string name="DeleteChat">Delete and exit</string>
<string name="ClearHistory">Delete all messages</string>
<string name="DeleteChat">Delete chat</string>
<string name="DeleteChatUser">Delete chat</string>
<string name="HiddenName">Deleted Account</string>
<string name="SelectChat">Select Chat</string>
@@ -57,7 +56,6 @@
<string name="MuteFor">Mute for %1$s</string>
<string name="UnmuteNotifications">Unmute</string>
<string name="WillUnmuteIn">In %1$s</string>
<string name="MuteDisable">Always muted</string>
<string name="Hashtags">HASHTAGS</string>
<string name="Recent">RECENT</string>
<string name="ChatHints">CHATS</string>
@@ -600,9 +598,6 @@
<string name="AlwaysShareWithPlaceholder">Always share with users...</string>
<string name="NeverShareWithTitle">Never Share</string>
<string name="NeverShareWithPlaceholder">Never share with users...</string>
<string name="EmpryUsersPlaceholder">Add Users</string>
<string name="PrivacyFloodControlError">Sorry, too many requests. Unable to change privacy settings now, please wait.</string>
<string name="ClearOtherSessionsHelp">Logs out all devices except for this one.</string>
<string name="RemoveFromListText">Tap and hold on user to delete.</string>
<string name="GroupsAndChannels">Groups</string>
<string name="WhoCanAddMe">Who can add me to group chats?</string>
@@ -723,10 +718,8 @@
<string name="AreYouSureDeleteContact">Are you sure you want to delete this contact?</string>
<string name="AreYouSureSecretChat">Are you sure you want to start a secret chat?</string>
<string name="AreYouSureRegistration">Are you sure you want to cancel registration?</string>
<string name="AreYouSureClearHistory">Are you sure you want to clear history?</string>
<string name="AreYouSureClearHistoryChannel">Delete all cached text and media from this channel?</string>
<string name="AreYouSureClearHistorySuper">Delete all cached text and media from this group?</string>
<string name="AreYouSureDeleteMessages">Are you sure you want to delete %1$s?</string>
<string name="AreYouSureClearHistory">Really delete all messages in this chat?\n\nThis will also delete them on the server</string>
<string name="AreYouSureDeleteMessages">Really delete %1$s?\n\nThis also deletes the messages from the server.</string>
<string name="SendMessagesToGroup">Send messages to %1$s?</string>
<string name="SendContactToGroup">Send contact to %1$s?</string>
<string name="ForwardMessagesToGroup">Forward messages to %1$s?</string>
@@ -920,7 +913,7 @@
<string name="Media">Media</string>
<string name="StrangersInChatlist">Show unknown users in chatlist</string>
<string name="MuteAlways">Always muted</string>
<string name="AskCreateChatByStrangersMsg">Start a chat with the unknown user NAME?</string>
<string name="AskStartChatWith">Start a chat with <![CDATA[<b>]]>%1$s<![CDATA[</b>]]>?</string>
<string name="StrangersHint">To start a chat, click on the reply-arrows.</string>
<string name="NotYetImplemented">This function is not yet available in this version.</string>
</resources>