From ebedf3c367639d43e6d1c63e2529d4d47ff59468 Mon Sep 17 00:00:00 2001 From: DrKLO Date: Wed, 2 Apr 2014 21:36:57 +0400 Subject: [PATCH] Save localization files applyed from document, fixed forwarded name position in group chats, added links to telegram FAQ and support alert message, move all menus creation to code for localization purposes --- TMessagesProj/build.gradle | 2 +- .../messenger/ConnectionsManager.java | 2 +- .../org/telegram/messenger/Datacenter.java | 6 +- .../telegram/messenger/LocaleController.java | 199 +++++++++++++---- .../telegram/ui/Cells/ChatMessageCell.java | 2 +- .../java/org/telegram/ui/ChatActivity.java | 93 ++++++-- .../org/telegram/ui/ChatProfileActivity.java | 26 ++- .../org/telegram/ui/ContactsActivity.java | 8 +- .../telegram/ui/CountrySelectActivity.java | 9 +- .../telegram/ui/DocumentSelectActivity.java | 2 +- .../org/telegram/ui/GalleryImageViewer.java | 16 +- .../org/telegram/ui/GroupCreateActivity.java | 6 +- .../telegram/ui/GroupCreateFinalActivity.java | 6 +- .../telegram/ui/LanguageSelectActivity.java | 66 +++++- .../org/telegram/ui/LocationActivity.java | 21 +- .../java/org/telegram/ui/LoginActivity.java | 8 +- .../org/telegram/ui/MessagesActivity.java | 42 +++- .../org/telegram/ui/SettingsActivity.java | 210 ++++++++++-------- .../org/telegram/ui/SettingsBlockedUsers.java | 9 +- .../org/telegram/ui/UserProfileActivity.java | 26 ++- .../src/main/res/menu/chat_enc_menu.xml | 50 ----- TMessagesProj/src/main/res/menu/chat_menu.xml | 45 ---- .../src/main/res/menu/contacts_menu.xml | 12 - .../src/main/res/menu/gallery_menu.xml | 14 -- .../main/res/menu/gallery_save_only_menu.xml | 8 - .../src/main/res/menu/group_create_menu.xml | 10 - .../src/main/res/menu/group_profile_menu.xml | 10 - .../src/main/res/menu/location_menu.xml | 23 -- .../res/menu/messages_deleteonly_menu.xml | 9 - .../main/res/menu/messages_encrypted_menu.xml | 14 -- .../src/main/res/menu/messages_full_menu.xml | 19 -- .../src/main/res/menu/messages_list_menu.xml | 38 ---- .../res/menu/messages_list_select_menu.xml | 12 - .../menu/settings_block_users_bar_menu.xml | 10 - .../main/res/menu/user_profile_block_menu.xml | 8 - .../res/menu/user_profile_contact_menu.xml | 18 -- .../src/main/res/menu/user_profile_menu.xml | 12 - .../src/main/res/values-ar/strings.xml | 6 + .../src/main/res/values-de/strings.xml | 6 + .../src/main/res/values-es/strings.xml | 6 + .../src/main/res/values-it/strings.xml | 6 + .../src/main/res/values-nl/strings.xml | 6 + TMessagesProj/src/main/res/values/strings.xml | 6 + 43 files changed, 563 insertions(+), 544 deletions(-) delete mode 100644 TMessagesProj/src/main/res/menu/chat_enc_menu.xml delete mode 100644 TMessagesProj/src/main/res/menu/chat_menu.xml delete mode 100644 TMessagesProj/src/main/res/menu/contacts_menu.xml delete mode 100644 TMessagesProj/src/main/res/menu/gallery_menu.xml delete mode 100644 TMessagesProj/src/main/res/menu/gallery_save_only_menu.xml delete mode 100644 TMessagesProj/src/main/res/menu/group_create_menu.xml delete mode 100644 TMessagesProj/src/main/res/menu/group_profile_menu.xml delete mode 100644 TMessagesProj/src/main/res/menu/location_menu.xml delete mode 100644 TMessagesProj/src/main/res/menu/messages_deleteonly_menu.xml delete mode 100644 TMessagesProj/src/main/res/menu/messages_encrypted_menu.xml delete mode 100644 TMessagesProj/src/main/res/menu/messages_full_menu.xml delete mode 100644 TMessagesProj/src/main/res/menu/messages_list_menu.xml delete mode 100644 TMessagesProj/src/main/res/menu/messages_list_select_menu.xml delete mode 100644 TMessagesProj/src/main/res/menu/settings_block_users_bar_menu.xml delete mode 100644 TMessagesProj/src/main/res/menu/user_profile_block_menu.xml delete mode 100644 TMessagesProj/src/main/res/menu/user_profile_contact_menu.xml delete mode 100644 TMessagesProj/src/main/res/menu/user_profile_menu.xml diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index d5d58ec1..5083c5c4 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -82,7 +82,7 @@ android { defaultConfig { minSdkVersion 8 targetSdkVersion 19 - versionCode 215 + versionCode 217 versionName "1.4.9" } } diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/ConnectionsManager.java b/TMessagesProj/src/main/java/org/telegram/messenger/ConnectionsManager.java index 4810aaaf..5916d036 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/ConnectionsManager.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/ConnectionsManager.java @@ -649,7 +649,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection. if (phone.startsWith("968")) { for (HashMap.Entry entry : datacenters.entrySet()) { Datacenter datacenter = entry.getValue(); - datacenter.overridePort = 14; + datacenter.overridePort = 8888; if (datacenter.connection != null) { datacenter.connection.suspendConnection(true); } diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/Datacenter.java b/TMessagesProj/src/main/java/org/telegram/messenger/Datacenter.java index ff979851..2bdce85d 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/Datacenter.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/Datacenter.java @@ -25,7 +25,7 @@ public class Datacenter { public ArrayList addresses = new ArrayList(); public HashMap ports = new HashMap(); public int[] defaultPorts = new int[] {-1, 80, -1, 443, -1, 443, -1, 80, -1, 443, -1}; - public int[] defaultPorts14 = new int[] {-1, 14, -1, 443, -1, 14, -1, 80, -1, 14, -1}; + public int[] defaultPorts8888 = new int[] {-1, 8888, -1, 443, -1, 8888, -1, 80, -1, 8888, -1}; public boolean authorized; public long authSessionId; public long authDownloadSessionId; @@ -136,8 +136,8 @@ public class Datacenter { int[] portsArray = defaultPorts; - if (overridePort == 14) { - portsArray = defaultPorts14; + if (overridePort == 8888) { + portsArray = defaultPorts8888; } if (currentPortNum >= defaultPorts.length) { diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/LocaleController.java b/TMessagesProj/src/main/java/org/telegram/messenger/LocaleController.java index a63051c0..5ff6a5fa 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/LocaleController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/LocaleController.java @@ -42,6 +42,7 @@ public class LocaleController { private Locale currentLocale; private Locale systemDefaultLocale; private LocaleInfo currentLocaleInfo; + private LocaleInfo defaultLocalInfo; private HashMap localeValues = new HashMap(); private String languageOverride; private boolean changingConfiguration = false; @@ -50,12 +51,34 @@ public class LocaleController { public String name; public String nameEnglish; public String shortName; - public boolean embededLang; + public String pathToFile; + + public String getSaveString() { + return name + "|" + nameEnglish + "|" + shortName + "|" + pathToFile; + } + + public static LocaleInfo createWithString(String string) { + if (string == null || string.length() == 0) { + return null; + } + String[] args = string.split("\\|"); + if (args.length != 4) { + return null; + } + LocaleInfo localeInfo = new LocaleInfo(); + localeInfo.name = args[0]; + localeInfo.nameEnglish = args[1]; + localeInfo.shortName = args[2]; + localeInfo.pathToFile = args[3]; + return localeInfo; + } } public ArrayList sortedLanguages = new ArrayList(); public HashMap languagesDict = new HashMap(); + private ArrayList otherLanguages = new ArrayList(); + private static volatile LocaleController Instance = null; public static LocaleController getInstance() { LocaleController localInstance = Instance; @@ -75,7 +98,7 @@ public class LocaleController { localeInfo.name = "English"; localeInfo.nameEnglish = "English"; localeInfo.shortName = "en"; - localeInfo.embededLang = true; + localeInfo.pathToFile = null; sortedLanguages.add(localeInfo); languagesDict.put(localeInfo.shortName, localeInfo); @@ -83,7 +106,7 @@ public class LocaleController { localeInfo.name = "Italiano"; localeInfo.nameEnglish = "Italian"; localeInfo.shortName = "it"; - localeInfo.embededLang = true; + localeInfo.pathToFile = null; sortedLanguages.add(localeInfo); languagesDict.put(localeInfo.shortName, localeInfo); @@ -98,7 +121,7 @@ public class LocaleController { localeInfo.name = "Deutsch"; localeInfo.nameEnglish = "German"; localeInfo.shortName = "de"; - localeInfo.embededLang = true; + localeInfo.pathToFile = null; sortedLanguages.add(localeInfo); languagesDict.put(localeInfo.shortName, localeInfo); @@ -106,7 +129,7 @@ public class LocaleController { localeInfo.name = "Nederlands"; localeInfo.nameEnglish = "Dutch"; localeInfo.shortName = "nl"; - localeInfo.embededLang = true; + localeInfo.pathToFile = null; sortedLanguages.add(localeInfo); languagesDict.put(localeInfo.shortName, localeInfo); @@ -114,10 +137,17 @@ public class LocaleController { localeInfo.name = "العربية"; localeInfo.nameEnglish = "Arabic"; localeInfo.shortName = "ar"; - localeInfo.embededLang = true; + localeInfo.pathToFile = null; sortedLanguages.add(localeInfo); languagesDict.put(localeInfo.shortName, localeInfo); + loadOtherLanguages(); + + for (LocaleInfo locale : otherLanguages) { + sortedLanguages.add(locale); + languagesDict.put(locale.shortName, locale); + } + Collections.sort(sortedLanguages, new Comparator() { @Override public int compare(LocaleController.LocaleInfo o, LocaleController.LocaleInfo o2) { @@ -125,11 +155,11 @@ public class LocaleController { } }); - localeInfo = new LocaleController.LocaleInfo(); + defaultLocalInfo = localeInfo = new LocaleController.LocaleInfo(); localeInfo.name = "System default"; localeInfo.nameEnglish = "System default"; localeInfo.shortName = null; - localeInfo.embededLang = true; + localeInfo.pathToFile = null; sortedLanguages.add(0, localeInfo); systemDefaultLocale = Locale.getDefault(); @@ -160,6 +190,117 @@ public class LocaleController { } public boolean applyLanguageFile(File file) { + try { + HashMap stringMap = getLocaleFileStrings(file); + + String languageName = stringMap.get("LanguageName"); + String languageNameInEnglish = stringMap.get("LanguageNameInEnglish"); + String languageCode = stringMap.get("LanguageCode"); + + if (languageName != null && languageName.length() > 0 && + languageNameInEnglish != null && languageNameInEnglish.length() > 0 && + languageCode != null && languageCode.length() > 0) { + + if (languageName.contains("&") || languageName.contains("|")) { + return false; + } + if (languageNameInEnglish.contains("&") || languageNameInEnglish.contains("|")) { + return false; + } + if (languageCode.contains("&") || languageCode.contains("|")) { + return false; + } + + File finalFile = new File(ApplicationLoader.applicationContext.getFilesDir(), languageCode + ".xml"); + if (!Utilities.copyFile(file, finalFile)) { + return false; + } + + LocaleInfo localeInfo = languagesDict.get(languageCode); + if (localeInfo == null) { + localeInfo = new LocaleInfo(); + localeInfo.name = languageName; + localeInfo.nameEnglish = languageNameInEnglish; + localeInfo.shortName = languageCode; + + localeInfo.pathToFile = finalFile.getAbsolutePath(); + sortedLanguages.add(localeInfo); + languagesDict.put(localeInfo.shortName, localeInfo); + otherLanguages.add(localeInfo); + + Collections.sort(sortedLanguages, new Comparator() { + @Override + public int compare(LocaleController.LocaleInfo o, LocaleController.LocaleInfo o2) { + if (o.shortName == null) { + return -1; + } else if (o2.shortName == null) { + return 1; + } + return o.name.compareTo(o2.name); + } + }); + saveOtherLanguages(); + } + localeValues = stringMap; + applyLanguage(localeInfo, true, true); + return true; + } + } catch (Exception e) { + FileLog.e("tmessages", e); + } + return false; + } + + private void saveOtherLanguages() { + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("langconfig", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = preferences.edit(); + String locales = ""; + for (LocaleInfo localeInfo : otherLanguages) { + String loc = localeInfo.getSaveString(); + if (loc != null) { + if (locales.length() != 0) { + locales += "&"; + } + locales += loc; + } + } + editor.putString("locales", locales); + editor.commit(); + } + + public boolean deleteLanguage(LocaleInfo localeInfo) { + if (localeInfo.pathToFile == null) { + return false; + } + if (currentLocaleInfo == localeInfo) { + applyLanguage(defaultLocalInfo, true); + } + + otherLanguages.remove(localeInfo); + sortedLanguages.remove(localeInfo); + languagesDict.remove(localeInfo.shortName); + File file = new File(localeInfo.pathToFile); + file.delete(); + saveOtherLanguages(); + return true; + } + + private void loadOtherLanguages() { + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("langconfig", Activity.MODE_PRIVATE); + String locales = preferences.getString("locales", null); + if (locales == null || locales.length() == 0) { + return; + } + String[] localesArr = locales.split("&"); + for (String locale : localesArr) { + LocaleInfo localeInfo = LocaleInfo.createWithString(locale); + if (localeInfo != null) { + otherLanguages.add(localeInfo); + } + } + } + + private HashMap getLocaleFileStrings(File file) { try { HashMap stringMap = new HashMap(); XmlPullParser parser = Xml.newPullParser(); @@ -192,44 +333,18 @@ public class LocaleController { } eventType = parser.next(); } - - String languageName = stringMap.get("LanguageName"); - String languageNameInEnglish = stringMap.get("LanguageNameInEnglish"); - String languageCode = stringMap.get("LanguageCode"); - - if (languageName != null && languageName.length() > 0 && - languageNameInEnglish != null && languageNameInEnglish.length() > 0 && - languageCode != null && languageCode.length() > 0) { - LocaleInfo localeInfo = new LocaleInfo(); - localeInfo.name = languageName; - localeInfo.nameEnglish = languageNameInEnglish; - localeInfo.shortName = languageCode; - localeInfo.embededLang = false; - sortedLanguages.add(localeInfo); - languagesDict.put(localeInfo.shortName, localeInfo); - - Collections.sort(sortedLanguages, new Comparator() { - @Override - public int compare(LocaleController.LocaleInfo o, LocaleController.LocaleInfo o2) { - if (o.shortName == null) { - return -1; - } else if (o2.shortName == null) { - return 1; - } - return o.name.compareTo(o2.name); - } - }); - applyLanguage(localeInfo, true); - localeValues = stringMap; - return true; - } + return stringMap; } catch (Exception e) { FileLog.e("tmessages", e); } - return false; + return null; } public void applyLanguage(LocaleInfo localeInfo, boolean override) { + applyLanguage(localeInfo, override, false); + } + + public void applyLanguage(LocaleInfo localeInfo, boolean override, boolean fromFile) { if (localeInfo == null) { return; } @@ -256,8 +371,10 @@ public class LocaleController { editor.commit(); } if (newLocale != null) { - if (localeInfo.embededLang) { + if (localeInfo.pathToFile == null) { localeValues.clear(); + } else if (!fromFile) { + localeValues = getLocaleFileStrings(new File(localeInfo.pathToFile)); } currentLocale = newLocale; currentLocaleInfo = localeInfo; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java index 517f7f07..3055cddc 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatMessageCell.java @@ -131,7 +131,7 @@ public class ChatMessageCell extends ChatBaseCell { } pressedLink = null; int maxWidth; - if (isChat) { + if (isChat && !messageObject.messageOwner.out) { maxWidth = Utilities.displaySize.x - Utilities.dp(122); drawName = true; } else { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index bc6fff28..442cc4b3 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -46,6 +46,7 @@ import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.MotionEvent; +import android.view.SubMenu; import android.view.Surface; import android.view.View; import android.view.ViewGroup; @@ -197,6 +198,18 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa private CharSequence lastPrintString; + private final static int copy = 1; + private final static int forward = 2; + private final static int delete = 3; + private final static int chat_enc_timer = 4; + private final static int chat_menu_attach = 5; + private final static int attach_photo = 6; + private final static int attach_gallery = 7; + private final static int attach_video = 8; + private final static int attach_document = 9; + private final static int attach_location = 10; + private final static int chat_menu_avatar = 11; + ActionMode mActionMode = null; private ActionMode.Callback mActionModeCallback = new ActionMode.Callback() { @Override @@ -204,11 +217,14 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa menu.clear(); MenuInflater inflater = actionMode.getMenuInflater(); if (currentEncryptedChat == null) { - inflater.inflate(R.menu.messages_full_menu, menu); + menu.add(Menu.NONE, copy, Menu.NONE, LocaleController.getString("Copy", R.string.Copy)).setIcon(R.drawable.ic_ab_fwd_copy); + menu.add(Menu.NONE, forward, Menu.NONE, LocaleController.getString("Forward", R.string.Forward)).setIcon(R.drawable.ic_ab_fwd_forward); + menu.add(Menu.NONE, delete, Menu.NONE, LocaleController.getString("Delete", R.string.Delete)).setIcon(R.drawable.ic_ab_fwd_delete); } else { - inflater.inflate(R.menu.messages_encrypted_menu, menu); + menu.add(Menu.NONE, copy, Menu.NONE, LocaleController.getString("Copy", R.string.Copy)).setIcon(R.drawable.ic_ab_fwd_copy); + menu.add(Menu.NONE, delete, Menu.NONE, LocaleController.getString("Delete", R.string.Delete)).setIcon(R.drawable.ic_ab_fwd_delete); } - menu.findItem(R.id.copy).setVisible(selectedMessagesCanCopyIds.size() != 0); + menu.findItem(copy).setVisible(selectedMessagesCanCopyIds.size() != 0); return true; } @@ -220,7 +236,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa @Override public boolean onActionItemClicked(ActionMode actionMode, MenuItem menuItem) { switch (menuItem.getItemId()) { - case R.id.copy: { + case copy: { String str = ""; ArrayList ids = new ArrayList(selectedMessagesCanCopyIds.keySet()); if (currentEncryptedChat == null) { @@ -247,7 +263,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } break; } - case R.id.delete: { + case delete: { ArrayList ids = new ArrayList(selectedMessagesIds.keySet()); ArrayList random_ids = null; if (currentEncryptedChat != null) { @@ -262,7 +278,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa MessagesController.getInstance().deleteMessages(ids, random_ids, currentEncryptedChat); break; } - case R.id.forward: { + case forward: { MessagesActivity fragment = new MessagesActivity(); fragment.selectAlertString = R.string.ForwardMessagesTo; fragment.selectAlertStringDesc = "ForwardMessagesTo"; @@ -1250,7 +1266,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaDocument) { String mime = messageObject.messageOwner.media.document.mime_type; if (mime != null && mime.equals("text/xml")) { - return 4; + return 5; } } return 4; @@ -1294,7 +1310,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaDocument) { String mime = messageObject.messageOwner.media.document.mime_type; if (mime != null && mime.equals("text/xml")) { - return 4; + return 5; } } //return 4; @@ -1321,7 +1337,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } } if (mActionMode != null && mActionMode.getMenu() != null) { - mActionMode.getMenu().findItem(R.id.copy).setVisible(selectedMessagesCanCopyIds.size() != 0); + mActionMode.getMenu().findItem(copy).setVisible(selectedMessagesCanCopyIds.size() != 0); } } @@ -2745,16 +2761,32 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { menu.clear(); + + SupportMenuItem timeItem = null; + if (currentEncryptedChat != null) { - inflater.inflate(R.menu.chat_enc_menu, menu); - } else { - inflater.inflate(R.menu.chat_menu, menu); + timeItem = (SupportMenuItem)menu.add(Menu.NONE, chat_enc_timer, Menu.NONE, null); + timeItem.setShowAsAction(SupportMenuItem.SHOW_AS_ACTION_ALWAYS); + timeItem.setActionView(R.layout.chat_header_enc_layout); } - SupportMenuItem timeItem = (SupportMenuItem)menu.findItem(R.id.chat_enc_timer); + + SubMenu subMenu = menu.addSubMenu(Menu.NONE, chat_menu_attach, Menu.NONE, LocaleController.getString("Attach", R.string.Attach)).setIcon(R.drawable.ic_ab_attach); + SupportMenuItem menuItem = (SupportMenuItem)subMenu.getItem(); + menuItem.setShowAsAction(SupportMenuItem.SHOW_AS_ACTION_ALWAYS); + + subMenu.add(Menu.NONE, attach_photo, Menu.NONE, LocaleController.getString("ChatTakePhoto", R.string.ChatTakePhoto)).setIcon(R.drawable.ic_attach_photo); + subMenu.add(Menu.NONE, attach_gallery, Menu.NONE, LocaleController.getString("ChatGallery", R.string.ChatGallery)).setIcon(R.drawable.ic_attach_gallery); + subMenu.add(Menu.NONE, attach_video, Menu.NONE, LocaleController.getString("ChatVideo", R.string.ChatVideo)).setIcon(R.drawable.ic_attach_video); + subMenu.add(Menu.NONE, attach_document, Menu.NONE, LocaleController.getString("ChatDocument", R.string.ChatDocument)).setIcon(R.drawable.ic_ab_doc); + subMenu.add(Menu.NONE, attach_location, Menu.NONE, LocaleController.getString("ChatLocation", R.string.ChatLocation)).setIcon(R.drawable.ic_attach_location); + + SupportMenuItem avatarItem = (SupportMenuItem)menu.add(Menu.NONE, chat_menu_avatar, Menu.NONE, null); + avatarItem.setShowAsAction(SupportMenuItem.SHOW_AS_ACTION_ALWAYS); + avatarItem.setActionView(R.layout.chat_header_layout); + if (currentEncryptedChat != null && !(currentEncryptedChat instanceof TLRPC.TL_encryptedChat) || currentChat != null && (currentChat instanceof TLRPC.TL_chatForbidden || currentChat.left)) { - SupportMenuItem item = (SupportMenuItem)menu.findItem(R.id.chat_menu_attach); - if (item != null) { - item.setVisible(false); + if (menuItem != null) { + menuItem.setVisible(false); } if (timeItem != null) { @@ -2810,7 +2842,6 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa timerButton.setTime(currentEncryptedChat.ttl); } - SupportMenuItem avatarItem = (SupportMenuItem)menu.findItem(R.id.chat_menu_avatar); View avatarLayout = avatarItem.getActionView(); avatarImageView = (BackupImageView)avatarLayout.findViewById(R.id.chat_avatar_image); @@ -3040,6 +3071,20 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa if (locFile != null) { if (LocaleController.getInstance().applyLanguageFile(locFile)) { ((LaunchActivity)parentActivity).presentFragment(new LanguageSelectActivity(), "settings_lang", false); + } else if (parentActivity != null) { + AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity); + builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); + builder.setMessage(LocaleController.getString("IncorrectLocalization", R.string.IncorrectLocalization)); + builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null); + visibleDialog = builder.show(); + visibleDialog.setCanceledOnTouchOutside(true); + + visibleDialog.setOnDismissListener(new DialogInterface.OnDismissListener() { + @Override + public void onDismiss(DialogInterface dialog) { + visibleDialog = null; + } + }); } } } @@ -3047,7 +3092,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } }); - builder.setTitle(R.string.Message); + builder.setTitle(LocaleController.getString("Message", R.string.Message)); visibleDialog = builder.show(); visibleDialog.setCanceledOnTouchOutside(true); @@ -3290,7 +3335,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa case android.R.id.home: finishFragment(); break; - case R.id.attach_photo: { + case attach_photo: { try { Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); File image = Utilities.generatePicturePath(); @@ -3304,7 +3349,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } break; } - case R.id.attach_gallery: { + case attach_gallery: { try { Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); photoPickerIntent.setType("image/*"); @@ -3314,7 +3359,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } break; } - case R.id.attach_video: { + case attach_video: { try { Intent pickIntent = new Intent(); pickIntent.setType("video/*"); @@ -3338,7 +3383,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } break; } - case R.id.attach_location: { + case attach_location: { if (!isGoogleMapsInstalled()) { return true; } @@ -3346,7 +3391,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ((LaunchActivity)parentActivity).presentFragment(fragment, "location", false); break; } - case R.id.attach_document: { + case attach_document: { DocumentSelectActivity fragment = new DocumentSelectActivity(); fragment.delegate = this; ((LaunchActivity)parentActivity).presentFragment(fragment, "document", false); @@ -4404,7 +4449,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa private void alertUserOpenError() { AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity); - builder.setTitle(R.string.AppName); + builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); builder.setPositiveButton(R.string.OK, null); if (message.type == 6 || message.type == 7) { builder.setMessage(R.string.NoPlayerInstalled); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java index 5043ea42..2d55257e 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java @@ -22,6 +22,7 @@ import android.os.Bundle; import android.provider.Settings; import android.support.v4.internal.view.SupportMenuItem; import android.support.v7.app.ActionBar; +import android.support.v7.widget.SearchView; import android.text.Html; import android.view.LayoutInflater; import android.view.Menu; @@ -483,16 +484,21 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { - inflater.inflate(R.menu.group_profile_menu, menu); - SupportMenuItem doneItem = (SupportMenuItem)menu.findItem(R.id.block_user); - TextView doneTextView = (TextView)doneItem.getActionView().findViewById(R.id.done_button); - doneTextView.setText(LocaleController.getString("AddMember", R.string.AddMember)); - doneTextView.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - openAddMenu(); - } - }); + SupportMenuItem item = (SupportMenuItem)menu.add(Menu.NONE, 0, Menu.NONE, LocaleController.getString("AddMember", R.string.AddMember)); + item.setShowAsAction(SupportMenuItem.SHOW_AS_ACTION_ALWAYS); + LayoutInflater li = (LayoutInflater)ApplicationLoader.applicationContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + item.setActionView(R.layout.group_profile_add_member_layout); + + TextView textView = (TextView)item.getActionView().findViewById(R.id.done_button); + if (textView != null) { + textView.setText(LocaleController.getString("AddMember", R.string.AddMember)); + textView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + openAddMenu(); + } + }); + } } private class ListAdapter extends BaseAdapter { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java index 61d29c26..a5fe2b81 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java @@ -306,7 +306,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter private void didSelectResult(final TLRPC.User user, boolean useAlert) { if (useAlert && selectAlertString != 0) { AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity); - builder.setTitle(R.string.AppName); + builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); builder.setMessage(LocaleController.formatString(selectAlertStringDesc, selectAlertString, Utilities.formatName(user.first_name, user.last_name))); builder.setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() { @Override @@ -400,9 +400,9 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); - inflater.inflate(R.menu.contacts_menu, menu); - searchItem = (SupportMenuItem)menu.findItem(R.id.messages_list_menu_search); - searchView = (SearchView)searchItem.getActionView(); + searchItem = (SupportMenuItem)menu.add(Menu.NONE, 0, Menu.NONE, LocaleController.getString("Search", R.string.Search)).setIcon(R.drawable.ic_ab_search); + searchItem.setShowAsAction(SupportMenuItem.SHOW_AS_ACTION_ALWAYS|SupportMenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW); + searchItem.setActionView(searchView = new SearchView(parentActivity)); TextView textView = (TextView) searchView.findViewById(R.id.search_src_text); if (textView != null) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/CountrySelectActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/CountrySelectActivity.java index 1c914a0d..23f58c30 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/CountrySelectActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/CountrySelectActivity.java @@ -19,7 +19,6 @@ import android.support.v7.app.ActionBarActivity; import android.support.v7.widget.SearchView; import android.view.LayoutInflater; import android.view.Menu; -import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; @@ -191,11 +190,9 @@ public class CountrySelectActivity extends ActionBarActivity { @Override public boolean onCreateOptionsMenu(Menu menu) { - MenuInflater inflater = getMenuInflater(); - - inflater.inflate(R.menu.contacts_menu, menu); - searchItem = (SupportMenuItem)menu.findItem(R.id.messages_list_menu_search); - searchView = (SearchView)searchItem.getActionView(); + searchItem = (SupportMenuItem)menu.add(Menu.NONE, 0, Menu.NONE, LocaleController.getString("Search", R.string.Search)).setIcon(R.drawable.ic_ab_search); + searchItem.setShowAsAction(SupportMenuItem.SHOW_AS_ACTION_ALWAYS|SupportMenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW); + searchItem.setActionView(searchView = new SearchView(this)); TextView textView = (TextView) searchView.findViewById(R.id.search_src_text); if (textView != null) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/DocumentSelectActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/DocumentSelectActivity.java index 9fde8ddc..9d7cab97 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/DocumentSelectActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/DocumentSelectActivity.java @@ -345,7 +345,7 @@ public class DocumentSelectActivity extends BaseFragment { private void showErrorBox(String error){ new AlertDialog.Builder(parentActivity) - .setTitle(R.string.AppName) + .setTitle(LocaleController.getString("AppName", R.string.AppName)) .setMessage(error) .setPositiveButton(R.string.OK, null) .show(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/GalleryImageViewer.java b/TMessagesProj/src/main/java/org/telegram/ui/GalleryImageViewer.java index 6548dc71..1caf0d20 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/GalleryImageViewer.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/GalleryImageViewer.java @@ -18,7 +18,6 @@ import android.support.v4.view.ViewPager; import android.support.v7.app.ActionBar; import android.view.Display; import android.view.Menu; -import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; @@ -82,6 +81,9 @@ public class GalleryImageViewer extends AbstractGalleryActivity implements Notif public static int needShowAllMedia = 2000; + private final static int gallery_menu_save = 1; + private final static int gallery_menu_showall = 2; + @SuppressWarnings("unchecked") @Override public void onCreate(Bundle savedInstanceState) { @@ -640,11 +642,9 @@ public class GalleryImageViewer extends AbstractGalleryActivity implements Notif @Override public boolean onCreateOptionsMenu(Menu menu) { - MenuInflater inflater = getMenuInflater(); - if (withoutBottom) { - inflater.inflate(R.menu.gallery_save_only_menu, menu); - } else { - inflater.inflate(R.menu.gallery_menu, menu); + menu.add(Menu.NONE, gallery_menu_save, Menu.NONE, LocaleController.getString("SaveToGallery", R.string.SaveToGallery)); + if (!withoutBottom) { + menu.add(Menu.NONE, gallery_menu_showall, Menu.NONE, LocaleController.getString("ShowAllMedia", R.string.ShowAllMedia)); } return super.onCreateOptionsMenu(menu); } @@ -721,7 +721,7 @@ public class GalleryImageViewer extends AbstractGalleryActivity implements Notif finish(); System.gc(); break; - case R.id.gallery_menu_save: + case gallery_menu_save: if (currentFileName == null) { return; } @@ -737,7 +737,7 @@ public class GalleryImageViewer extends AbstractGalleryActivity implements Notif // startActivityForResult(intent, 10); // break; // } - case R.id.gallery_menu_showall: { + case gallery_menu_showall: { if (fromAll) { finish(); } else { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java index 76f984ef..c550918f 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java @@ -421,8 +421,10 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { - inflater.inflate(R.menu.group_create_menu, menu); - SupportMenuItem doneItem = (SupportMenuItem)menu.findItem(R.id.done_menu_item); + SupportMenuItem doneItem = (SupportMenuItem)menu.add(Menu.NONE, 0, Menu.NONE, null); + doneItem.setShowAsAction(SupportMenuItem.SHOW_AS_ACTION_ALWAYS); + doneItem.setActionView(R.layout.group_create_done_layout); + TextView doneTextView = (TextView)doneItem.getActionView().findViewById(R.id.done_button); doneTextView.setText(LocaleController.getString("Next", R.string.Next)); doneTextView.setOnClickListener(new View.OnClickListener() { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java index 23c6c091..86a986c2 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java @@ -274,8 +274,10 @@ public class GroupCreateFinalActivity extends BaseFragment implements Notificati @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { - inflater.inflate(R.menu.group_create_menu, menu); - SupportMenuItem doneItem = (SupportMenuItem)menu.findItem(R.id.done_menu_item); + SupportMenuItem doneItem = (SupportMenuItem)menu.add(Menu.NONE, 0, Menu.NONE, null); + doneItem.setShowAsAction(SupportMenuItem.SHOW_AS_ACTION_ALWAYS); + doneItem.setActionView(R.layout.group_create_done_layout); + TextView doneTextView = (TextView)doneItem.getActionView().findViewById(R.id.done_button); doneTextView.setText(LocaleController.getString("Done", R.string.Done)); doneTextView.setOnClickListener(new View.OnClickListener() { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java index 76e83756..fa6cf2dc 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java @@ -8,7 +8,9 @@ package org.telegram.ui; +import android.app.AlertDialog; import android.content.Context; +import android.content.DialogInterface; import android.os.Bundle; import android.support.v4.internal.view.SupportMenuItem; import android.support.v4.view.MenuItemCompat; @@ -114,10 +116,62 @@ public class LanguageSelectActivity extends BaseFragment { } } } + if (searchItem != null && searchItem.isActionViewExpanded()) { + searchItem.collapseActionView(); + } finishFragment(); } }); + listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { + @Override + public boolean onItemLongClick(AdapterView adapterView, View view, int i, long l) { + if (parentActivity == null) { + return false; + } + LocaleController.LocaleInfo localeInfo = null; + if (searching && searchWas) { + if (i >= 0 && i < searchResult.size()) { + localeInfo = searchResult.get(i); + } + } else { + if (i >= 0 && i < LocaleController.getInstance().sortedLanguages.size()) { + localeInfo = LocaleController.getInstance().sortedLanguages.get(i); + } + } + if (localeInfo == null || localeInfo.pathToFile == null) { + return false; + } + final LocaleController.LocaleInfo finalLocaleInfo = localeInfo; + AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity); + builder.setMessage(LocaleController.getString("DeleteLocalization", R.string.DeleteLocalization)); + builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); + builder.setPositiveButton(LocaleController.getString("Delete", R.string.Delete), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + if (LocaleController.getInstance().deleteLanguage(finalLocaleInfo)) { + if (searchResult != null) { + searchResult.remove(finalLocaleInfo); + } + if (listAdapter != null) { + listAdapter.notifyDataSetChanged(); + } + if (searchListViewAdapter != null) { + searchListViewAdapter.notifyDataSetChanged(); + } + applySelfActionBar(); + if (searchItem != null && searchItem.isActionViewExpanded()) { + searchItem.collapseActionView(); + } + } + } + }); + builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); + builder.show().setCanceledOnTouchOutside(true); + return true; + } + }); + listView.setOnTouchListener(new OnSwipeTouchListener() { public void onSwipeRight() { finishFragment(true); @@ -184,10 +238,8 @@ public class LanguageSelectActivity extends BaseFragment { int itemId = item.getItemId(); switch (itemId) { case android.R.id.home: - if (searchItem != null) { - if (searchItem.isActionViewExpanded()) { - searchItem.collapseActionView(); - } + if (searchItem != null && searchItem.isActionViewExpanded()) { + searchItem.collapseActionView(); } finishFragment(); break; @@ -197,9 +249,9 @@ public class LanguageSelectActivity extends BaseFragment { @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { - inflater.inflate(R.menu.contacts_menu, menu); - searchItem = (SupportMenuItem)menu.findItem(R.id.messages_list_menu_search); - searchView = (SearchView)searchItem.getActionView(); + searchItem = (SupportMenuItem)menu.add(Menu.NONE, 0, Menu.NONE, LocaleController.getString("Search", R.string.Search)).setIcon(R.drawable.ic_ab_search); + searchItem.setShowAsAction(SupportMenuItem.SHOW_AS_ACTION_ALWAYS|SupportMenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW); + searchItem.setActionView(searchView = new SearchView(parentActivity)); TextView textView = (TextView) searchView.findViewById(R.id.search_src_text); if (textView != null) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java index ede48dd2..37dc07ec 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java @@ -10,6 +10,7 @@ package org.telegram.ui; import android.location.Location; import android.os.Bundle; +import android.support.v4.internal.view.SupportMenuItem; import android.support.v7.app.ActionBar; import android.view.LayoutInflater; import android.view.Menu; @@ -53,6 +54,11 @@ public class LocationActivity extends BaseFragment implements NotificationCenter private boolean userLocationMoved = false; private boolean firstWas = false; + private final static int map_to_my_location = 1; + private final static int map_list_menu_map = 2; + private final static int map_list_menu_satellite = 3; + private final static int map_list_menu_hybrid = 4; + public SupportMapFragment mapFragment = new SupportMapFragment() { @Override public void onActivityCreated(Bundle savedInstanceState) { @@ -261,29 +267,34 @@ public class LocationActivity extends BaseFragment implements NotificationCenter @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { - inflater.inflate(R.menu.location_menu, menu); + SupportMenuItem item = (SupportMenuItem)menu.add(Menu.NONE, map_to_my_location, Menu.NONE, LocaleController.getString("MyLocation", R.string.MyLocation)).setIcon(R.drawable.ic_ab_location); + item.setShowAsAction(SupportMenuItem.SHOW_AS_ACTION_ALWAYS); + + menu.add(Menu.NONE, map_list_menu_map, Menu.NONE, LocaleController.getString("Map", R.string.Map)); + menu.add(Menu.NONE, map_list_menu_satellite, Menu.NONE, LocaleController.getString("Satellite", R.string.Satellite)); + menu.add(Menu.NONE, map_list_menu_hybrid, Menu.NONE, LocaleController.getString("Hybrid", R.string.Hybrid)); } @Override public boolean onOptionsItemSelected(MenuItem item) { int itemId = item.getItemId(); switch (itemId) { - case R.id.map_list_menu_map: + case map_list_menu_map: if (googleMap != null) { googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL); } break; - case R.id.map_list_menu_satellite: + case map_list_menu_satellite: if (googleMap != null) { googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE); } break; - case R.id.map_list_menu_hybrid: + case map_list_menu_hybrid: if (googleMap != null) { googleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID); } break; - case R.id.map_to_my_location: + case map_to_my_location: if (myLocation != null) { LatLng latLng = new LatLng(myLocation.getLatitude(), myLocation.getLongitude()); if (googleMap != null) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java index 390ca5db..bfad4766 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java @@ -19,7 +19,6 @@ import android.support.v4.internal.view.SupportMenuItem; import android.support.v7.app.ActionBarActivity; import android.view.Display; import android.view.Menu; -import android.view.MenuInflater; import android.view.View; import android.view.animation.AccelerateDecelerateInterpolator; import android.widget.ImageView; @@ -113,9 +112,10 @@ public class LoginActivity extends ActionBarActivity implements SlideView.SlideV @Override public boolean onCreateOptionsMenu(Menu menu) { - MenuInflater inflater = getMenuInflater(); - inflater.inflate(R.menu.group_create_menu, menu); - SupportMenuItem doneItem = (SupportMenuItem)menu.findItem(R.id.done_menu_item); + SupportMenuItem doneItem = (SupportMenuItem)menu.add(Menu.NONE, 0, Menu.NONE, null); + doneItem.setShowAsAction(SupportMenuItem.SHOW_AS_ACTION_ALWAYS); + doneItem.setActionView(R.layout.group_create_done_layout); + TextView doneTextView = (TextView)doneItem.getActionView().findViewById(R.id.done_button); doneTextView.setText(LocaleController.getString("Done", R.string.Done)); doneTextView.setOnClickListener(new View.OnClickListener() { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java index d7079ca0..77a364c1 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java @@ -75,6 +75,12 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter public MessagesActivityDelegate delegate; + private final static int messages_list_menu_new_messages = 1; + private final static int messages_list_menu_new_chat = 2; + private final static int messages_list_menu_new_secret_chat = 3; + private final static int messages_list_menu_contacts = 4; + private final static int messages_list_menu_settings = 5; + public static interface MessagesActivityDelegate { public abstract void didSelectDialog(MessagesActivity fragment, long dialog_id); } @@ -434,7 +440,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter private void didSelectResult(final long dialog_id, boolean useAlert) { if (useAlert && selectAlertString != 0) { AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity); - builder.setTitle(R.string.AppName); + builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); int lower_part = (int)dialog_id; if (lower_part != 0) { if (lower_part > 0) { @@ -535,13 +541,25 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { - if (onlySelect) { - inflater.inflate(R.menu.messages_list_select_menu, menu); - } else { - inflater.inflate(R.menu.messages_list_menu, menu); + searchItem = (SupportMenuItem)menu.add(Menu.NONE, 0, Menu.NONE, LocaleController.getString("Search", R.string.Search)).setIcon(R.drawable.ic_ab_search); + searchItem.setShowAsAction(SupportMenuItem.SHOW_AS_ACTION_ALWAYS|SupportMenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW); + searchItem.setActionView(searchView = new SearchView(parentActivity)); + if (!onlySelect) { + SupportMenuItem item = (SupportMenuItem)menu.add(Menu.NONE, messages_list_menu_new_messages, Menu.NONE, LocaleController.getString("NewMessages", R.string.NewMessages)).setIcon(R.drawable.ic_ab_compose); + item.setShowAsAction(SupportMenuItem.SHOW_AS_ACTION_ALWAYS); + + item = (SupportMenuItem)menu.add(Menu.NONE, messages_list_menu_new_chat, Menu.NONE, LocaleController.getString("NewGroup", R.string.NewGroup)); + item.setShowAsAction(SupportMenuItem.SHOW_AS_ACTION_NEVER); + + item = (SupportMenuItem)menu.add(Menu.NONE, messages_list_menu_new_secret_chat, Menu.NONE, LocaleController.getString("NewSecretChat", R.string.NewSecretChat)); + item.setShowAsAction(SupportMenuItem.SHOW_AS_ACTION_NEVER); + + item = (SupportMenuItem)menu.add(Menu.NONE, messages_list_menu_contacts, Menu.NONE, LocaleController.getString("Contacts", R.string.Contacts)); + item.setShowAsAction(SupportMenuItem.SHOW_AS_ACTION_NEVER); + + item = (SupportMenuItem)menu.add(Menu.NONE, messages_list_menu_settings, Menu.NONE, LocaleController.getString("Settings", R.string.Settings)); + item.setShowAsAction(SupportMenuItem.SHOW_AS_ACTION_NEVER); } - searchItem = (SupportMenuItem)menu.findItem(R.id.messages_list_menu_search); - searchView = (SearchView) searchItem.getActionView(); TextView textView = (TextView) searchView.findViewById(R.id.search_src_text); if (textView != null) { @@ -634,15 +652,15 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter } switch (itemId) { - case R.id.messages_list_menu_settings: { + case messages_list_menu_settings: { ((LaunchActivity)inflaterActivity).presentFragment(new SettingsActivity(), "settings", false); break; } - case R.id.messages_list_menu_contacts: { + case messages_list_menu_contacts: { ((LaunchActivity)inflaterActivity).presentFragment(new ContactsActivity(), "contacts", false); break; } - case R.id.messages_list_menu_new_messages: { + case messages_list_menu_new_messages: { BaseFragment fragment = new ContactsActivity(); Bundle bundle = new Bundle(); bundle.putBoolean("onlyUsers", true); @@ -653,7 +671,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter ((LaunchActivity)inflaterActivity).presentFragment(fragment, "contacts_chat", false); break; } - case R.id.messages_list_menu_new_secret_chat: { + case messages_list_menu_new_secret_chat: { BaseFragment fragment = new ContactsActivity(); Bundle bundle = new Bundle(); bundle.putBoolean("onlyUsers", true); @@ -665,7 +683,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter ((LaunchActivity)inflaterActivity).presentFragment(fragment, "contacts_chat", false); break; } - case R.id.messages_list_menu_new_chat: { + case messages_list_menu_new_chat: { ((LaunchActivity)inflaterActivity).presentFragment(new GroupCreateActivity(), "group_create", false); break; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java index cfdf9c2d..2a30b930 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java @@ -20,6 +20,8 @@ import android.net.Uri; import android.os.Bundle; import android.support.v7.app.ActionBar; import android.support.v7.app.ActionBarActivity; +import android.text.Html; +import android.text.method.LinkMovementMethod; import android.util.Base64; import android.view.LayoutInflater; import android.view.MenuItem; @@ -88,6 +90,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter private int audioDownloadSection; private int audioDownloadChatRow; private int audioDownloadPrivateRow; + private int telegramFaqRow; private int languageRow; @Override @@ -178,6 +181,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter clearLogsRow = rowCount++; switchBackendButtonRow = rowCount++; } + telegramFaqRow = rowCount++; askQuestionRow = rowCount++; logoutRow = rowCount++; @@ -241,91 +245,25 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter } else if (i == backgroundRow) { ((LaunchActivity)parentActivity).presentFragment(new SettingsWallpapersActivity(), "settings_wallpapers", false); } else if (i == askQuestionRow) { - final SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); - int uid = preferences.getInt("support_id", 0); - TLRPC.User supportUser = null; - if (uid != 0) { - supportUser = MessagesController.getInstance().users.get(uid); - if (supportUser == null) { - String userString = preferences.getString("support_user", null); - if (userString != null) { - try { - byte[] datacentersBytes = Base64.decode(userString, Base64.DEFAULT); - if (datacentersBytes != null) { - SerializedData data = new SerializedData(datacentersBytes); - supportUser = (TLRPC.User)TLClassStore.Instance().TLdeserialize(data, data.readInt32()); - - } - } catch (Exception e) { - FileLog.e("tmessages", e); - supportUser = null; - } - } - } + if (parentActivity == null) { + return; } - if (supportUser == null) { - if (parentActivity == null) { - return; - } - final ProgressDialog progressDialog = new ProgressDialog(parentActivity); - progressDialog.setMessage(parentActivity.getString(R.string.Loading)); - progressDialog.setCanceledOnTouchOutside(false); - progressDialog.setCancelable(false); - progressDialog.show(); - TLRPC.TL_help_getSupport req = new TLRPC.TL_help_getSupport(); - ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() { - @Override - public void run(TLObject response, TLRPC.TL_error error) { - if (error == null) { + final TextView message = new TextView(parentActivity); + message.setText(Html.fromHtml(LocaleController.getString("AskAQuestionInfo", R.string.AskAQuestionInfo))); + message.setTextSize(18); + message.setPadding(Utilities.dp(8), Utilities.dp(5), Utilities.dp(8), Utilities.dp(6)); + message.setMovementMethod(LinkMovementMethod.getInstance()); - final TLRPC.TL_help_support res = (TLRPC.TL_help_support)response; - Utilities.RunOnUIThread(new Runnable() { - @Override - public void run() { - if (parentActivity == null) { - return; - } - SharedPreferences.Editor editor = preferences.edit(); - editor.putInt("support_id", res.user.id); - SerializedData data = new SerializedData(); - res.user.serializeToStream(data); - editor.putString("support_user", Base64.encodeToString(data.toByteArray(), Base64.DEFAULT)); - editor.commit(); - try { - progressDialog.dismiss(); - } catch (Exception e) { - FileLog.e("tmessages", e); - } - MessagesController.getInstance().users.put(res.user.id, res.user); - ChatActivity fragment = new ChatActivity(); - Bundle bundle = new Bundle(); - bundle.putInt("user_id", res.user.id); - fragment.setArguments(bundle); - ((LaunchActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), false); - } - }); - } else { - Utilities.RunOnUIThread(new Runnable() { - @Override - public void run() { - try { - progressDialog.dismiss(); - } catch (Exception e) { - FileLog.e("tmessages", e); - } - } - }); - } - } - }, null, true, RPCRequest.RPCRequestClassGeneric); - } else { - MessagesController.getInstance().users.putIfAbsent(supportUser.id, supportUser); - ChatActivity fragment = new ChatActivity(); - Bundle bundle = new Bundle(); - bundle.putInt("user_id", supportUser.id); - fragment.setArguments(bundle); - ((LaunchActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), false); - } + AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity); + builder.setView(message); + builder.setPositiveButton(LocaleController.getString("AskButton", R.string.AskButton), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + performAskAQuestion(); + } + }); + builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); + builder.show().setCanceledOnTouchOutside(true); } else if (i == sendLogsRow) { sendLogs(); } else if (i == clearLogsRow) { @@ -422,11 +360,14 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter }); builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); builder.show().setCanceledOnTouchOutside(true); + } else if (i == telegramFaqRow) { + try { + Intent pickIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(LocaleController.getString("TelegramFaqUrl", R.string.TelegramFaqUrl))); + parentActivity.startActivity(pickIntent); + } catch (Exception e) { + FileLog.e("tmessages", e); + } } -// else if (i == 6) { -// UserConfig.saveIncomingPhotos = !UserConfig.saveIncomingPhotos; -// listView.invalidateViews(); -// } } }); @@ -444,6 +385,94 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter return fragmentView; } + public void performAskAQuestion() { + final SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); + int uid = preferences.getInt("support_id", 0); + TLRPC.User supportUser = null; + if (uid != 0) { + supportUser = MessagesController.getInstance().users.get(uid); + if (supportUser == null) { + String userString = preferences.getString("support_user", null); + if (userString != null) { + try { + byte[] datacentersBytes = Base64.decode(userString, Base64.DEFAULT); + if (datacentersBytes != null) { + SerializedData data = new SerializedData(datacentersBytes); + supportUser = (TLRPC.User)TLClassStore.Instance().TLdeserialize(data, data.readInt32()); + + } + } catch (Exception e) { + FileLog.e("tmessages", e); + supportUser = null; + } + } + } + } + if (supportUser == null) { + if (parentActivity == null) { + return; + } + final ProgressDialog progressDialog = new ProgressDialog(parentActivity); + progressDialog.setMessage(parentActivity.getString(R.string.Loading)); + progressDialog.setCanceledOnTouchOutside(false); + progressDialog.setCancelable(false); + progressDialog.show(); + TLRPC.TL_help_getSupport req = new TLRPC.TL_help_getSupport(); + ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() { + @Override + public void run(TLObject response, TLRPC.TL_error error) { + if (error == null) { + + final TLRPC.TL_help_support res = (TLRPC.TL_help_support)response; + Utilities.RunOnUIThread(new Runnable() { + @Override + public void run() { + if (parentActivity == null) { + return; + } + SharedPreferences.Editor editor = preferences.edit(); + editor.putInt("support_id", res.user.id); + SerializedData data = new SerializedData(); + res.user.serializeToStream(data); + editor.putString("support_user", Base64.encodeToString(data.toByteArray(), Base64.DEFAULT)); + editor.commit(); + try { + progressDialog.dismiss(); + } catch (Exception e) { + FileLog.e("tmessages", e); + } + MessagesController.getInstance().users.put(res.user.id, res.user); + ChatActivity fragment = new ChatActivity(); + Bundle bundle = new Bundle(); + bundle.putInt("user_id", res.user.id); + fragment.setArguments(bundle); + ((LaunchActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), false); + } + }); + } else { + Utilities.RunOnUIThread(new Runnable() { + @Override + public void run() { + try { + progressDialog.dismiss(); + } catch (Exception e) { + FileLog.e("tmessages", e); + } + } + }); + } + } + }, null, true, RPCRequest.RPCRequestClassGeneric); + } else { + MessagesController.getInstance().users.putIfAbsent(supportUser.id, supportUser); + ChatActivity fragment = new ChatActivity(); + Bundle bundle = new Bundle(); + bundle.putInt("user_id", supportUser.id); + fragment.setArguments(bundle); + ((LaunchActivity)parentActivity).presentFragment(fragment, "chat" + Math.random(), false); + } + } + @Override public void onActivityResultFragment(int requestCode, int resultCode, Intent data) { avatarUpdater.onActivityResult(requestCode, resultCode, data); @@ -570,7 +599,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter return i == textSizeRow || i == enableAnimationsRow || i == blockedRow || i == notificationRow || i == backgroundRow || i == askQuestionRow || i == sendLogsRow || i == sendByEnterRow || i == terminateSessionsRow || i == photoDownloadPrivateRow || i == photoDownloadChatRow || i == clearLogsRow || i == audioDownloadChatRow || i == audioDownloadPrivateRow || i == languageRow || - i == switchBackendButtonRow; + i == switchBackendButtonRow || i == telegramFaqRow; } @Override @@ -779,6 +808,9 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter } else if (i == switchBackendButtonRow) { textView.setText("Switch Backend"); divider.setVisibility(View.VISIBLE); + } else if (i == telegramFaqRow) { + textView.setText(LocaleController.getString("TelegramFAQ", R.string.TelegramFaq)); + divider.setVisibility(View.VISIBLE); } } else if (type == 3) { if (view == null) { @@ -914,7 +946,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter return 5; } else if (i == enableAnimationsRow || i == sendByEnterRow || i == photoDownloadChatRow || i == photoDownloadPrivateRow || i == audioDownloadChatRow || i == audioDownloadPrivateRow) { return 3; - } else if (i == numberRow || i == notificationRow || i == blockedRow || i == backgroundRow || i == askQuestionRow || i == sendLogsRow || i == terminateSessionsRow || i == clearLogsRow || i == switchBackendButtonRow) { + } else if (i == numberRow || i == notificationRow || i == blockedRow || i == backgroundRow || i == askQuestionRow || i == sendLogsRow || i == terminateSessionsRow || i == clearLogsRow || i == switchBackendButtonRow || i == telegramFaqRow) { return 2; } else if (i == logoutRow) { return 4; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsers.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsers.java index 237ef028..8573684f 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsers.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsers.java @@ -12,6 +12,7 @@ import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; +import android.support.v4.internal.view.SupportMenuItem; import android.support.v7.app.ActionBar; import android.view.LayoutInflater; import android.view.Menu; @@ -37,7 +38,6 @@ import org.telegram.messenger.Utilities; import org.telegram.ui.Cells.ChatOrUserCell; import org.telegram.ui.Views.BaseFragment; import org.telegram.ui.Views.OnSwipeTouchListener; -import org.w3c.dom.Text; import java.util.ArrayList; import java.util.HashMap; @@ -52,6 +52,8 @@ public class SettingsBlockedUsers extends BaseFragment implements NotificationCe private HashMap blockedContactsDict = new HashMap(); private int selectedUserId; + private final static int block_user = 1; + @Override public boolean onFragmentCreate() { super.onFragmentCreate(); @@ -293,7 +295,8 @@ public class SettingsBlockedUsers extends BaseFragment implements NotificationCe } public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { - inflater.inflate(R.menu.settings_block_users_bar_menu, menu); + SupportMenuItem item = (SupportMenuItem)menu.add(Menu.NONE, block_user, Menu.NONE, null).setIcon(R.drawable.plus); + item.setShowAsAction(SupportMenuItem.SHOW_AS_ACTION_ALWAYS); } @Override @@ -303,7 +306,7 @@ public class SettingsBlockedUsers extends BaseFragment implements NotificationCe case android.R.id.home: finishFragment(); break; - case R.id.block_user: + case block_user: ContactsActivity fragment = new ContactsActivity(); fragment.animationType = 1; Bundle bundle = new Bundle(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java index 675fd3e9..4105d6c3 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java @@ -66,6 +66,12 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen private long dialog_id; private TLRPC.EncryptedChat currentEncryptedChat; + private final static int add_contact = 1; + private final static int block_contact = 2; + private final static int share_contact = 3; + private final static int edit_contact = 4; + private final static int delete_contact = 5; + @Override public boolean onFragmentCreate() { super.onFragmentCreate(); @@ -426,7 +432,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen case android.R.id.home: finishFragment(); break; - case R.id.block_contact: { + case block_contact: { TLRPC.User user = MessagesController.getInstance().users.get(user_id); if (user == null) { break; @@ -444,7 +450,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen }, null, true, RPCRequest.RPCRequestClassGeneric); break; } - case R.id.add_contact: { + case add_contact: { TLRPC.User user = MessagesController.getInstance().users.get(user_id); ContactAddActivity fragment = new ContactAddActivity(); Bundle args = new Bundle(); @@ -453,7 +459,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen ((LaunchActivity)parentActivity).presentFragment(fragment, "add_contact_" + user.id, false); break; } - case R.id.share_contact: { + case share_contact: { MessagesActivity fragment = new MessagesActivity(); Bundle args = new Bundle(); args.putBoolean("onlySelect", true); @@ -463,7 +469,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen ((LaunchActivity)parentActivity).presentFragment(fragment, "chat_select", false); break; } - case R.id.edit_contact: { + case edit_contact: { ContactAddActivity fragment = new ContactAddActivity(); Bundle args = new Bundle(); args.putInt("user_id", user_id); @@ -471,7 +477,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen ((LaunchActivity)parentActivity).presentFragment(fragment, "add_contact_" + user_id, false); break; } - case R.id.delete_contact: { + case delete_contact: { final TLRPC.User user = MessagesController.getInstance().users.get(user_id); if (user == null) { break; @@ -503,12 +509,16 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen return; } if (user.phone != null && user.phone.length() != 0) { - inflater.inflate(R.menu.user_profile_menu, menu); + menu.add(Menu.NONE, add_contact, Menu.NONE, LocaleController.getString("AddContact", R.string.AddContact)); + menu.add(Menu.NONE, block_contact, Menu.NONE, LocaleController.getString("BlockContact", R.string.BlockContact)); } else { - inflater.inflate(R.menu.user_profile_block_menu, menu); + menu.add(Menu.NONE, block_contact, Menu.NONE, LocaleController.getString("BlockContact", R.string.BlockContact)); } } else { - inflater.inflate(R.menu.user_profile_contact_menu, menu); + menu.add(Menu.NONE, share_contact, Menu.NONE, LocaleController.getString("ShareContact", R.string.ShareContact)); + menu.add(Menu.NONE, block_contact, Menu.NONE, LocaleController.getString("BlockContact", R.string.BlockContact)); + menu.add(Menu.NONE, block_contact, Menu.NONE, LocaleController.getString("EditContact", R.string.EditContact)); + menu.add(Menu.NONE, block_contact, Menu.NONE, LocaleController.getString("DeleteContact", R.string.DeleteContact)); } } diff --git a/TMessagesProj/src/main/res/menu/chat_enc_menu.xml b/TMessagesProj/src/main/res/menu/chat_enc_menu.xml deleted file mode 100644 index 44a62e3e..00000000 --- a/TMessagesProj/src/main/res/menu/chat_enc_menu.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/menu/chat_menu.xml b/TMessagesProj/src/main/res/menu/chat_menu.xml deleted file mode 100644 index f817aaad..00000000 --- a/TMessagesProj/src/main/res/menu/chat_menu.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/menu/contacts_menu.xml b/TMessagesProj/src/main/res/menu/contacts_menu.xml deleted file mode 100644 index 14193e5e..00000000 --- a/TMessagesProj/src/main/res/menu/contacts_menu.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/menu/gallery_menu.xml b/TMessagesProj/src/main/res/menu/gallery_menu.xml deleted file mode 100644 index 358039c6..00000000 --- a/TMessagesProj/src/main/res/menu/gallery_menu.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/menu/gallery_save_only_menu.xml b/TMessagesProj/src/main/res/menu/gallery_save_only_menu.xml deleted file mode 100644 index e1e85cbf..00000000 --- a/TMessagesProj/src/main/res/menu/gallery_save_only_menu.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/menu/group_create_menu.xml b/TMessagesProj/src/main/res/menu/group_create_menu.xml deleted file mode 100644 index 69268223..00000000 --- a/TMessagesProj/src/main/res/menu/group_create_menu.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/menu/group_profile_menu.xml b/TMessagesProj/src/main/res/menu/group_profile_menu.xml deleted file mode 100644 index 16c539f5..00000000 --- a/TMessagesProj/src/main/res/menu/group_profile_menu.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/menu/location_menu.xml b/TMessagesProj/src/main/res/menu/location_menu.xml deleted file mode 100644 index 52bd2970..00000000 --- a/TMessagesProj/src/main/res/menu/location_menu.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/menu/messages_deleteonly_menu.xml b/TMessagesProj/src/main/res/menu/messages_deleteonly_menu.xml deleted file mode 100644 index 05fd6643..00000000 --- a/TMessagesProj/src/main/res/menu/messages_deleteonly_menu.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/menu/messages_encrypted_menu.xml b/TMessagesProj/src/main/res/menu/messages_encrypted_menu.xml deleted file mode 100644 index bc5e54b5..00000000 --- a/TMessagesProj/src/main/res/menu/messages_encrypted_menu.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/menu/messages_full_menu.xml b/TMessagesProj/src/main/res/menu/messages_full_menu.xml deleted file mode 100644 index ec3808e0..00000000 --- a/TMessagesProj/src/main/res/menu/messages_full_menu.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/menu/messages_list_menu.xml b/TMessagesProj/src/main/res/menu/messages_list_menu.xml deleted file mode 100644 index b00ff8bd..00000000 --- a/TMessagesProj/src/main/res/menu/messages_list_menu.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/menu/messages_list_select_menu.xml b/TMessagesProj/src/main/res/menu/messages_list_select_menu.xml deleted file mode 100644 index 14193e5e..00000000 --- a/TMessagesProj/src/main/res/menu/messages_list_select_menu.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/menu/settings_block_users_bar_menu.xml b/TMessagesProj/src/main/res/menu/settings_block_users_bar_menu.xml deleted file mode 100644 index 8faba3ba..00000000 --- a/TMessagesProj/src/main/res/menu/settings_block_users_bar_menu.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/menu/user_profile_block_menu.xml b/TMessagesProj/src/main/res/menu/user_profile_block_menu.xml deleted file mode 100644 index 0954c42c..00000000 --- a/TMessagesProj/src/main/res/menu/user_profile_block_menu.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/menu/user_profile_contact_menu.xml b/TMessagesProj/src/main/res/menu/user_profile_contact_menu.xml deleted file mode 100644 index 7b4b570f..00000000 --- a/TMessagesProj/src/main/res/menu/user_profile_contact_menu.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/menu/user_profile_menu.xml b/TMessagesProj/src/main/res/menu/user_profile_menu.xml deleted file mode 100644 index 3aecfbd1..00000000 --- a/TMessagesProj/src/main/res/menu/user_profile_menu.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/values-ar/strings.xml b/TMessagesProj/src/main/res/values-ar/strings.xml index b029c840..b347218c 100644 --- a/TMessagesProj/src/main/res/values-ar/strings.xml +++ b/TMessagesProj/src/main/res/values-ar/strings.xml @@ -256,6 +256,12 @@ اشترك صديق في تيليجرام PEBBLE اللغة + نرجو الأخذ بالعلم أن الدعم الفني في تيليجرام يقوم به مجموعة من المتطوعين. نحاول الرد بسرعة قدر المستطاع، لكن ربما نستغرق القليل من الوقت.
]]>يرجى الإطلاع على صفحة الأسئلة الأكثر شيوعًا]]>: يوجد بها حلول للمشاكل وإجابات لمعظم الأسئلة.
+ اسأل متطوع + Telegram FAQ + https://telegram.org/faq/ar + Delete localization? + Incorrect localization file لا توجد وسائط بعد diff --git a/TMessagesProj/src/main/res/values-de/strings.xml b/TMessagesProj/src/main/res/values-de/strings.xml index a8ae5d46..c7ff15cf 100644 --- a/TMessagesProj/src/main/res/values-de/strings.xml +++ b/TMessagesProj/src/main/res/values-de/strings.xml @@ -256,6 +256,12 @@ Kontakt ist Telegram beigetreten PEBBLE Sprache + Please note that Telegram Support is done by volunteers. We try to respond as quickly as possible, but it may take a while.
]]>Please take a look at the Telegram FAQ]]>: it has important troubleshooting tips]]> and answers to most questions.
+ Ask a volunteer + Telegram FAQ + https://telegram.org/faq + Delete localization? + Incorrect localization file Noch keine geteilten Medien vorhanden diff --git a/TMessagesProj/src/main/res/values-es/strings.xml b/TMessagesProj/src/main/res/values-es/strings.xml index 8482f11c..ad787b9c 100644 --- a/TMessagesProj/src/main/res/values-es/strings.xml +++ b/TMessagesProj/src/main/res/values-es/strings.xml @@ -256,6 +256,12 @@ Un contacto se unió a Telegram PEBBLE Idioma + Por favor, ten en cuenta que el Soporte de Telegram está hecho por voluntarios. Intentamos responder lo antes posible, pero puede tomar un tiempo.
]]>Por favor, echa un vistazo a las Preguntas Frecuentes de Telegram]]>: tiene importantes Soluciones a problemas]]> y respuestas para la mayoría de las preguntas.
+ Preguntar + Telegram FAQ + https://telegram.org/faq/es + ¿Eliminar localización? + Incorrect localization file No hay fotos ni vídeos compartidos aún diff --git a/TMessagesProj/src/main/res/values-it/strings.xml b/TMessagesProj/src/main/res/values-it/strings.xml index 9823c665..7b9b0134 100644 --- a/TMessagesProj/src/main/res/values-it/strings.xml +++ b/TMessagesProj/src/main/res/values-it/strings.xml @@ -256,6 +256,12 @@ Un contatto si è collegato a Telegram PEBBLE Lingua + Nota che il supporto di Telegram è fornito da volontari. Proviamo a rispondere non appena possibile, ma potrebbe richiedere del tempo.
]]>Dai un\'occhiata alle Domande frequenti]]>: troverai risposte alla maggior parte delle domande e suggerimenti importanti per l\'individuazione del problema]]>.
+ Chiedi a un volontario + Telegram FAQ + https://telegram.org/faq + Eliminare la localizzazione? + Incorrect localization file Nessun media condiviso diff --git a/TMessagesProj/src/main/res/values-nl/strings.xml b/TMessagesProj/src/main/res/values-nl/strings.xml index 2f252ab0..3913b251 100644 --- a/TMessagesProj/src/main/res/values-nl/strings.xml +++ b/TMessagesProj/src/main/res/values-nl/strings.xml @@ -256,6 +256,12 @@ Contact lid geworden van Telegram PEBBLE Taal + Please note that Telegram Support is done by volunteers. We try to respond as quickly as possible, but it may take a while.
]]>Please take a look at the Telegram FAQ]]>: it has important troubleshooting tips]]> and answers to most questions.
+ Ask a volunteer + Telegram FAQ + https://telegram.org/faq + Delete localization? + Incorrect localization file Nog geen media gedeeld diff --git a/TMessagesProj/src/main/res/values/strings.xml b/TMessagesProj/src/main/res/values/strings.xml index 9f168d03..c0bda50b 100644 --- a/TMessagesProj/src/main/res/values/strings.xml +++ b/TMessagesProj/src/main/res/values/strings.xml @@ -256,6 +256,12 @@ Contact joined Telegram PEBBLE Language + Please note that Telegram Support is done by volunteers. We try to respond as quickly as possible, but it may take a while.
]]>Please take a look at the Telegram FAQ]]>: it has answers to most questions and important tips for troubleshooting]]>.
+ Ask a volunteer + Telegram FAQ + https://telegram.org/faq + Delete localization? + Incorrect localization file No shared media yet