From 41359b14793e87a00b4709374726d87a7d40623b Mon Sep 17 00:00:00 2001 From: DrKLO Date: Mon, 10 Nov 2014 14:05:22 +0300 Subject: [PATCH] More Android L design --- TMessagesProj/build.gradle | 10 +- .../telegram/android/ContactsController.java | 114 ++-- .../telegram/android/NotificationCenter.java | 1 + .../org/telegram/android/SmsListener.java | 2 +- .../org/telegram/messenger/Utilities.java | 2 +- .../ui/Adapters/BaseSectionsAdapter.java | 152 +++++ .../ui/Adapters/ContactsActivityAdapter.java | 314 ++++++----- .../ContactsActivitySearchAdapter.java | 21 +- .../ui/Adapters/DrawerLayoutAdapter.java | 24 +- .../MessagesActivitySearchAdapter.java | 27 +- .../org/telegram/ui/Cells/DialogCell.java | 13 +- .../org/telegram/ui/Cells/DividerCell.java | 36 ++ .../telegram/ui/Cells/DrawerActionCell.java | 4 +- .../telegram/ui/Cells/DrawerDividerCell.java | 25 - .../{DrawerEmptyCell.java => EmptyCell.java} | 9 +- .../telegram/ui/Cells/GreySectionCell.java | 70 +++ .../telegram/ui/Cells/LetterSectionCell.java | 43 ++ ...OrUserCell.java => ProfileSearchCell.java} | 102 ++-- .../java/org/telegram/ui/Cells/TextCell.java | 126 +++++ .../org/telegram/ui/Cells/TextDetailCell.java | 94 ++++ .../java/org/telegram/ui/Cells/UserCell.java | 302 ++++++++++ .../java/org/telegram/ui/ChatActivity.java | 12 +- .../org/telegram/ui/ChatProfileActivity.java | 18 +- .../org/telegram/ui/ContactsActivity.java | 249 ++++----- .../org/telegram/ui/GroupCreateActivity.java | 2 +- .../telegram/ui/GroupCreateFinalActivity.java | 14 +- .../org/telegram/ui/IdenticonActivity.java | 9 +- .../java/org/telegram/ui/LaunchActivity.java | 25 +- .../org/telegram/ui/LoginActivitySmsView.java | 10 +- .../java/org/telegram/ui/MediaActivity.java | 3 + .../org/telegram/ui/MessagesActivity.java | 8 +- ...fileActivity.java => ProfileActivity.java} | 529 +++++++++--------- .../ui/ProfileNotificationsActivity.java | 8 + .../ui/SettingsBlockedUsersActivity.java | 16 +- .../ui/SettingsWallpapersActivity.java | 7 +- .../org/telegram/ui/Views/AvatarDrawable.java | 27 +- ...nticonView.java => IdenticonDrawable.java} | 60 +- .../ui/Views/SectionedBaseAdapter.java | 8 - .../telegram/ui/Views/SectionsListView.java | 215 +++++++ .../src/main/res/drawable-hdpi/bigtimer.png | Bin 940 -> 0 bytes .../main/res/drawable-hdpi/broadcast_w.png | Bin 0 -> 1257 bytes .../src/main/res/drawable-hdpi/grouplist.png | Bin 552 -> 0 bytes .../main/res/drawable-hdpi/header_shadow.png | Bin 0 -> 945 bytes .../main/res/drawable-hdpi/ic_lock_green.png | Bin 282 -> 0 bytes .../src/main/res/drawable-hdpi/list_group.png | Bin 0 -> 1288 bytes .../main/res/drawable-hdpi/list_secret.png | Bin 0 -> 1119 bytes .../src/main/res/drawable-hdpi/phone.png | Bin 0 -> 1394 bytes .../main/res/drawable-hdpi/popup_fixed.9.png | Bin 1331 -> 1461 bytes .../src/main/res/drawable-mdpi/bigtimer.png | Bin 653 -> 0 bytes .../main/res/drawable-mdpi/broadcast_w.png | Bin 0 -> 1141 bytes .../src/main/res/drawable-mdpi/grouplist.png | Bin 377 -> 0 bytes .../main/res/drawable-mdpi/header_shadow.png | Bin 0 -> 939 bytes .../main/res/drawable-mdpi/ic_lock_green.png | Bin 229 -> 0 bytes .../src/main/res/drawable-mdpi/list_group.png | Bin 0 -> 1152 bytes .../main/res/drawable-mdpi/list_secret.png | Bin 0 -> 1056 bytes .../src/main/res/drawable-mdpi/phone.png | Bin 0 -> 1231 bytes .../main/res/drawable-mdpi/popup_fixed.9.png | Bin 961 -> 1312 bytes .../src/main/res/drawable-xhdpi/bigtimer.png | Bin 1190 -> 0 bytes .../main/res/drawable-xhdpi/broadcast_w.png | Bin 0 -> 1358 bytes .../src/main/res/drawable-xhdpi/grouplist.png | Bin 598 -> 0 bytes .../main/res/drawable-xhdpi/header_shadow.png | Bin 0 -> 956 bytes .../main/res/drawable-xhdpi/ic_lock_green.png | Bin 296 -> 0 bytes .../main/res/drawable-xhdpi/list_group.png | Bin 0 -> 1388 bytes .../main/res/drawable-xhdpi/list_secret.png | Bin 0 -> 1144 bytes .../src/main/res/drawable-xhdpi/phone.png | Bin 0 -> 1571 bytes .../main/res/drawable-xhdpi/popup_fixed.9.png | Bin 2448 -> 1744 bytes .../src/main/res/drawable-xxhdpi/bigtimer.png | Bin 1737 -> 0 bytes .../main/res/drawable-xxhdpi/broadcast_w.png | Bin 0 -> 1594 bytes .../main/res/drawable-xxhdpi/grouplist.png | Bin 877 -> 0 bytes .../res/drawable-xxhdpi/header_shadow.png | Bin 0 -> 956 bytes .../res/drawable-xxhdpi/ic_lock_green.png | Bin 427 -> 0 bytes .../main/res/drawable-xxhdpi/list_group.png | Bin 0 -> 1585 bytes .../main/res/drawable-xxhdpi/list_secret.png | Bin 0 -> 1259 bytes .../src/main/res/drawable-xxhdpi/phone.png | Bin 0 -> 1860 bytes .../res/drawable-xxhdpi/popup_fixed.9.png | Bin 3652 -> 2195 bytes .../user_profile_identicon_layout.xml | 33 -- .../src/main/res/layout/contacts_layout.xml | 33 -- .../src/main/res/layout/identicon_layout.xml | 3 +- .../layout/user_profile_identicon_layout.xml | 33 -- .../main/res/layout/user_profile_layout.xml | 43 -- TMessagesProj/src/main/res/values/strings.xml | 10 +- 81 files changed, 1908 insertions(+), 958 deletions(-) create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Adapters/BaseSectionsAdapter.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Cells/DividerCell.java delete mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerDividerCell.java rename TMessagesProj/src/main/java/org/telegram/ui/Cells/{DrawerEmptyCell.java => EmptyCell.java} (73%) create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Cells/GreySectionCell.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Cells/LetterSectionCell.java rename TMessagesProj/src/main/java/org/telegram/ui/Cells/{ChatOrUserCell.java => ProfileSearchCell.java} (82%) create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCell.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Cells/TextDetailCell.java create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Cells/UserCell.java rename TMessagesProj/src/main/java/org/telegram/ui/{UserProfileActivity.java => ProfileActivity.java} (58%) rename TMessagesProj/src/main/java/org/telegram/ui/Views/{IdenticonView.java => IdenticonDrawable.java} (63%) create mode 100644 TMessagesProj/src/main/java/org/telegram/ui/Views/SectionsListView.java delete mode 100755 TMessagesProj/src/main/res/drawable-hdpi/bigtimer.png create mode 100755 TMessagesProj/src/main/res/drawable-hdpi/broadcast_w.png delete mode 100755 TMessagesProj/src/main/res/drawable-hdpi/grouplist.png create mode 100755 TMessagesProj/src/main/res/drawable-hdpi/header_shadow.png delete mode 100644 TMessagesProj/src/main/res/drawable-hdpi/ic_lock_green.png create mode 100755 TMessagesProj/src/main/res/drawable-hdpi/list_group.png create mode 100755 TMessagesProj/src/main/res/drawable-hdpi/list_secret.png create mode 100755 TMessagesProj/src/main/res/drawable-hdpi/phone.png mode change 100644 => 100755 TMessagesProj/src/main/res/drawable-hdpi/popup_fixed.9.png delete mode 100755 TMessagesProj/src/main/res/drawable-mdpi/bigtimer.png create mode 100755 TMessagesProj/src/main/res/drawable-mdpi/broadcast_w.png delete mode 100755 TMessagesProj/src/main/res/drawable-mdpi/grouplist.png create mode 100755 TMessagesProj/src/main/res/drawable-mdpi/header_shadow.png delete mode 100644 TMessagesProj/src/main/res/drawable-mdpi/ic_lock_green.png create mode 100755 TMessagesProj/src/main/res/drawable-mdpi/list_group.png create mode 100755 TMessagesProj/src/main/res/drawable-mdpi/list_secret.png create mode 100755 TMessagesProj/src/main/res/drawable-mdpi/phone.png mode change 100644 => 100755 TMessagesProj/src/main/res/drawable-mdpi/popup_fixed.9.png delete mode 100755 TMessagesProj/src/main/res/drawable-xhdpi/bigtimer.png create mode 100755 TMessagesProj/src/main/res/drawable-xhdpi/broadcast_w.png delete mode 100755 TMessagesProj/src/main/res/drawable-xhdpi/grouplist.png create mode 100755 TMessagesProj/src/main/res/drawable-xhdpi/header_shadow.png delete mode 100755 TMessagesProj/src/main/res/drawable-xhdpi/ic_lock_green.png create mode 100755 TMessagesProj/src/main/res/drawable-xhdpi/list_group.png create mode 100755 TMessagesProj/src/main/res/drawable-xhdpi/list_secret.png create mode 100755 TMessagesProj/src/main/res/drawable-xhdpi/phone.png mode change 100644 => 100755 TMessagesProj/src/main/res/drawable-xhdpi/popup_fixed.9.png delete mode 100755 TMessagesProj/src/main/res/drawable-xxhdpi/bigtimer.png create mode 100755 TMessagesProj/src/main/res/drawable-xxhdpi/broadcast_w.png delete mode 100755 TMessagesProj/src/main/res/drawable-xxhdpi/grouplist.png create mode 100755 TMessagesProj/src/main/res/drawable-xxhdpi/header_shadow.png delete mode 100644 TMessagesProj/src/main/res/drawable-xxhdpi/ic_lock_green.png create mode 100755 TMessagesProj/src/main/res/drawable-xxhdpi/list_group.png create mode 100755 TMessagesProj/src/main/res/drawable-xxhdpi/list_secret.png create mode 100755 TMessagesProj/src/main/res/drawable-xxhdpi/phone.png mode change 100644 => 100755 TMessagesProj/src/main/res/drawable-xxhdpi/popup_fixed.9.png delete mode 100644 TMessagesProj/src/main/res/layout-ar/user_profile_identicon_layout.xml delete mode 100644 TMessagesProj/src/main/res/layout/contacts_layout.xml delete mode 100644 TMessagesProj/src/main/res/layout/user_profile_identicon_layout.xml delete mode 100644 TMessagesProj/src/main/res/layout/user_profile_layout.xml diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index 1809c71c2..c70fe9ca0 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -43,19 +43,19 @@ android { buildTypes { debug { debuggable true - jniDebugBuild false + jniDebuggable true signingConfig signingConfigs.debug } release { debuggable false - jniDebugBuild false + jniDebuggable false signingConfig signingConfigs.release } foss { debuggable false - jniDebugBuild false + jniDebuggable false signingConfig signingConfigs.release } } @@ -80,7 +80,7 @@ android { defaultConfig { minSdkVersion 8 targetSdkVersion 21 - versionCode 379 - versionName "1.9.7" + versionCode 380 + versionName "2.0.0" } } diff --git a/TMessagesProj/src/main/java/org/telegram/android/ContactsController.java b/TMessagesProj/src/main/java/org/telegram/android/ContactsController.java index c57e9c519..45a85ecf9 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/ContactsController.java +++ b/TMessagesProj/src/main/java/org/telegram/android/ContactsController.java @@ -10,9 +10,11 @@ package org.telegram.android; import android.accounts.Account; import android.accounts.AccountManager; +import android.app.Activity; import android.content.ContentProviderOperation; import android.content.ContentProviderResult; import android.content.ContentResolver; +import android.content.SharedPreferences; import android.database.Cursor; import android.net.Uri; import android.provider.BaseColumns; @@ -35,6 +37,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; +import java.util.Locale; import java.util.concurrent.ConcurrentHashMap; public class ContactsController { @@ -48,6 +51,8 @@ public class ContactsController { private boolean contactsBookLoaded = false; private String lastContactsVersions = ""; private ArrayList delayedContactsUpdate = new ArrayList(); + private String inviteText; + private boolean updatingInviteText = false; public static class Contact { public int id; @@ -75,8 +80,7 @@ public class ContactsController { public HashMap contactsBook = new HashMap(); public HashMap contactsBookSPhones = new HashMap(); - public HashMap> contactsSectionsDict = new HashMap>(); - public ArrayList sortedContactsSectionsArray = new ArrayList(); + public ArrayList phoneBookContacts = new ArrayList(); public ArrayList contacts = new ArrayList(); public SparseArray contactsDict = new SparseArray(); @@ -102,8 +106,7 @@ public class ContactsController { public void cleanup() { contactsBook.clear(); contactsBookSPhones.clear(); - contactsSectionsDict.clear(); - sortedContactsSectionsArray.clear(); + phoneBookContacts.clear(); contacts.clear(); contactsDict.clear(); usersSectionsDict.clear(); @@ -118,6 +121,45 @@ public class ContactsController { lastContactsVersions = ""; } + public void checkInviteText() { + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); + inviteText = preferences.getString("invitetext", null); + int time = preferences.getInt("invitetexttime", 0); + if (!updatingInviteText && (inviteText == null || time + 86400 < (int)(System.currentTimeMillis() / 1000))) { + updatingInviteText = true; + TLRPC.TL_help_getInviteText req = new TLRPC.TL_help_getInviteText(); + req.lang_code = LocaleController.getLocaleString(Locale.getDefault()); + if (req.lang_code == null || req.lang_code.length() == 0) { + req.lang_code = "en"; + } + ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() { + @Override + public void run(TLObject response, TLRPC.TL_error error) { + if (error == null) { + final TLRPC.TL_help_inviteText res = (TLRPC.TL_help_inviteText)response; + if (res.message.length() != 0) { + AndroidUtilities.runOnUIThread(new Runnable() { + @Override + public void run() { + updatingInviteText = false; + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = preferences.edit(); + editor.putString("invitetext", res.message); + editor.putInt("invitetexttime", (int) (System.currentTimeMillis() / 1000)); + editor.commit(); + } + }); + } + } + } + }, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassFailOnServerErrors); + } + } + + public String getInviteText() { + return inviteText != null ? inviteText : LocaleController.getString("InviteText", R.string.InviteText); + } + public void checkAppAccount() { AccountManager am = AccountManager.get(ApplicationLoader.applicationContext); Account[] accounts = am.getAccountsByType("org.telegram.account"); @@ -989,8 +1031,7 @@ public class ContactsController { contactsPhonesShort.put(user.phone, value); } - final HashMap> sectionsPhoneDict = new HashMap>(); - final ArrayList sortedSectionsPhoneArray = new ArrayList(); + final ArrayList sortedPhoneBookContacts = new ArrayList(); for (HashMap.Entry pair : contactsBook.entrySet()) { Contact value = pair.getValue(); int id = pair.getKey(); @@ -1007,61 +1048,24 @@ public class ContactsController { continue; } - String key = value.first_name; - if (key.length() == 0) { - key = value.last_name; - } - if (key.length() == 0) { - key = "#"; - if (value.phones.size() != 0) { - value.first_name = "+" + value.phones.get(0); - } - } else { - key = key.toUpperCase(); - } - if (key.length() > 1) { - key = key.substring(0, 1); - } - ArrayList arr = sectionsPhoneDict.get(key); - if (arr == null) { - arr = new ArrayList(); - sectionsPhoneDict.put(key, arr); - sortedSectionsPhoneArray.add(key); - } - arr.add(value); + sortedPhoneBookContacts.add(value); } - for (HashMap.Entry> entry : sectionsPhoneDict.entrySet()) { - Collections.sort(entry.getValue(), new Comparator() { - @Override - public int compare(Contact contact, Contact contact2) { - String toComapre1 = contact.first_name; - if (toComapre1.length() == 0) { - toComapre1 = contact.last_name; - } - String toComapre2 = contact2.first_name; - if (toComapre2.length() == 0) { - toComapre2 = contact2.last_name; - } - return toComapre1.compareTo(toComapre2); - } - }); - } - Collections.sort(sortedSectionsPhoneArray, new Comparator() { + Collections.sort(sortedPhoneBookContacts, new Comparator() { @Override - public int compare(String s, String s2) { - char cv1 = s.charAt(0); - char cv2 = s2.charAt(0); - if (cv1 == '#') { - return 1; - } else if (cv2 == '#') { - return -1; + public int compare(Contact contact, Contact contact2) { + String toComapre1 = contact.first_name; + if (toComapre1.length() == 0) { + toComapre1 = contact.last_name; } - return s.compareTo(s2); + String toComapre2 = contact2.first_name; + if (toComapre2.length() == 0) { + toComapre2 = contact2.last_name; + } + return toComapre1.compareTo(toComapre2); } }); - contactsSectionsDict = sectionsPhoneDict; - sortedContactsSectionsArray = sortedSectionsPhoneArray; + phoneBookContacts = sortedPhoneBookContacts; } private void buildContactsSectionsArrays(boolean sort) { diff --git a/TMessagesProj/src/main/java/org/telegram/android/NotificationCenter.java b/TMessagesProj/src/main/java/org/telegram/android/NotificationCenter.java index 612e35be3..d85db21ce 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/NotificationCenter.java +++ b/TMessagesProj/src/main/java/org/telegram/android/NotificationCenter.java @@ -45,6 +45,7 @@ public class NotificationCenter { public static final int wallpapersDidLoaded = 171; public static final int closeOtherAppActivities = 702; public static final int didUpdatedConnectionState = 703; + public static final int didReceiveSmsCode = 998; public static final int emojiDidLoaded = 999; public static final int appDidLogout = 1234; diff --git a/TMessagesProj/src/main/java/org/telegram/android/SmsListener.java b/TMessagesProj/src/main/java/org/telegram/android/SmsListener.java index ce57865a2..c4470fa41 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/SmsListener.java +++ b/TMessagesProj/src/main/java/org/telegram/android/SmsListener.java @@ -48,7 +48,7 @@ public class SmsListener extends BroadcastReceiver { if (matcher.find()) { String str = matcher.group(0); if (str.length() >= 3) { - NotificationCenter.getInstance().postNotificationName(998, matcher.group(0)); + NotificationCenter.getInstance().postNotificationName(NotificationCenter.didReceiveSmsCode, matcher.group(0)); } } } catch (Exception e) { diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java b/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java index 71ee8a2f4..4823e5123 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java @@ -640,7 +640,7 @@ public class Utilities { builder.append(" "); } query.trim(); - builder.append(Html.fromHtml("" + query + "")); + builder.append(Html.fromHtml("" + query + "")); lastIndex = end; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/BaseSectionsAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/BaseSectionsAdapter.java new file mode 100644 index 000000000..0023f3baf --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/BaseSectionsAdapter.java @@ -0,0 +1,152 @@ +/* + * This is the source code of Telegram for Android v. 1.7.x. + * It is licensed under GNU GPL v. 2 or later. + * You should have received a copy of the license in this archive (see LICENSE). + * + * Copyright Nikolai Kudashov, 2013-2014. + */ + +package org.telegram.ui.Adapters; + +import android.util.SparseArray; +import android.view.View; +import android.view.ViewGroup; + +public abstract class BaseSectionsAdapter extends BaseFragmentAdapter { + + private SparseArray sectionPositionCache; + private SparseArray sectionCache; + private SparseArray sectionCountCache; + private int sectionCount; + private int count; + + private void cleanupCache() { + sectionCache = new SparseArray(); + sectionPositionCache = new SparseArray(); + sectionCountCache = new SparseArray(); + count = -1; + sectionCount = -1; + } + + public BaseSectionsAdapter() { + super(); + cleanupCache(); + } + + @Override + public void notifyDataSetChanged() { + cleanupCache(); + super.notifyDataSetChanged(); + } + + @Override + public void notifyDataSetInvalidated() { + cleanupCache(); + super.notifyDataSetInvalidated(); + } + + @Override + public boolean areAllItemsEnabled() { + return false; + } + + @Override + public boolean isEnabled(int position) { + return isRowEnabled(getSectionForPosition(position), getPositionInSectionForPosition(position)); + } + + @Override + public final long getItemId(int position) { + return position; + } + + @Override + public final int getCount() { + if (count >= 0) { + return count; + } + count = 0; + for (int i = 0; i < internalGetSectionCount(); i++) { + count += internalGetCountForSection(i); + } + return count; + } + + @Override + public final Object getItem(int position) { + return getItem(getSectionForPosition(position), getPositionInSectionForPosition(position)); + } + + @Override + public final int getItemViewType(int position) { + return getItemViewType(getSectionForPosition(position), getPositionInSectionForPosition(position)); + } + + @Override + public final View getView(int position, View convertView, ViewGroup parent) { + return getItemView(getSectionForPosition(position), getPositionInSectionForPosition(position), convertView, parent); + } + + private int internalGetCountForSection(int section) { + Integer cachedSectionCount = sectionCountCache.get(section); + if (cachedSectionCount != null) { + return cachedSectionCount; + } + int sectionCount = getCountForSection(section); + sectionCountCache.put(section, sectionCount); + return sectionCount; + } + + private int internalGetSectionCount() { + if (sectionCount >= 0) { + return sectionCount; + } + sectionCount = getSectionCount(); + return sectionCount; + } + + public final int getSectionForPosition(int position) { + Integer cachedSection = sectionCache.get(position); + if (cachedSection != null) { + return cachedSection; + } + int sectionStart = 0; + for (int i = 0; i < internalGetSectionCount(); i++) { + int sectionCount = internalGetCountForSection(i); + int sectionEnd = sectionStart + sectionCount; + if (position >= sectionStart && position < sectionEnd) { + sectionCache.put(position, i); + return i; + } + sectionStart = sectionEnd; + } + return 0; + } + + public int getPositionInSectionForPosition(int position) { + Integer cachedPosition = sectionPositionCache.get(position); + if (cachedPosition != null) { + return cachedPosition; + } + int sectionStart = 0; + for (int i = 0; i < internalGetSectionCount(); i++) { + int sectionCount = internalGetCountForSection(i); + int sectionEnd = sectionStart + sectionCount; + if (position >= sectionStart && position < sectionEnd) { + int positionInSection = position - sectionStart; + sectionPositionCache.put(position, positionInSection); + return positionInSection; + } + sectionStart = sectionEnd; + } + return 0; + } + + public abstract int getSectionCount(); + public abstract int getCountForSection(int section); + public abstract boolean isRowEnabled(int section, int row); + public abstract int getItemViewType(int section, int position); + public abstract Object getItem(int section, int position); + public abstract View getItemView(int section, int position, View convertView, ViewGroup parent); + public abstract View getSectionHeaderView(int section, View convertView, ViewGroup parent); +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsActivityAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsActivityAdapter.java index 1bc0b293f..6030b4ec4 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsActivityAdapter.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsActivityAdapter.java @@ -9,221 +9,245 @@ package org.telegram.ui.Adapters; import android.content.Context; -import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.TextView; +import org.telegram.android.AndroidUtilities; import org.telegram.android.LocaleController; import org.telegram.messenger.TLRPC; import org.telegram.android.ContactsController; import org.telegram.android.MessagesController; import org.telegram.messenger.R; -import org.telegram.ui.Cells.ChatOrUserCell; -import org.telegram.ui.Views.SectionedBaseAdapter; -import org.telegram.ui.Views.SettingsSectionLayout; +import org.telegram.ui.Cells.DividerCell; +import org.telegram.ui.Cells.GreySectionCell; +import org.telegram.ui.Cells.LetterSectionCell; +import org.telegram.ui.Cells.TextCell; +import org.telegram.ui.Cells.UserCell; import java.util.ArrayList; import java.util.HashMap; -public class ContactsActivityAdapter extends SectionedBaseAdapter { +public class ContactsActivityAdapter extends BaseSectionsAdapter { private Context mContext; private boolean onlyUsers; - private boolean usersAsSections; + private boolean needPhonebook; private HashMap ignoreUsers; public ContactsActivityAdapter(Context context, boolean arg1, boolean arg2, HashMap arg3) { mContext = context; onlyUsers = arg1; - usersAsSections = arg2; + needPhonebook = arg2; ignoreUsers = arg3; } @Override public Object getItem(int section, int position) { + if (onlyUsers) { + if (section < ContactsController.getInstance().sortedUsersSectionsArray.size()) { + ArrayList arr = ContactsController.getInstance().usersSectionsDict.get(ContactsController.getInstance().sortedUsersSectionsArray.get(section)); + return MessagesController.getInstance().getUser(arr.get(position).user_id); + } + return null; + } else { + if (section == 0) { + return null; + } else { + if (section - 1 < ContactsController.getInstance().sortedUsersSectionsArray.size()) { + ArrayList arr = ContactsController.getInstance().usersSectionsDict.get(ContactsController.getInstance().sortedUsersSectionsArray.get(section - 1)); + if (position < arr.size()) { + return MessagesController.getInstance().getUser(arr.get(position).user_id); + } + return null; + } + } + } + if (needPhonebook) { + return ContactsController.getInstance().phoneBookContacts.get(position); + } return null; } @Override - public long getItemId(int section, int position) { - return 0; + public boolean isRowEnabled(int section, int row) { + if (onlyUsers) { + ArrayList arr = ContactsController.getInstance().usersSectionsDict.get(ContactsController.getInstance().sortedUsersSectionsArray.get(section)); + return row < arr.size(); + } else { + if (section == 0) { + if (needPhonebook) { + if (row == 1) { + return false; + } + } else { + if (row == 3) { + return false; + } + } + return true; + } else if (section - 1 < ContactsController.getInstance().sortedUsersSectionsArray.size()) { + ArrayList arr = ContactsController.getInstance().usersSectionsDict.get(ContactsController.getInstance().sortedUsersSectionsArray.get(section - 1)); + return row < arr.size(); + } + } + return true; } @Override public int getSectionCount() { - int count = 0; - if (usersAsSections) { - count += ContactsController.getInstance().sortedUsersSectionsArray.size(); - } else { + int count = ContactsController.getInstance().sortedUsersSectionsArray.size(); + if (!onlyUsers) { count++; } - if (!onlyUsers) { - count += ContactsController.getInstance().sortedContactsSectionsArray.size(); + if (needPhonebook) { + count++; } return count; } @Override public int getCountForSection(int section) { - if (usersAsSections) { + if (onlyUsers) { if (section < ContactsController.getInstance().sortedUsersSectionsArray.size()) { ArrayList arr = ContactsController.getInstance().usersSectionsDict.get(ContactsController.getInstance().sortedUsersSectionsArray.get(section)); - return arr.size(); + int count = arr.size(); + if (section != (ContactsController.getInstance().sortedUsersSectionsArray.size() - 1) || needPhonebook) { + count++; + } + return count; } } else { if (section == 0) { - return ContactsController.getInstance().contacts.size() + 1; + if (needPhonebook) { + return 2; + } else { + return 4; + } + } else if (section - 1 < ContactsController.getInstance().sortedUsersSectionsArray.size()) { + ArrayList arr = ContactsController.getInstance().usersSectionsDict.get(ContactsController.getInstance().sortedUsersSectionsArray.get(section - 1)); + int count = arr.size(); + if (section - 1 != (ContactsController.getInstance().sortedUsersSectionsArray.size() - 1) || needPhonebook) { + count++; + } + return count; } } - ArrayList arr = ContactsController.getInstance().contactsSectionsDict.get(ContactsController.getInstance().sortedContactsSectionsArray.get(section - 1)); - return arr.size(); + if (needPhonebook) { + return ContactsController.getInstance().phoneBookContacts.size(); + } + return 0; + } + + @Override + public View getSectionHeaderView(int section, View convertView, ViewGroup parent) { + if (convertView == null) { + convertView = new LetterSectionCell(mContext); + } + if (onlyUsers) { + if (section < ContactsController.getInstance().sortedUsersSectionsArray.size()) { + ((LetterSectionCell) convertView).setLetter(ContactsController.getInstance().sortedUsersSectionsArray.get(section)); + } else { + ((LetterSectionCell) convertView).setLetter(""); + } + } else { + if (section == 0) { + ((LetterSectionCell) convertView).setLetter(""); + } else if (section - 1 < ContactsController.getInstance().sortedUsersSectionsArray.size()) { + ((LetterSectionCell) convertView).setLetter(ContactsController.getInstance().sortedUsersSectionsArray.get(section - 1)); + } else { + ((LetterSectionCell) convertView).setLetter(""); + } + } + return convertView; } @Override public View getItemView(int section, int position, View convertView, ViewGroup parent) { - - TLRPC.User user = null; - int count = 0; - if (usersAsSections) { - if (section < ContactsController.getInstance().sortedUsersSectionsArray.size()) { - ArrayList arr = ContactsController.getInstance().usersSectionsDict.get(ContactsController.getInstance().sortedUsersSectionsArray.get(section)); - user = MessagesController.getInstance().getUser(arr.get(position).user_id); - count = arr.size(); - } - } else { - if (section == 0) { - if (position == 0) { - if (convertView == null) { - LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - convertView = li.inflate(R.layout.contacts_invite_row_layout, parent, false); - TextView textView = (TextView)convertView.findViewById(R.id.messages_list_row_name); - textView.setText(LocaleController.getString("InviteFriends", R.string.InviteFriends)); - } - View divider = convertView.findViewById(R.id.settings_row_divider); - if (ContactsController.getInstance().contacts.isEmpty()) { - divider.setVisibility(View.INVISIBLE); - } else { - divider.setVisibility(View.VISIBLE); - } - return convertView; - } - user = MessagesController.getInstance().getUser(ContactsController.getInstance().contacts.get(position - 1).user_id); - count = ContactsController.getInstance().contacts.size(); - } - } - if (user != null) { + int type = getItemViewType(section, position); + if (type == 4) { if (convertView == null) { - convertView = new ChatOrUserCell(mContext); - ((ChatOrUserCell)convertView).usePadding = false; + convertView = new DividerCell(mContext); + convertView.setPadding(AndroidUtilities.dp(LocaleController.isRTL ? 24 : 72), 0, AndroidUtilities.dp(LocaleController.isRTL ? 72 : 24), 0); + } + } else if (type == 3) { + if (convertView == null) { + convertView = new GreySectionCell(mContext); + ((GreySectionCell) convertView).setText(LocaleController.getString("Contacts", R.string.Contacts).toUpperCase()); + } + } else if (type == 2) { + if (convertView == null) { + convertView = new TextCell(mContext); + } + TextCell actionCell = (TextCell) convertView; + if (needPhonebook) { + actionCell.setTextAndIcon(LocaleController.getString("InviteFriends", R.string.InviteFriends), R.drawable.menu_invite); + } else { + if (position == 0) { + actionCell.setTextAndIcon(LocaleController.getString("NewGroup", R.string.NewGroup), R.drawable.menu_newgroup); + } else if (position == 1) { + actionCell.setTextAndIcon(LocaleController.getString("NewSecretChat", R.string.NewSecretChat), R.drawable.menu_secret); + } else if (position == 2) { + actionCell.setTextAndIcon(LocaleController.getString("NewBroadcastList", R.string.NewBroadcastList), R.drawable.menu_broadcast); + } + } + } else if (type == 1) { + if (convertView == null) { + convertView = new TextCell(mContext); + } + ContactsController.Contact contact = ContactsController.getInstance().phoneBookContacts.get(position); + if (contact.first_name != null && contact.last_name != null) { + ((TextCell) convertView).setText(contact.first_name + " " + contact.last_name); + } else if (contact.first_name != null && contact.last_name == null) { + ((TextCell) convertView).setText(contact.first_name); + } else { + ((TextCell) convertView).setText(contact.last_name); + } + } else if (type == 0) { + if (convertView == null) { + convertView = new UserCell(mContext); + convertView.setPadding(AndroidUtilities.dp(LocaleController.isRTL ? 16 : 54), 0, 0, 0); } - ((ChatOrUserCell)convertView).setData(user, null, null, null, null); - + ArrayList arr = ContactsController.getInstance().usersSectionsDict.get(ContactsController.getInstance().sortedUsersSectionsArray.get(section - (onlyUsers ? 0 : 1))); + TLRPC.User user = MessagesController.getInstance().getUser(arr.get(position).user_id); + ((UserCell)convertView).setData(user, null, null); if (ignoreUsers != null) { if (ignoreUsers.containsKey(user.id)) { - ((ChatOrUserCell)convertView).drawAlpha = 0.5f; + ((UserCell)convertView).drawAlpha = 0.5f; } else { - ((ChatOrUserCell)convertView).drawAlpha = 1.0f; + ((UserCell)convertView).drawAlpha = 1.0f; } } - - ((ChatOrUserCell) convertView).useSeparator = position != count - 1; - - return convertView; - } - - TextView textView; - if (convertView == null) { - LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - convertView = li.inflate(R.layout.settings_row_button_layout, parent, false); - textView = (TextView)convertView.findViewById(R.id.settings_row_text); - } else { - textView = (TextView)convertView.findViewById(R.id.settings_row_text); - } - - View divider = convertView.findViewById(R.id.settings_row_divider); - ArrayList arr = ContactsController.getInstance().contactsSectionsDict.get(ContactsController.getInstance().sortedContactsSectionsArray.get(section - 1)); - ContactsController.Contact contact = arr.get(position); - if (divider != null) { - if (position == arr.size() - 1) { - divider.setVisibility(View.INVISIBLE); - } else { - divider.setVisibility(View.VISIBLE); - } - } - if (contact.first_name != null && contact.last_name != null) { - textView.setText(contact.first_name + " " + contact.last_name); - } else if (contact.first_name != null && contact.last_name == null) { - textView.setText(contact.first_name); - } else { - textView.setText(contact.last_name); } return convertView; } @Override public int getItemViewType(int section, int position) { - if (usersAsSections) { - if (section < ContactsController.getInstance().sortedUsersSectionsArray.size()) { - return 0; - } - } else if (section == 0) { - if (position == 0) { - return 2; - } - return 0; - } - return 1; - } - - @Override - public int getItemViewTypeCount() { - return 3; - } - - @Override - public int getSectionHeaderViewType(int section) { - if (usersAsSections) { - if (section < ContactsController.getInstance().sortedUsersSectionsArray.size()) { - return 1; - } - } else if (section == 0) { - return 0; - } - return 1; - } - - @Override - public int getSectionHeaderViewTypeCount() { - return 2; - } - - @Override - public View getSectionHeaderView(int section, View convertView, ViewGroup parent) { - if (usersAsSections) { - if (section < ContactsController.getInstance().sortedUsersSectionsArray.size()) { - if (convertView == null) { - convertView = new SettingsSectionLayout(mContext); - convertView.setBackgroundColor(0xffffffff); - } - ((SettingsSectionLayout) convertView).setText(ContactsController.getInstance().sortedUsersSectionsArray.get(section)); - return convertView; - } + if (onlyUsers) { + ArrayList arr = ContactsController.getInstance().usersSectionsDict.get(ContactsController.getInstance().sortedUsersSectionsArray.get(section)); + return position < arr.size() ? 0 : 4; } else { if (section == 0) { - if (convertView == null) { - LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - convertView = li.inflate(R.layout.empty_layout, parent, false); + if (needPhonebook) { + if (position == 1) { + return 3; + } + } else { + if (position == 3) { + return 3; + } } - return convertView; + return 2; + } else if (section - 1 < ContactsController.getInstance().sortedUsersSectionsArray.size()) { + ArrayList arr = ContactsController.getInstance().usersSectionsDict.get(ContactsController.getInstance().sortedUsersSectionsArray.get(section - 1)); + return position < arr.size() ? 0 : 4; } } + return 1; + } - if (convertView == null) { - convertView = new SettingsSectionLayout(mContext); - convertView.setBackgroundColor(0xffffffff); - } - ((SettingsSectionLayout) convertView).setText(ContactsController.getInstance().sortedContactsSectionsArray.get(section - 1)); - return convertView; + @Override + public int getViewTypeCount() { + return 5; } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsActivitySearchAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsActivitySearchAdapter.java index e01c1c4ce..16f87e897 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsActivitySearchAdapter.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsActivitySearchAdapter.java @@ -22,8 +22,8 @@ import org.telegram.messenger.FileLog; import org.telegram.android.MessagesController; import org.telegram.messenger.UserConfig; import org.telegram.messenger.Utilities; -import org.telegram.ui.Cells.ChatOrUserCell; -import org.telegram.ui.Views.SettingsSectionLayout; +import org.telegram.ui.Cells.GreySectionCell; +import org.telegram.ui.Cells.ProfileSearchCell; import java.util.ArrayList; import java.util.HashMap; @@ -197,16 +197,15 @@ public class ContactsActivitySearchAdapter extends BaseContactsSearchAdapter { public View getView(int i, View view, ViewGroup viewGroup) { if (i == searchResult.size()) { if (view == null) { - view = new SettingsSectionLayout(mContext); - ((SettingsSectionLayout) view).setText(LocaleController.getString("GlobalSearch", R.string.GlobalSearch)); + view = new GreySectionCell(mContext); + ((GreySectionCell) view).setText(LocaleController.getString("GlobalSearch", R.string.GlobalSearch)); } } else { if (view == null) { - view = new ChatOrUserCell(mContext); - ((ChatOrUserCell) view).usePadding = false; + view = new ProfileSearchCell(mContext); } - ((ChatOrUserCell) view).useSeparator = (i != getCount() - 1 && i != searchResult.size() - 1); + ((ProfileSearchCell) view).useSeparator = (i != getCount() - 1 && i != searchResult.size() - 1); TLRPC.User user = getItem(i); if (user != null) { CharSequence username = null; @@ -221,20 +220,20 @@ public class ContactsActivitySearchAdapter extends BaseContactsSearchAdapter { } } else if (i > searchResult.size() && user.username != null) { try { - username = Html.fromHtml(String.format("@%s%s", user.username.substring(0, lastFoundUsername.length()), user.username.substring(lastFoundUsername.length()))); + username = Html.fromHtml(String.format("@%s%s", user.username.substring(0, lastFoundUsername.length()), user.username.substring(lastFoundUsername.length()))); } catch (Exception e) { username = user.username; FileLog.e("tmessages", e); } } - ((ChatOrUserCell) view).setData(user, null, null, name, username); + ((ProfileSearchCell) view).setData(user, null, null, name, username); if (ignoreUsers != null) { if (ignoreUsers.containsKey(user.id)) { - ((ChatOrUserCell) view).drawAlpha = 0.5f; + ((ProfileSearchCell) view).drawAlpha = 0.5f; } else { - ((ChatOrUserCell) view).drawAlpha = 1.0f; + ((ProfileSearchCell) view).drawAlpha = 1.0f; } } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DrawerLayoutAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DrawerLayoutAdapter.java index f4da419a6..8304f7f7e 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DrawerLayoutAdapter.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DrawerLayoutAdapter.java @@ -18,8 +18,8 @@ import org.telegram.android.MessagesController; import org.telegram.messenger.R; import org.telegram.messenger.UserConfig; import org.telegram.ui.Cells.DrawerActionCell; -import org.telegram.ui.Cells.DrawerDividerCell; -import org.telegram.ui.Cells.DrawerEmptyCell; +import org.telegram.ui.Cells.DividerCell; +import org.telegram.ui.Cells.EmptyCell; import org.telegram.ui.Cells.DrawerProfileCell; public class DrawerLayoutAdapter extends BaseAdapter { @@ -37,12 +37,12 @@ public class DrawerLayoutAdapter extends BaseAdapter { @Override public boolean isEnabled(int i) { - return !(i == 0 || i == 1 || i == 5 || i == 6 || i == 7); + return !(i == 0 || i == 1 || i == 5); } @Override public int getCount() { - return UserConfig.isClientActivated() ? 12 : 0; + return UserConfig.isClientActivated() ? 10 : 0; } @Override @@ -70,11 +70,11 @@ public class DrawerLayoutAdapter extends BaseAdapter { ((DrawerProfileCell) view).setUser(MessagesController.getInstance().getUser(UserConfig.getClientUserId())); } else if (type == 1) { if (view == null) { - view = new DrawerEmptyCell(mContext); + view = new EmptyCell(mContext, 8); } } else if (type == 2) { if (view == null) { - view = new DrawerDividerCell(mContext); + view = new DividerCell(mContext); } } else if (type == 3) { if (view == null) { @@ -87,13 +87,13 @@ public class DrawerLayoutAdapter extends BaseAdapter { actionCell.setTextAndIcon(LocaleController.getString("NewSecretChat", R.string.NewSecretChat), R.drawable.menu_secret); } else if (i == 4) { actionCell.setTextAndIcon(LocaleController.getString("NewBroadcastList", R.string.NewBroadcastList), R.drawable.menu_broadcast); - } else if (i == 8) { + } else if (i == 6) { actionCell.setTextAndIcon(LocaleController.getString("Contacts", R.string.Contacts), R.drawable.menu_contacts); - } else if (i == 9) { + } else if (i == 7) { actionCell.setTextAndIcon(LocaleController.getString("InviteFriends", R.string.InviteFriends), R.drawable.menu_invite); - } else if (i == 10) { + } else if (i == 8) { actionCell.setTextAndIcon(LocaleController.getString("Settings", R.string.Settings), R.drawable.menu_settings); - } else if (i == 11) { + } else if (i == 9) { actionCell.setTextAndIcon(LocaleController.getString("TelegramFaq", R.string.TelegramFaq), R.drawable.menu_help); } } @@ -105,9 +105,9 @@ public class DrawerLayoutAdapter extends BaseAdapter { public int getItemViewType(int i) { if (i == 0) { return 0; - } else if (i == 1 || i == 5 || i == 7) { + } else if (i == 1) { return 1; - } else if (i == 6) { + } else if (i == 5) { return 2; } return 3; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/MessagesActivitySearchAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/MessagesActivitySearchAdapter.java index c1d508d73..348cb493e 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/MessagesActivitySearchAdapter.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/MessagesActivitySearchAdapter.java @@ -30,9 +30,9 @@ import org.telegram.messenger.TLObject; import org.telegram.messenger.TLRPC; import org.telegram.messenger.UserConfig; import org.telegram.messenger.Utilities; -import org.telegram.ui.Cells.ChatOrUserCell; import org.telegram.ui.Cells.DialogCell; -import org.telegram.ui.Views.SettingsSectionLayout; +import org.telegram.ui.Cells.GreySectionCell; +import org.telegram.ui.Cells.ProfileSearchCell; import java.util.ArrayList; import java.util.Timer; @@ -113,7 +113,7 @@ public class MessagesActivitySearchAdapter extends BaseContactsSearchAdapter { }, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassFailOnServerErrors); } - private void searchDialogsInternal(final String query, final boolean needEncrypted) { + private void searchDialogsInternal(final String query, final boolean serverOnly) { MessagesStorage.getInstance().getStorageQueue().postRunnable(new Runnable() { @Override public void run() { @@ -162,7 +162,7 @@ public class MessagesActivitySearchAdapter extends BaseContactsSearchAdapter { } cursor.dispose(); - if (needEncrypted) { + if (!serverOnly) { cursor = MessagesStorage.getInstance().getDatabase().queryFinalized("SELECT q.data, u.name, q.user, q.g, q.authkey, q.ttl, u.data, u.status, q.layer, q.seq_in, q.seq_out FROM enc_chats as q INNER JOIN dialogs as d ON (q.uid << 32) = d.did INNER JOIN users as u ON q.user = u.uid"); while (cursor.next()) { String name = cursor.stringValue(1); @@ -219,7 +219,7 @@ public class MessagesActivitySearchAdapter extends BaseContactsSearchAdapter { ByteBufferDesc data = MessagesStorage.getInstance().getBuffersStorage().getFreeBuffer(cursor.byteArrayLength(0)); if (data != null && cursor.byteBufferValue(0, data.buffer) != 0) { TLRPC.Chat chat = (TLRPC.Chat) TLClassStore.Instance().TLdeserialize(data, data.readInt32()); - if (!needEncrypted && chat.id < 0) { + if (serverOnly && chat.id < 0) { continue; } resultArrayNames.add(Utilities.generateSearchName(chat.title, null, q)); @@ -367,17 +367,16 @@ public class MessagesActivitySearchAdapter extends BaseContactsSearchAdapter { if (type == 1) { if (view == null) { - view = new SettingsSectionLayout(mContext); - view.setPadding(AndroidUtilities.dp(11), 0, AndroidUtilities.dp(11), 0); + view = new GreySectionCell(mContext); } if (!globalSearch.isEmpty() && i == searchResult.size()) { - ((SettingsSectionLayout) view).setText(LocaleController.getString("GlobalSearch", R.string.GlobalSearch)); + ((GreySectionCell) view).setText(LocaleController.getString("GlobalSearch", R.string.GlobalSearch)); } else { - ((SettingsSectionLayout) view).setText(LocaleController.getString("SearchMessages", R.string.SearchMessages)); + ((GreySectionCell) view).setText(LocaleController.getString("SearchMessages", R.string.SearchMessages)); } } else if (type == 0) { if (view == null) { - view = new ChatOrUserCell(mContext); + view = new ProfileSearchCell(mContext); } TLRPC.User user = null; @@ -385,9 +384,9 @@ public class MessagesActivitySearchAdapter extends BaseContactsSearchAdapter { TLRPC.EncryptedChat encryptedChat = null; int localCount = searchResult.size(); - int globalCount = globalSearch.isEmpty() ? -1 : globalSearch.size() + 1; + int globalCount = globalSearch.isEmpty() ? 0 : globalSearch.size() + 1; - ((ChatOrUserCell) view).useSeparator = (i != getCount() - 1 && i != localCount - 1 && i != localCount + globalCount - 1); + ((ProfileSearchCell) view).useSeparator = (i != getCount() - 1 && i != localCount - 1 && i != localCount + globalCount - 1); Object obj = getItem(i); if (obj instanceof TLRPC.User) { user = MessagesController.getInstance().getUser(((TLRPC.User) obj).id); @@ -413,14 +412,14 @@ public class MessagesActivitySearchAdapter extends BaseContactsSearchAdapter { } } else if (i > searchResult.size() && user != null && user.username != null) { try { - username = Html.fromHtml(String.format("@%s%s", user.username.substring(0, lastFoundUsername.length()), user.username.substring(lastFoundUsername.length()))); + username = Html.fromHtml(String.format("@%s%s", user.username.substring(0, lastFoundUsername.length()), user.username.substring(lastFoundUsername.length()))); } catch (Exception e) { username = user.username; FileLog.e("tmessages", e); } } - ((ChatOrUserCell) view).setData(user, chat, encryptedChat, name, username); + ((ProfileSearchCell) view).setData(user, chat, encryptedChat, name, username); } else if (type == 2) { if (view == null) { view = new DialogCell(mContext); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java index ec07f5044..dac69c9f6 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java @@ -70,7 +70,6 @@ public class DialogCell extends BaseCell { private int nameLeft; - private int nameTop = AndroidUtilities.dp(13); private StaticLayout nameLayout; private boolean drawNameLock; private boolean drawNameGroup; @@ -142,13 +141,13 @@ public class DialogCell extends BaseCell { countPaint.setColor(0xffffffff); countPaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); - lockDrawable = getResources().getDrawable(R.drawable.ic_lock_green); + lockDrawable = getResources().getDrawable(R.drawable.list_secret); checkDrawable = getResources().getDrawable(R.drawable.dialogs_check); halfCheckDrawable = getResources().getDrawable(R.drawable.dialogs_halfcheck); clockDrawable = getResources().getDrawable(R.drawable.msg_clock); errorDrawable = getResources().getDrawable(R.drawable.dialogs_warning); countDrawable = getResources().getDrawable(R.drawable.dialogs_badge); - groupDrawable = getResources().getDrawable(R.drawable.grouplist); + groupDrawable = getResources().getDrawable(R.drawable.list_group); broadcastDrawable = getResources().getDrawable(R.drawable.broadcast); } } @@ -217,7 +216,7 @@ public class DialogCell extends BaseCell { if (encryptedChat != null) { drawNameLock = true; - nameLockTop = AndroidUtilities.dp(15); + nameLockTop = AndroidUtilities.dp(16.5f); if (!LocaleController.isRTL) { nameLockLeft = AndroidUtilities.dp(72); nameLeft = AndroidUtilities.dp(76) + lockDrawable.getIntrinsicWidth(); @@ -229,10 +228,12 @@ public class DialogCell extends BaseCell { if (chat != null) { if (chat.id < 0) { drawNameBroadcast = true; + nameLockTop = AndroidUtilities.dp(16.5f); } else { drawNameGroup = true; + nameLockTop = AndroidUtilities.dp(17.5f); } - nameLockTop = AndroidUtilities.dp(16); + if (!LocaleController.isRTL) { nameLockLeft = AndroidUtilities.dp(72); nameLeft = AndroidUtilities.dp(76) + (drawNameGroup ? groupDrawable.getIntrinsicWidth() : broadcastDrawable.getIntrinsicWidth()); @@ -655,7 +656,7 @@ public class DialogCell extends BaseCell { if (nameLayout != null) { canvas.save(); - canvas.translate(nameLeft, nameTop); + canvas.translate(nameLeft, AndroidUtilities.dp(13)); nameLayout.draw(canvas); canvas.restore(); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DividerCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DividerCell.java new file mode 100644 index 000000000..55ce4d3fe --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DividerCell.java @@ -0,0 +1,36 @@ +/* + * This is the source code of Telegram for Android v. 1.7.x. + * It is licensed under GNU GPL v. 2 or later. + * You should have received a copy of the license in this archive (see LICENSE). + * + * Copyright Nikolai Kudashov, 2013-2014. + */ + +package org.telegram.ui.Cells; + +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Paint; + +import org.telegram.android.AndroidUtilities; + +public class DividerCell extends BaseCell { + + Paint paint = new Paint(); + + public DividerCell(Context context) { + super(context); + paint.setColor(0xffd9d9d9); + paint.setStrokeWidth(1); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), AndroidUtilities.dp(16) + 1); + } + + @Override + protected void onDraw(Canvas canvas) { + canvas.drawLine(getPaddingLeft(), AndroidUtilities.dp(8), getWidth() - getPaddingRight(), AndroidUtilities.dp(8), paint); + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCell.java index a61e4cceb..2a4d708fc 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCell.java @@ -30,13 +30,13 @@ public class DrawerActionCell extends FrameLayout { textView.setLines(1); textView.setMaxLines(1); textView.setSingleLine(true); - textView.setGravity(Gravity.LEFT | Gravity.CENTER); + textView.setGravity(Gravity.LEFT | Gravity.CENTER_VERTICAL); textView.setCompoundDrawablePadding(AndroidUtilities.dp(34)); addView(textView); LayoutParams layoutParams = (LayoutParams) textView.getLayoutParams(); layoutParams.width = LayoutParams.MATCH_PARENT; layoutParams.height = LayoutParams.MATCH_PARENT; - layoutParams.gravity = Gravity.LEFT | Gravity.BOTTOM; + layoutParams.gravity = Gravity.LEFT; layoutParams.leftMargin = AndroidUtilities.dp(14); layoutParams.rightMargin = AndroidUtilities.dp(16); textView.setLayoutParams(layoutParams); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerDividerCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerDividerCell.java deleted file mode 100644 index 05aca7ec4..000000000 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerDividerCell.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This is the source code of Telegram for Android v. 1.7.x. - * It is licensed under GNU GPL v. 2 or later. - * You should have received a copy of the license in this archive (see LICENSE). - * - * Copyright Nikolai Kudashov, 2013-2014. - */ - -package org.telegram.ui.Cells; - -import android.content.Context; -import android.widget.FrameLayout; - -public class DrawerDividerCell extends FrameLayout { - - public DrawerDividerCell(Context context) { - super(context); - setBackgroundColor(0xffd9d9d9); - } - - @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(1, MeasureSpec.EXACTLY)); - } -} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerEmptyCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/EmptyCell.java similarity index 73% rename from TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerEmptyCell.java rename to TMessagesProj/src/main/java/org/telegram/ui/Cells/EmptyCell.java index 4df169104..828e59271 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerEmptyCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/EmptyCell.java @@ -13,14 +13,17 @@ import android.widget.FrameLayout; import org.telegram.android.AndroidUtilities; -public class DrawerEmptyCell extends FrameLayout { +public class EmptyCell extends FrameLayout { - public DrawerEmptyCell(Context context) { + int cellHeight; + + public EmptyCell(Context context, int height) { super(context); + cellHeight = height; } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(8), MeasureSpec.EXACTLY)); + super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(cellHeight), MeasureSpec.EXACTLY)); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/GreySectionCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/GreySectionCell.java new file mode 100644 index 000000000..b13f3de75 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/GreySectionCell.java @@ -0,0 +1,70 @@ +/* + * This is the source code of Telegram for Android v. 1.7.x. + * It is licensed under GNU GPL v. 2 or later. + * You should have received a copy of the license in this archive (see LICENSE). + * + * Copyright Nikolai Kudashov, 2013-2014. + */ + +package org.telegram.ui.Cells; + +import android.content.Context; +import android.util.AttributeSet; +import android.util.TypedValue; +import android.view.Gravity; +import android.widget.FrameLayout; +import android.widget.TextView; + +import org.telegram.android.AndroidUtilities; +import org.telegram.android.LocaleController; + +public class GreySectionCell extends FrameLayout { + private TextView textView; + + private void init() { + setBackgroundColor(0xfff2f2f2); + + textView = new TextView(getContext()); + textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14); + textView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); + textView.setTextColor(0xff8a8a8a); + textView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL); + addView(textView); + FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams)textView.getLayoutParams(); + layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT; + layoutParams.height = FrameLayout.LayoutParams.MATCH_PARENT; + layoutParams.leftMargin = AndroidUtilities.dp(16); + layoutParams.rightMargin = AndroidUtilities.dp(16); + layoutParams.gravity = LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT; + textView.setLayoutParams(layoutParams); + } + + public GreySectionCell(Context context) { + super(context); + init(); + } + + public GreySectionCell(Context context, AttributeSet attrs) { + super(context, attrs); + init(); + } + + public GreySectionCell(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(); + } + + public GreySectionCell(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + init(); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(36), MeasureSpec.EXACTLY)); + } + + public void setText(String text) { + textView.setText(text); + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/LetterSectionCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/LetterSectionCell.java new file mode 100644 index 000000000..ad385f981 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/LetterSectionCell.java @@ -0,0 +1,43 @@ +/* + * This is the source code of Telegram for Android v. 1.7.x. + * It is licensed under GNU GPL v. 2 or later. + * You should have received a copy of the license in this archive (see LICENSE). + * + * Copyright Nikolai Kudashov, 2013-2014. + */ + +package org.telegram.ui.Cells; + +import android.content.Context; +import android.util.TypedValue; +import android.view.Gravity; +import android.view.ViewGroup; +import android.widget.FrameLayout; +import android.widget.TextView; + +import org.telegram.android.AndroidUtilities; + +public class LetterSectionCell extends FrameLayout { + + private TextView textView; + + public LetterSectionCell(Context context) { + super(context); + setLayoutParams(new ViewGroup.LayoutParams(AndroidUtilities.dp(54), AndroidUtilities.dp(64))); + + textView = new TextView(getContext()); + textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 22); + textView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); + textView.setTextColor(0xff808080); + textView.setGravity(Gravity.CENTER); + addView(textView); + FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams)textView.getLayoutParams(); + layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT; + layoutParams.height = FrameLayout.LayoutParams.MATCH_PARENT; + textView.setLayoutParams(layoutParams); + } + + public void setLetter(String letter) { + textView.setText(letter.toUpperCase()); + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatOrUserCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ProfileSearchCell.java similarity index 82% rename from TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatOrUserCell.java rename to TMessagesProj/src/main/java/org/telegram/ui/Cells/ProfileSearchCell.java index a705adc9a..7249674b0 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatOrUserCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ProfileSearchCell.java @@ -1,9 +1,9 @@ /* - * This is the source code of Telegram for Android v. 1.3.x. + * This is the source code of Telegram for Android v. 1.7.x. * It is licensed under GNU GPL v. 2 or later. * You should have received a copy of the license in this archive (see LICENSE). * - * Copyright Nikolai Kudashov, 2013. + * Copyright Nikolai Kudashov, 2013-2014. */ package org.telegram.ui.Cells; @@ -17,19 +17,19 @@ import android.text.StaticLayout; import android.text.TextPaint; import android.text.TextUtils; -import org.telegram.android.AndroidUtilities; import org.telegram.PhoneFormat.PhoneFormat; +import org.telegram.android.AndroidUtilities; import org.telegram.android.ContactsController; -import org.telegram.android.LocaleController; -import org.telegram.messenger.TLRPC; -import org.telegram.messenger.ConnectionsManager; -import org.telegram.android.MessagesController; -import org.telegram.messenger.R; -import org.telegram.messenger.UserConfig; import org.telegram.android.ImageReceiver; +import org.telegram.android.LocaleController; +import org.telegram.android.MessagesController; +import org.telegram.messenger.ConnectionsManager; +import org.telegram.messenger.R; +import org.telegram.messenger.TLRPC; +import org.telegram.messenger.UserConfig; import org.telegram.ui.Views.AvatarDrawable; -public class ChatOrUserCell extends BaseCell { +public class ProfileSearchCell extends BaseCell { private static TextPaint namePaint; private static TextPaint nameEncryptedPaint; private static TextPaint onlinePaint; @@ -52,7 +52,6 @@ public class ChatOrUserCell extends BaseCell { private int lastStatus = 0; private TLRPC.FileLocation lastAvatar = null; - public boolean usePadding = true; public boolean useSeparator = false; public float drawAlpha = 1; @@ -66,44 +65,44 @@ public class ChatOrUserCell extends BaseCell { private int nameLockTop; private int onlineLeft; - private int onlineTop = AndroidUtilities.dp(36); private StaticLayout onlineLayout; - private int avatarTop = AndroidUtilities.dp(7); - - public ChatOrUserCell(Context context) { + public ProfileSearchCell(Context context) { super(context); init(); avatarImage = new ImageReceiver(this); + avatarImage.setRoundRadius(AndroidUtilities.dp(26)); avatarDrawable = new AvatarDrawable(); } private void init() { if (namePaint == null) { namePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG); - namePaint.setTextSize(AndroidUtilities.dp(18)); + namePaint.setTextSize(AndroidUtilities.dp(17)); namePaint.setColor(0xff222222); + namePaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); nameEncryptedPaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG); - nameEncryptedPaint.setTextSize(AndroidUtilities.dp(18)); + nameEncryptedPaint.setTextSize(AndroidUtilities.dp(17)); nameEncryptedPaint.setColor(0xff00a60e); + nameEncryptedPaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); onlinePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG); - onlinePaint.setTextSize(AndroidUtilities.dp(15)); + onlinePaint.setTextSize(AndroidUtilities.dp(16)); onlinePaint.setColor(0xff316f9f); offlinePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG); - offlinePaint.setTextSize(AndroidUtilities.dp(15)); + offlinePaint.setTextSize(AndroidUtilities.dp(16)); offlinePaint.setColor(0xff999999); - lockDrawable = getResources().getDrawable(R.drawable.ic_lock_green); + lockDrawable = getResources().getDrawable(R.drawable.list_secret); linePaint = new Paint(); linePaint.setColor(0xffdcdcdc); broadcastDrawable = getResources().getDrawable(R.drawable.broadcast); - groupDrawable = getResources().getDrawable(R.drawable.grouplist); + groupDrawable = getResources().getDrawable(R.drawable.list_group); } } @@ -127,7 +126,7 @@ public class ChatOrUserCell extends BaseCell { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), AndroidUtilities.dp(64)); + setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), AndroidUtilities.dp(72)); } @Override @@ -152,33 +151,35 @@ public class ChatOrUserCell extends BaseCell { if (encryptedChat != null) { drawNameLock = true; if (!LocaleController.isRTL) { - nameLockLeft = AndroidUtilities.dp(61 + (usePadding ? 11 : 0)); - nameLeft = AndroidUtilities.dp(65 + (usePadding ? 11 : 0)) + lockDrawable.getIntrinsicWidth(); + nameLockLeft = AndroidUtilities.dp(72); + nameLeft = AndroidUtilities.dp(76) + lockDrawable.getIntrinsicWidth(); } else { - nameLockLeft = getMeasuredWidth() - AndroidUtilities.dp(63 + (usePadding ? 11 : 0)) - lockDrawable.getIntrinsicWidth(); - nameLeft = usePadding ? AndroidUtilities.dp(11) : 0; + nameLockLeft = getMeasuredWidth() - AndroidUtilities.dp(74) - lockDrawable.getIntrinsicWidth(); + nameLeft = AndroidUtilities.dp(11); } - nameLockTop = AndroidUtilities.dp(15); + nameLockTop = AndroidUtilities.dp(16.5f); } else { if (chat != null) { - nameLockTop = AndroidUtilities.dp(26); + if (chat.id < 0) { drawNameBroadcast = true; + nameLockTop = AndroidUtilities.dp(28.5f); } else { drawNameGroup = true; + nameLockTop = AndroidUtilities.dp(30); } if (!LocaleController.isRTL) { - nameLockLeft = AndroidUtilities.dp(61 + (usePadding ? 11 : 0)); - nameLeft = AndroidUtilities.dp(65 + (usePadding ? 11 : 0)) + (drawNameGroup ? groupDrawable.getIntrinsicWidth() : broadcastDrawable.getIntrinsicWidth()); + nameLockLeft = AndroidUtilities.dp(72); + nameLeft = AndroidUtilities.dp(76) + (drawNameGroup ? groupDrawable.getIntrinsicWidth() : broadcastDrawable.getIntrinsicWidth()); } else { - nameLockLeft = getMeasuredWidth() - AndroidUtilities.dp(63 + (usePadding ? 11 : 0)) - (drawNameGroup ? groupDrawable.getIntrinsicWidth() : broadcastDrawable.getIntrinsicWidth()); - nameLeft = usePadding ? AndroidUtilities.dp(11) : 0; + nameLockLeft = getMeasuredWidth() - AndroidUtilities.dp(74) - (drawNameGroup ? groupDrawable.getIntrinsicWidth() : broadcastDrawable.getIntrinsicWidth()); + nameLeft = AndroidUtilities.dp(11); } } else { if (!LocaleController.isRTL) { - nameLeft = AndroidUtilities.dp(61 + (usePadding ? 11 : 0)); + nameLeft = AndroidUtilities.dp(72); } else { - nameLeft = usePadding ? AndroidUtilities.dp(11) : 0; + nameLeft = AndroidUtilities.dp(11); } } } @@ -210,14 +211,16 @@ public class ChatOrUserCell extends BaseCell { int onlineWidth; int nameWidth; if (!LocaleController.isRTL) { - onlineWidth = nameWidth = getMeasuredWidth() - nameLeft - AndroidUtilities.dp(3 + (usePadding ? 11 : 0)); + onlineWidth = nameWidth = getMeasuredWidth() - nameLeft - AndroidUtilities.dp(14); } else { - onlineWidth = nameWidth = getMeasuredWidth() - nameLeft - AndroidUtilities.dp(61 + (usePadding ? 11 : 0)); + onlineWidth = nameWidth = getMeasuredWidth() - nameLeft - AndroidUtilities.dp(72); } if (drawNameLock) { nameWidth -= AndroidUtilities.dp(6) + lockDrawable.getIntrinsicWidth(); } else if (drawNameBroadcast) { nameWidth -= AndroidUtilities.dp(6) + broadcastDrawable.getIntrinsicWidth(); + } else if (drawNameGroup) { + nameWidth -= AndroidUtilities.dp(6) + groupDrawable.getIntrinsicWidth(); } CharSequence nameStringFinal = TextUtils.ellipsize(nameString, currentNamePaint, nameWidth - AndroidUtilities.dp(12), TextUtils.TruncateAt.END); @@ -225,9 +228,9 @@ public class ChatOrUserCell extends BaseCell { if (chat == null) { if (!LocaleController.isRTL) { - onlineLeft = AndroidUtilities.dp(61 + (usePadding ? 11 : 0)); + onlineLeft = AndroidUtilities.dp(72); } else { - onlineLeft = usePadding ? AndroidUtilities.dp(11) : 0; + onlineLeft = AndroidUtilities.dp(11); } CharSequence onlineString = ""; @@ -243,22 +246,22 @@ public class ChatOrUserCell extends BaseCell { } } - CharSequence onlineStringFinal = TextUtils.ellipsize(onlineString, currentOnlinePaint, nameWidth - AndroidUtilities.dp(12), TextUtils.TruncateAt.END); - onlineLayout = new StaticLayout(onlineStringFinal, currentOnlinePaint, nameWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); - nameTop = AndroidUtilities.dp(12); + CharSequence onlineStringFinal = TextUtils.ellipsize(onlineString, currentOnlinePaint, onlineWidth - AndroidUtilities.dp(12), TextUtils.TruncateAt.END); + onlineLayout = new StaticLayout(onlineStringFinal, currentOnlinePaint, onlineWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); + nameTop = AndroidUtilities.dp(13); } else { onlineLayout = null; - nameTop = AndroidUtilities.dp(22); + nameTop = AndroidUtilities.dp(25); } int avatarLeft; if (!LocaleController.isRTL) { - avatarLeft = usePadding ? AndroidUtilities.dp(11) : 0; + avatarLeft = AndroidUtilities.dp(9); } else { - avatarLeft = getMeasuredWidth() - AndroidUtilities.dp(50 + (usePadding ? 11 : 0)); + avatarLeft = getMeasuredWidth() - AndroidUtilities.dp(61); } - avatarImage.setImageCoords(avatarLeft, avatarTop, AndroidUtilities.dp(50), AndroidUtilities.dp(50)); + avatarImage.setImageCoords(avatarLeft, AndroidUtilities.dp(10), AndroidUtilities.dp(52), AndroidUtilities.dp(52)); double widthpx = 0; float left = 0; @@ -382,11 +385,10 @@ public class ChatOrUserCell extends BaseCell { } if (useSeparator) { - int h = getMeasuredHeight(); - if (!usePadding) { - canvas.drawLine(0, h - 1, getMeasuredWidth(), h - 1, linePaint); + if (LocaleController.isRTL) { + canvas.drawLine(0, getMeasuredHeight() - 1, getMeasuredWidth() - AndroidUtilities.dp(72), getMeasuredHeight() - 1, linePaint); } else { - canvas.drawLine(AndroidUtilities.dp(11), h - 1, getMeasuredWidth() - AndroidUtilities.dp(11), h - 1, linePaint); + canvas.drawLine(AndroidUtilities.dp(72), getMeasuredHeight() - 1, getMeasuredWidth(), getMeasuredHeight() - 1, linePaint); } } @@ -412,7 +414,7 @@ public class ChatOrUserCell extends BaseCell { if (onlineLayout != null) { canvas.save(); - canvas.translate(onlineLeft, onlineTop); + canvas.translate(onlineLeft, AndroidUtilities.dp(40)); onlineLayout.draw(canvas); canvas.restore(); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCell.java new file mode 100644 index 000000000..f51b48bad --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCell.java @@ -0,0 +1,126 @@ +/* + * This is the source code of Telegram for Android v. 1.7.x. + * It is licensed under GNU GPL v. 2 or later. + * You should have received a copy of the license in this archive (see LICENSE). + * + * Copyright Nikolai Kudashov, 2013-2014. + */ + +package org.telegram.ui.Cells; + +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.util.TypedValue; +import android.view.Gravity; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.TextView; + +import org.telegram.android.AndroidUtilities; +import org.telegram.android.LocaleController; + +public class TextCell extends FrameLayout { + + private TextView textView; + private TextView valueTextView; + private ImageView imageView; + private ImageView valueImageView; + + public TextCell(Context context) { + super(context); + + textView = new TextView(context); + textView.setTextColor(0xff000000); + textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); + textView.setLines(1); + textView.setMaxLines(1); + textView.setSingleLine(true); + textView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL); + addView(textView); + LayoutParams layoutParams = (LayoutParams) textView.getLayoutParams(); + layoutParams.width = LayoutParams.MATCH_PARENT; + layoutParams.height = LayoutParams.MATCH_PARENT; + layoutParams.leftMargin = AndroidUtilities.dp(LocaleController.isRTL ? 16 : 71); + layoutParams.rightMargin = AndroidUtilities.dp(LocaleController.isRTL ? 71 : 16); + layoutParams.gravity = LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT; + textView.setLayoutParams(layoutParams); + + valueTextView = new TextView(context); + valueTextView.setTextColor(0xff2f8cc9); + valueTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); + valueTextView.setLines(1); + valueTextView.setMaxLines(1); + valueTextView.setSingleLine(true); + valueTextView.setGravity((LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.CENTER_VERTICAL); + addView(valueTextView); + layoutParams = (LayoutParams) valueTextView.getLayoutParams(); + layoutParams.width = LayoutParams.WRAP_CONTENT; + layoutParams.height = LayoutParams.MATCH_PARENT; + layoutParams.leftMargin = AndroidUtilities.dp(LocaleController.isRTL ? 16 : 0); + layoutParams.rightMargin = AndroidUtilities.dp(LocaleController.isRTL ? 0 : 16); + layoutParams.gravity = LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT; + valueTextView.setLayoutParams(layoutParams); + + imageView = new ImageView(context); + imageView.setScaleType(ImageView.ScaleType.CENTER); + addView(imageView); + layoutParams = (LayoutParams) imageView.getLayoutParams(); + layoutParams.width = LayoutParams.WRAP_CONTENT; + layoutParams.height = LayoutParams.WRAP_CONTENT; + layoutParams.leftMargin = AndroidUtilities.dp(LocaleController.isRTL ? 0 : 16); + layoutParams.rightMargin = AndroidUtilities.dp(LocaleController.isRTL ? 16 : 0); + layoutParams.gravity = (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL; + imageView.setLayoutParams(layoutParams); + + valueImageView = new ImageView(context); + valueImageView.setScaleType(ImageView.ScaleType.CENTER); + addView(valueImageView); + layoutParams = (LayoutParams) valueImageView.getLayoutParams(); + layoutParams.width = LayoutParams.WRAP_CONTENT; + layoutParams.height = LayoutParams.WRAP_CONTENT; + layoutParams.leftMargin = AndroidUtilities.dp(LocaleController.isRTL ? 16 : 0); + layoutParams.rightMargin = AndroidUtilities.dp(LocaleController.isRTL ? 0 : 16); + layoutParams.gravity = (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.CENTER_VERTICAL; + valueImageView.setLayoutParams(layoutParams); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(48), MeasureSpec.EXACTLY)); + } + + public void setTextColor(int color) { + textView.setTextColor(color); + } + + public void setText(String text) { + textView.setText(text); + imageView.setVisibility(GONE); + valueTextView.setVisibility(GONE); + valueImageView.setVisibility(GONE); + } + + public void setTextAndIcon(String text, int resId) { + textView.setText(text); + imageView.setImageResource(resId); + imageView.setVisibility(VISIBLE); + valueTextView.setVisibility(GONE); + valueImageView.setVisibility(GONE); + } + + public void setTextAndValue(String text, String value) { + textView.setText(text); + valueTextView.setText(value); + valueTextView.setVisibility(VISIBLE); + imageView.setVisibility(GONE); + valueImageView.setVisibility(GONE); + } + + public void setTextAndValueDrawable(String text, Drawable drawable) { + textView.setText(text); + valueImageView.setVisibility(VISIBLE); + valueImageView.setImageDrawable(drawable); + valueTextView.setVisibility(GONE); + imageView.setVisibility(GONE); + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextDetailCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextDetailCell.java new file mode 100644 index 000000000..1854a990a --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextDetailCell.java @@ -0,0 +1,94 @@ +/* + * This is the source code of Telegram for Android v. 1.7.x. + * It is licensed under GNU GPL v. 2 or later. + * You should have received a copy of the license in this archive (see LICENSE). + * + * Copyright Nikolai Kudashov, 2013-2014. + */ + +package org.telegram.ui.Cells; + +import android.content.Context; +import android.util.TypedValue; +import android.view.Gravity; +import android.view.View; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.TextView; + +import org.telegram.android.AndroidUtilities; +import org.telegram.android.LocaleController; + +public class TextDetailCell extends FrameLayout { + + private TextView textView; + private TextView valueTextView; + private ImageView imageView; + + public TextDetailCell(Context context) { + super(context); + + textView = new TextView(context); + textView.setTextColor(0xff000000); + textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); + textView.setLines(1); + textView.setMaxLines(1); + textView.setSingleLine(true); + textView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL); + addView(textView); + FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) textView.getLayoutParams(); + layoutParams.width = LayoutParams.WRAP_CONTENT; + layoutParams.height = LayoutParams.WRAP_CONTENT; + layoutParams.topMargin = AndroidUtilities.dp(11); + layoutParams.leftMargin = AndroidUtilities.dp(LocaleController.isRTL ? 16 : 71); + layoutParams.rightMargin = AndroidUtilities.dp(LocaleController.isRTL ? 71 : 16); + layoutParams.gravity = LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT; + textView.setLayoutParams(layoutParams); + + valueTextView = new TextView(context); + valueTextView.setTextColor(0xff8a8a8a); + valueTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13); + valueTextView.setLines(1); + valueTextView.setMaxLines(1); + valueTextView.setSingleLine(true); + valueTextView.setGravity((LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.CENTER_VERTICAL); + addView(valueTextView); + layoutParams = (FrameLayout.LayoutParams) valueTextView.getLayoutParams(); + layoutParams.width = LayoutParams.WRAP_CONTENT; + layoutParams.height = LayoutParams.WRAP_CONTENT; + layoutParams.topMargin = AndroidUtilities.dp(36); + layoutParams.leftMargin = AndroidUtilities.dp(LocaleController.isRTL ? 16 : 71); + layoutParams.rightMargin = AndroidUtilities.dp(LocaleController.isRTL ? 71 : 16); + layoutParams.gravity = LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT; + valueTextView.setLayoutParams(layoutParams); + + imageView = new ImageView(context); + imageView.setScaleType(ImageView.ScaleType.CENTER); + addView(imageView); + layoutParams = (LayoutParams) imageView.getLayoutParams(); + layoutParams.width = LayoutParams.WRAP_CONTENT; + layoutParams.height = LayoutParams.WRAP_CONTENT; + layoutParams.leftMargin = AndroidUtilities.dp(LocaleController.isRTL ? 0 : 16); + layoutParams.rightMargin = AndroidUtilities.dp(LocaleController.isRTL ? 16 : 0); + layoutParams.gravity = (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL; + imageView.setLayoutParams(layoutParams); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, View.MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(64), View.MeasureSpec.EXACTLY)); + } + + public void setTextAndValue(String text, String value) { + textView.setText(text); + valueTextView.setText(value); + imageView.setVisibility(GONE); + } + + public void setTextAndValueAndIcon(String text, String value, int resId) { + textView.setText(text); + valueTextView.setText(value); + imageView.setVisibility(VISIBLE); + imageView.setImageResource(resId); + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/UserCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/UserCell.java new file mode 100644 index 000000000..585114313 --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/UserCell.java @@ -0,0 +1,302 @@ +/* + * This is the source code of Telegram for Android v. 1.3.x. + * It is licensed under GNU GPL v. 2 or later. + * You should have received a copy of the license in this archive (see LICENSE). + * + * Copyright Nikolai Kudashov, 2013. + */ + +package org.telegram.ui.Cells; + +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.text.Layout; +import android.text.StaticLayout; +import android.text.TextPaint; +import android.text.TextUtils; + +import org.telegram.android.AndroidUtilities; +import org.telegram.PhoneFormat.PhoneFormat; +import org.telegram.android.ContactsController; +import org.telegram.android.LocaleController; +import org.telegram.messenger.TLRPC; +import org.telegram.messenger.ConnectionsManager; +import org.telegram.android.MessagesController; +import org.telegram.messenger.R; +import org.telegram.messenger.UserConfig; +import org.telegram.android.ImageReceiver; +import org.telegram.ui.Views.AvatarDrawable; + +public class UserCell extends BaseCell { + private static TextPaint namePaint; + private static TextPaint onlinePaint; + private static TextPaint offlinePaint; + private static Paint linePaint; + + private CharSequence currentName; + private ImageReceiver avatarImage; + private AvatarDrawable avatarDrawable; + private CharSequence subLabel; + + private TLRPC.User user = null; + + private String lastName = null; + private int lastStatus = 0; + private TLRPC.FileLocation lastAvatar = null; + + public boolean useSeparator = false; + public float drawAlpha = 1; + + private int nameLeft; + private int nameTop; + private StaticLayout nameLayout; + + private int onlineLeft; + private int onlineTop = AndroidUtilities.dp(36); + private StaticLayout onlineLayout; + + public UserCell(Context context) { + super(context); + init(); + avatarImage = new ImageReceiver(this); + avatarImage.setRoundRadius(AndroidUtilities.dp(24)); + avatarDrawable = new AvatarDrawable(); + } + + private void init() { + if (namePaint == null) { + namePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG); + namePaint.setTextSize(AndroidUtilities.dp(18)); + namePaint.setColor(0xff222222); + + onlinePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG); + onlinePaint.setTextSize(AndroidUtilities.dp(15)); + onlinePaint.setColor(0xff316f9f); + + offlinePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG); + offlinePaint.setTextSize(AndroidUtilities.dp(15)); + offlinePaint.setColor(0xff999999); + + linePaint = new Paint(); + linePaint.setColor(0xffdcdcdc); + } + } + + public void setData(TLRPC.User u, CharSequence n, CharSequence s) { + currentName = n; + user = u; + subLabel = s; + update(0); + } + + @Override + protected void onDetachedFromWindow() { + super.onDetachedFromWindow(); + if (avatarImage != null) { + avatarImage.clearImage(); + lastAvatar = null; + } + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec) - getPaddingRight(), AndroidUtilities.dp(64)); + } + + @Override + protected void onLayout(boolean changed, int left, int top, int right, int bottom) { + if (user == null) { + super.onLayout(changed, left, top, right, bottom); + return; + } + if (changed) { + buildLayout(); + } + } + + public void buildLayout() { + int paddingLeft = getPaddingLeft(); + int paddingRight = getPaddingRight(); + + onlineLeft = nameLeft = AndroidUtilities.dp(LocaleController.isRTL ? 11 : 72) + paddingLeft; + int avatarLeft = paddingLeft + (LocaleController.isRTL ? (getMeasuredWidth() - AndroidUtilities.dp(61)) : AndroidUtilities.dp(11)); + int nameWidth = getMeasuredWidth() - nameLeft - AndroidUtilities.dp(LocaleController.isRTL ? 72 : 14); + int avatarTop = AndroidUtilities.dp(8); + + CharSequence nameString = ""; + if (currentName != null) { + nameString = currentName; + } else { + String nameString2 = ""; + if (user != null) { + nameString2 = ContactsController.formatName(user.first_name, user.last_name); + } + nameString = nameString2.replace("\n", " "); + } + if (nameString.length() == 0) { + if (user != null && user.phone != null && user.phone.length() != 0) { + nameString = PhoneFormat.getInstance().format("+" + user.phone); + } else { + nameString = LocaleController.getString("HiddenName", R.string.HiddenName); + } + } + CharSequence nameStringFinal = TextUtils.ellipsize(nameString, namePaint, nameWidth - AndroidUtilities.dp(12), TextUtils.TruncateAt.END); + nameLayout = new StaticLayout(nameStringFinal, namePaint, nameWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); + + CharSequence onlineString = ""; + TextPaint currentOnlinePaint = offlinePaint; + if (subLabel != null) { + onlineString = subLabel; + } else { + onlineString = LocaleController.formatUserStatus(user); + if (user != null && (user.id == UserConfig.getClientUserId() || user.status != null && user.status.expires > ConnectionsManager.getInstance().getCurrentTime())) { + currentOnlinePaint = onlinePaint; + onlineString = LocaleController.getString("Online", R.string.Online); + } + } + + CharSequence onlineStringFinal = TextUtils.ellipsize(onlineString, currentOnlinePaint, nameWidth - AndroidUtilities.dp(12), TextUtils.TruncateAt.END); + onlineLayout = new StaticLayout(onlineStringFinal, currentOnlinePaint, nameWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); + nameTop = AndroidUtilities.dp(12); + + avatarImage.setImageCoords(avatarLeft, avatarTop, AndroidUtilities.dp(48), AndroidUtilities.dp(48)); + + double widthpx = 0; + float left = 0; + if (LocaleController.isRTL) { + if (nameLayout.getLineCount() > 0) { + left = nameLayout.getLineLeft(0); + if (left == 0) { + widthpx = Math.ceil(nameLayout.getLineWidth(0)); + if (widthpx < nameWidth) { + nameLeft += (nameWidth - widthpx); + } + } + } + if (onlineLayout != null && onlineLayout.getLineCount() > 0) { + left = onlineLayout.getLineLeft(0); + if (left == 0) { + widthpx = Math.ceil(onlineLayout.getLineWidth(0)); + if (widthpx < nameWidth) { + onlineLeft += (nameWidth - widthpx); + } + } + } + } else { + if (nameLayout.getLineCount() > 0) { + left = nameLayout.getLineRight(0); + if (left == nameWidth) { + widthpx = Math.ceil(nameLayout.getLineWidth(0)); + if (widthpx < nameWidth) { + nameLeft -= (nameWidth - widthpx); + } + } + } + if (onlineLayout != null && onlineLayout.getLineCount() > 0) { + left = onlineLayout.getLineRight(0); + if (left == nameWidth) { + widthpx = Math.ceil(onlineLayout.getLineWidth(0)); + if (widthpx < nameWidth) { + onlineLeft -= (nameWidth - widthpx); + } + } + } + } + } + + public void update(int mask) { + TLRPC.FileLocation photo = null; + if (user != null) { + if (user.photo != null) { + photo = user.photo.photo_small; + } + avatarDrawable.setInfo(user); + } else { + avatarDrawable.setInfo(0, null, null, false); + } + + if (mask != 0) { + boolean continueUpdate = false; + if ((mask & MessagesController.UPDATE_MASK_AVATAR) != 0 && user != null) { + if (lastAvatar != null && photo == null || lastAvatar == null && photo != null && lastAvatar != null && photo != null && (lastAvatar.volume_id != photo.volume_id || lastAvatar.local_id != photo.local_id)) { + continueUpdate = true; + } + } + if (!continueUpdate && (mask & MessagesController.UPDATE_MASK_STATUS) != 0 && user != null) { + int newStatus = 0; + if (user.status != null) { + newStatus = user.status.expires; + } + if (newStatus != lastStatus) { + continueUpdate = true; + } + } + if (!continueUpdate && (mask & MessagesController.UPDATE_MASK_NAME) != 0 && user != null) { + String newName = null; + if (user != null) { + newName = user.first_name + user.last_name; + } + if (newName == null || !newName.equals(lastName)) { + continueUpdate = true; + } + } + + if (!continueUpdate) { + return; + } + } + + if (user != null) { + if (user.status != null) { + lastStatus = user.status.expires; + } else { + lastStatus = 0; + } + lastName = user.first_name + user.last_name; + } + + lastAvatar = photo; + avatarImage.setImage(photo, "50_50", avatarDrawable, false); + + if (getMeasuredWidth() != 0 || getMeasuredHeight() != 0) { + buildLayout(); + } else { + requestLayout(); + } + postInvalidate(); + } + + @Override + protected void onDraw(Canvas canvas) { + if (user == null) { + return; + } + + if (useSeparator) { + if (LocaleController.isRTL) { + canvas.drawLine(0, getMeasuredHeight() - 1, getMeasuredWidth() - AndroidUtilities.dp(72), getMeasuredHeight() - 1, linePaint); + } else { + canvas.drawLine(AndroidUtilities.dp(72), getMeasuredHeight() - 1, getMeasuredWidth(), getMeasuredHeight() - 1, linePaint); + } + } + + if (drawAlpha != 1) { + canvas.saveLayerAlpha(0, 0, canvas.getWidth(), canvas.getHeight(), (int)(255 * drawAlpha), Canvas.HAS_ALPHA_LAYER_SAVE_FLAG); + } + + canvas.save(); + canvas.translate(nameLeft, nameTop); + nameLayout.draw(canvas); + canvas.restore(); + + if (onlineLayout != null) { + canvas.save(); + canvas.translate(onlineLeft, onlineTop); + onlineLayout.draw(canvas); + canvas.restore(); + } + + avatarImage.draw(canvas); + } +} diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index e933bb6f4..d5e8630da 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -436,7 +436,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not if (currentEncryptedChat != null) { MediaController.getInstance().stopMediaObserver(); } - + getParentActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); AndroidUtilities.unlockOrientation(getParentActivity()); MediaController.getInstance().stopAudio(); } @@ -555,7 +555,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not if (currentEncryptedChat != null) { args.putLong("dialog_id", dialog_id); } - presentFragment(new UserProfileActivity(args)); + presentFragment(new ProfileActivity(args)); } else if (currentChat != null) { if (info != null && info instanceof TLRPC.TL_chatParticipantsForbidden) { return; @@ -2383,6 +2383,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not public void onResume() { super.onResume(); + if (parentLayout != null) { + parentLayout.getDrawerLayoutContainer().setStatusBarColor(0xff54759e); + } getParentActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); checkActionBarMenu(); @@ -2459,7 +2462,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not @Override public void onPause() { super.onPause(); - getParentActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); actionBarLayer.hideActionMode(); chatActivityEnterView.hideEmojiPopup(); paused = true; @@ -3127,7 +3129,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not if (user != null && user.id != UserConfig.getClientUserId()) { Bundle args = new Bundle(); args.putInt("user_id", user.id); - presentFragment(new UserProfileActivity(args)); + presentFragment(new ProfileActivity(args)); } } @@ -3315,7 +3317,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not if (uid != UserConfig.getClientUserId()) { Bundle args = new Bundle(); args.putInt("user_id", uid); - presentFragment(new UserProfileActivity(args)); + presentFragment(new ProfileActivity(args)); } } }); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java index 38725543e..f58ead169 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java @@ -36,7 +36,7 @@ import org.telegram.messenger.UserConfig; import org.telegram.messenger.Utilities; import org.telegram.android.MessageObject; import org.telegram.ui.Adapters.BaseFragmentAdapter; -import org.telegram.ui.Cells.ChatOrUserCell; +import org.telegram.ui.Cells.UserCell; import org.telegram.ui.Views.ActionBar.ActionBarLayer; import org.telegram.ui.Views.ActionBar.ActionBarMenu; import org.telegram.ui.Views.AvatarDrawable; @@ -257,7 +257,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen } Bundle args = new Bundle(); args.putInt("user_id", user_id); - presentFragment(new UserProfileActivity(args)); + presentFragment(new ProfileActivity(args)); } else if (i == settingsNotificationsRow) { Bundle args = new Bundle(); args.putLong("dialog_id", -chat_id); @@ -403,8 +403,8 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen int count = listView.getChildCount(); for (int a = 0; a < count; a++) { View child = listView.getChildAt(a); - if (child instanceof ChatOrUserCell) { - ((ChatOrUserCell) child).update(mask); + if (child instanceof UserCell) { + ((UserCell) child).update(mask); } } } @@ -476,7 +476,6 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen Bundle args = new Bundle(); args.putBoolean("onlyUsers", true); args.putBoolean("destroyAfterSelect", true); - args.putBoolean("usersAsSections", true); args.putBoolean("returnAsResult", true); //args.putBoolean("allowUsernameSearch", false); if (chat_id > 0) { @@ -633,7 +632,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen } if (count != 0 && onlineCount > 1) { - onlineText.setText(Html.fromHtml(String.format("%s, %s", LocaleController.formatPluralString("Members", count), LocaleController.formatPluralString("Online", onlineCount)))); + onlineText.setText(Html.fromHtml(String.format("%s, %s", LocaleController.formatPluralString("Members", count), LocaleController.formatPluralString("Online", onlineCount)))); } else { onlineText.setText(LocaleController.formatPluralString("Members", count)); } @@ -685,12 +684,11 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen TLRPC.User user = MessagesController.getInstance().getUser(part.user_id); if (view == null) { - view = new ChatOrUserCell(mContext); - ((ChatOrUserCell)view).usePadding = false; - ((ChatOrUserCell)view).useSeparator = true; + view = new UserCell(mContext); + ((UserCell)view).useSeparator = true; } - ((ChatOrUserCell)view).setData(user, null, null, null, null); + ((UserCell)view).setData(user, null, null); } else if (type == 4) { if (view == null) { LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java index 79bfe6efe..583319f97 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java @@ -8,11 +8,9 @@ package org.telegram.ui; -import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; -import android.content.SharedPreferences; import android.net.Uri; import android.os.Build; import android.os.Bundle; @@ -33,48 +31,43 @@ import android.widget.TextView; import org.telegram.android.AndroidUtilities; import org.telegram.android.LocaleController; import org.telegram.android.MessagesStorage; -import org.telegram.messenger.TLObject; import org.telegram.messenger.TLRPC; -import org.telegram.messenger.ConnectionsManager; import org.telegram.android.ContactsController; import org.telegram.messenger.FileLog; import org.telegram.android.MessagesController; import org.telegram.android.NotificationCenter; import org.telegram.messenger.R; -import org.telegram.messenger.RPCRequest; import org.telegram.messenger.UserConfig; +import org.telegram.ui.Adapters.BaseSectionsAdapter; import org.telegram.ui.Adapters.ContactsActivityAdapter; import org.telegram.ui.Adapters.ContactsActivitySearchAdapter; -import org.telegram.ui.Cells.ChatOrUserCell; +import org.telegram.ui.Cells.UserCell; import org.telegram.ui.Views.ActionBar.ActionBarLayer; import org.telegram.ui.Views.ActionBar.ActionBarMenu; import org.telegram.ui.Views.ActionBar.ActionBarMenuItem; import org.telegram.ui.Views.ActionBar.BaseFragment; -import org.telegram.ui.Views.PinnedHeaderListView; -import org.telegram.ui.Views.SectionedBaseAdapter; +import org.telegram.ui.Views.SectionsListView; import java.util.ArrayList; import java.util.HashMap; -import java.util.Locale; public class ContactsActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate { - private SectionedBaseAdapter listViewAdapter; - private PinnedHeaderListView listView; + + private BaseSectionsAdapter listViewAdapter; + private TextView emptyTextView; + private SectionsListView listView; private ContactsActivitySearchAdapter searchListViewAdapter; + private boolean searchWas; private boolean searching; private boolean onlyUsers; - private boolean usersAsSections; + private boolean needPhonebook; private boolean destroyAfterSelect; private boolean returnAsResult; private boolean createSecretChat; private boolean creatingChat = false; private String selectAlertString = null; - private TextView emptyTextView; private HashMap ignoreUsers; - - private String inviteText; - private boolean updatingInviteText = false; private boolean allowUsernameSearch = true; private ContactsActivityDelegate delegate; @@ -96,19 +89,15 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter if (arguments != null) { onlyUsers = getArguments().getBoolean("onlyUsers", false); destroyAfterSelect = arguments.getBoolean("destroyAfterSelect", false); - usersAsSections = arguments.getBoolean("usersAsSections", false); returnAsResult = arguments.getBoolean("returnAsResult", false); createSecretChat = arguments.getBoolean("createSecretChat", false); selectAlertString = arguments.getString("selectAlertString"); allowUsernameSearch = arguments.getBoolean("allowUsernameSearch", true); + } else { + needPhonebook = true; } - SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); - inviteText = preferences.getString("invitetext", null); - int time = preferences.getInt("invitetexttime", 0); - if (inviteText == null || time + 86400 < (int)(System.currentTimeMillis() / 1000)) { - updateInviteText(); - } + ContactsController.getInstance().checkInviteText(); return true; } @@ -125,6 +114,9 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { + searching = false; + searchWas = false; + actionBarLayer.setBackButtonImage(R.drawable.ic_ab_back); actionBarLayer.setBackOverlay(R.layout.updating_state_layout); if (destroyAfterSelect) { @@ -157,7 +149,6 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter ViewGroup group = (ViewGroup) listView.getParent(); listView.setAdapter(listViewAdapter); listViewAdapter.notifyDataSetChanged(); - listView.setPadding(AndroidUtilities.dp(LocaleController.isRTL ? 30 : 16), listView.getPaddingTop(), AndroidUtilities.dp(LocaleController.isRTL ? 16 : 30), listView.getPaddingBottom()); if (android.os.Build.VERSION.SDK_INT >= 11) { listView.setFastScrollAlwaysVisible(true); } @@ -176,7 +167,6 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter if (text.length() != 0) { searchWas = true; if (listView != null) { - listView.setPadding(AndroidUtilities.dp(16), listView.getPaddingTop(), AndroidUtilities.dp(16), listView.getPaddingBottom()); listView.setAdapter(searchListViewAdapter); searchListViewAdapter.notifyDataSetChanged(); if(android.os.Build.VERSION.SDK_INT >= 11) { @@ -193,31 +183,48 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter } }); - searching = false; - searchWas = false; - - fragmentView = inflater.inflate(R.layout.contacts_layout, container, false); - - emptyTextView = (TextView)fragmentView.findViewById(R.id.searchEmptyView); - emptyTextView.setText(LocaleController.getString("NoContacts", R.string.NoContacts)); searchListViewAdapter = new ContactsActivitySearchAdapter(getParentActivity(), ignoreUsers, allowUsernameSearch); + listViewAdapter = new ContactsActivityAdapter(getParentActivity(), onlyUsers, needPhonebook, ignoreUsers); - listView = (PinnedHeaderListView)fragmentView.findViewById(R.id.listView); - listView.setEmptyView(emptyTextView); - listView.setPadding(AndroidUtilities.dp(LocaleController.isRTL ? 30 : 16), listView.getPaddingTop(), AndroidUtilities.dp(LocaleController.isRTL ? 16 : 30), listView.getPaddingBottom()); - if (Build.VERSION.SDK_INT >= 11) { - listView.setVerticalScrollbarPosition(LocaleController.isRTL ? ListView.SCROLLBAR_POSITION_LEFT : ListView.SCROLLBAR_POSITION_RIGHT); - } + fragmentView = new FrameLayout(getParentActivity()); + + emptyTextView = new TextView(getParentActivity()); + emptyTextView.setTextColor(0xff808080); + emptyTextView.setTextSize(24); + emptyTextView.setGravity(Gravity.CENTER); + emptyTextView.setVisibility(View.INVISIBLE); + emptyTextView.setText(LocaleController.getString("NoContacts", R.string.NoContacts)); + ((FrameLayout) fragmentView).addView(emptyTextView); + FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) emptyTextView.getLayoutParams(); + layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT; + layoutParams.height = FrameLayout.LayoutParams.MATCH_PARENT; + layoutParams.gravity = Gravity.TOP; + emptyTextView.setLayoutParams(layoutParams); emptyTextView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return true; } }); - listView.setVerticalScrollBarEnabled(false); - listViewAdapter = new ContactsActivityAdapter(getParentActivity(), onlyUsers, usersAsSections, ignoreUsers); + listView = new SectionsListView(getParentActivity()); + listView.setEmptyView(emptyTextView); + listView.setVerticalScrollBarEnabled(false); + listView.setDivider(null); + listView.setDividerHeight(0); + listView.setFastScrollEnabled(true); + listView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY); listView.setAdapter(listViewAdapter); + if (Build.VERSION.SDK_INT >= 11) { + listView.setFastScrollAlwaysVisible(true); + listView.setVerticalScrollbarPosition(LocaleController.isRTL ? ListView.SCROLLBAR_POSITION_LEFT : ListView.SCROLLBAR_POSITION_RIGHT); + } + ((FrameLayout) fragmentView).addView(listView); + layoutParams = (FrameLayout.LayoutParams) listView.getLayoutParams(); + layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT; + layoutParams.height = FrameLayout.LayoutParams.MATCH_PARENT; + listView.setLayoutParams(layoutParams); + listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView adapterView, View view, int i, long l) { @@ -253,86 +260,84 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter if (row < 0 || section < 0) { return; } - TLRPC.User user = null; - if (usersAsSections) { - if (section < ContactsController.getInstance().sortedUsersSectionsArray.size()) { - ArrayList arr = ContactsController.getInstance().usersSectionsDict.get(ContactsController.getInstance().sortedUsersSectionsArray.get(section)); - if (row < arr.size()) { - TLRPC.TL_contact contact = arr.get(row); - user = MessagesController.getInstance().getUser(contact.user_id); - } else { - return; - } - } - } else { - if (section == 0) { + if (!onlyUsers && section == 0) { + if (needPhonebook) { if (row == 0) { try { Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); - intent.putExtra(Intent.EXTRA_TEXT, inviteText != null ? inviteText : LocaleController.getString("InviteText", R.string.InviteText)); + intent.putExtra(Intent.EXTRA_TEXT, ContactsController.getInstance().getInviteText()); getParentActivity().startActivity(intent); } catch (Exception e) { FileLog.e("tmessages", e); } - return; - } else { - if (row - 1 < ContactsController.getInstance().contacts.size()) { - user = MessagesController.getInstance().getUser(ContactsController.getInstance().contacts.get(row - 1).user_id); - } else { - return; - } } - } - } - - if (user != null) { - if (user.id == UserConfig.getClientUserId()) { - return; - } - if (returnAsResult) { - if (ignoreUsers != null && ignoreUsers.containsKey(user.id)) { - return; - } - didSelectResult(user, true, null); } else { - if (createSecretChat) { - creatingChat = true; - MessagesController.getInstance().startSecretChat(getParentActivity(), user); - } else { + if (row == 0) { + presentFragment(new GroupCreateActivity(), true); + } else if (row == 1) { Bundle args = new Bundle(); - args.putInt("user_id", user.id); - presentFragment(new ChatActivity(args), true); + args.putBoolean("onlyUsers", true); + args.putBoolean("destroyAfterSelect", true); + args.putBoolean("createSecretChat", true); + presentFragment(new ContactsActivity(args), true); + } else if (row == 2) { + Bundle args = new Bundle(); + args.putBoolean("broadcast", true); + presentFragment(new GroupCreateActivity(args), true); } } } else { - ArrayList arr = ContactsController.getInstance().contactsSectionsDict.get(ContactsController.getInstance().sortedContactsSectionsArray.get(section - 1)); - ContactsController.Contact contact = arr.get(row); - String usePhone = null; - if (!contact.phones.isEmpty()) { - usePhone = contact.phones.get(0); - } - if (usePhone == null || getParentActivity() == null) { - return; - } - AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); - builder.setMessage(LocaleController.getString("InviteUser", R.string.InviteUser)); - builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); - final String arg1 = usePhone; - builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialogInterface, int i) { - try { - Intent intent = new Intent(Intent.ACTION_VIEW, Uri.fromParts("sms", arg1, null)); - intent.putExtra("sms_body", LocaleController.getString("InviteText", R.string.InviteText)); - getParentActivity().startActivity(intent); - } catch (Exception e) { - FileLog.e("tmessages", e); + Object item = listViewAdapter.getItem(section, row); + + if (item instanceof TLRPC.User) { + TLRPC.User user = (TLRPC.User) item; + if (user.id == UserConfig.getClientUserId()) { + return; + } + if (returnAsResult) { + if (ignoreUsers != null && ignoreUsers.containsKey(user.id)) { + return; + } + didSelectResult(user, true, null); + } else { + if (createSecretChat) { + creatingChat = true; + MessagesController.getInstance().startSecretChat(getParentActivity(), user); + } else { + Bundle args = new Bundle(); + args.putInt("user_id", user.id); + presentFragment(new ChatActivity(args), true); } } - }); - builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); - showAlertDialog(builder); + } else if (item instanceof ContactsController.Contact) { + ContactsController.Contact contact = (ContactsController.Contact) item; + String usePhone = null; + if (!contact.phones.isEmpty()) { + usePhone = contact.phones.get(0); + } + if (usePhone == null || getParentActivity() == null) { + return; + } + AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); + builder.setMessage(LocaleController.getString("InviteUser", R.string.InviteUser)); + builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); + final String arg1 = usePhone; + builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + try { + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.fromParts("sms", arg1, null)); + intent.putExtra("sms_body", LocaleController.getString("InviteText", R.string.InviteText)); + getParentActivity().startActivity(intent); + } catch (Exception e) { + FileLog.e("tmessages", e); + } + } + }); + builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); + showAlertDialog(builder); + } } } } @@ -432,45 +437,13 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter } } - private void updateInviteText() { - if (!updatingInviteText) { - updatingInviteText = true; - TLRPC.TL_help_getInviteText req = new TLRPC.TL_help_getInviteText(); - req.lang_code = LocaleController.getLocaleString(Locale.getDefault()); - if (req.lang_code == null || req.lang_code.length() == 0) { - req.lang_code = "en"; - } - ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() { - @Override - public void run(TLObject response, TLRPC.TL_error error) { - if (error == null) { - final TLRPC.TL_help_inviteText res = (TLRPC.TL_help_inviteText)response; - if (res.message.length() != 0) { - AndroidUtilities.runOnUIThread(new Runnable() { - @Override - public void run() { - updatingInviteText = false; - SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); - SharedPreferences.Editor editor = preferences.edit(); - editor.putString("invitetext", res.message); - editor.putInt("invitetexttime", (int) (System.currentTimeMillis() / 1000)); - editor.commit(); - } - }); - } - } - } - }, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassFailOnServerErrors); - } - } - private void updateVisibleRows(int mask) { if (listView != null) { int count = listView.getChildCount(); for (int a = 0; a < count; a++) { View child = listView.getChildAt(a); - if (child instanceof ChatOrUserCell) { - ((ChatOrUserCell) child).update(mask); + if (child instanceof UserCell) { + ((UserCell) child).update(mask); } } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java index 2df5cc6de..d2681cbd6 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java @@ -568,7 +568,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen holder.messageTextView.setText(LocaleController.formatUserStatus(user)); if (user.status != null && user.status.expires > ConnectionsManager.getInstance().getCurrentTime()) { - holder.messageTextView.setTextColor(0xff357aa8); + holder.messageTextView.setTextColor(0xff548ab6); } else { holder.messageTextView.setTextColor(0xff808080); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java index 36dcce7de..fb76a7bc0 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java @@ -30,7 +30,7 @@ import org.telegram.messenger.FileLog; import org.telegram.android.MessagesController; import org.telegram.android.NotificationCenter; import org.telegram.messenger.R; -import org.telegram.ui.Cells.ChatOrUserCell; +import org.telegram.ui.Cells.UserCell; import org.telegram.ui.Views.ActionBar.ActionBarLayer; import org.telegram.ui.Views.ActionBar.ActionBarMenu; import org.telegram.ui.Views.AvatarDrawable; @@ -64,6 +64,7 @@ public class GroupCreateFinalActivity extends BaseFragment implements Notificati public GroupCreateFinalActivity(Bundle args) { super(args); isBroadcast = args.getBoolean("broadcast", false); + avatarDrawable = new AvatarDrawable(); } @SuppressWarnings("unchecked") @@ -339,8 +340,8 @@ public class GroupCreateFinalActivity extends BaseFragment implements Notificati int count = listView.getChildCount(); for (int a = 0; a < count; a++) { View child = listView.getChildAt(a); - if (child instanceof ChatOrUserCell) { - ((ChatOrUserCell) child).update(mask); + if (child instanceof UserCell) { + ((UserCell) child).update(mask); } } } @@ -390,12 +391,11 @@ public class GroupCreateFinalActivity extends BaseFragment implements Notificati TLRPC.User user = MessagesController.getInstance().getUser(selectedContacts.get(position)); if (convertView == null) { - convertView = new ChatOrUserCell(mContext); - ((ChatOrUserCell)convertView).usePadding = false; + convertView = new UserCell(mContext); } - ((ChatOrUserCell)convertView).setData(user, null, null, null, null); - ((ChatOrUserCell) convertView).useSeparator = position != selectedContacts.size() - 1; + ((UserCell)convertView).setData(user, null, null); + ((UserCell) convertView).useSeparator = position != selectedContacts.size() - 1; return convertView; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java index 0db139257..fa8d56248 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java @@ -17,6 +17,7 @@ import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.view.WindowManager; +import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; @@ -27,7 +28,7 @@ import org.telegram.android.MessagesController; import org.telegram.messenger.R; import org.telegram.ui.Views.ActionBar.ActionBarLayer; import org.telegram.ui.Views.ActionBar.BaseFragment; -import org.telegram.ui.Views.IdenticonView; +import org.telegram.ui.Views.IdenticonDrawable; public class IdenticonActivity extends BaseFragment { private int chat_id; @@ -60,11 +61,13 @@ public class IdenticonActivity extends BaseFragment { }); fragmentView = inflater.inflate(R.layout.identicon_layout, container, false); - IdenticonView identiconView = (IdenticonView) fragmentView.findViewById(R.id.identicon_view); + ImageView identiconView = (ImageView) fragmentView.findViewById(R.id.identicon_view); TextView textView = (TextView)fragmentView.findViewById(R.id.identicon_text); TLRPC.EncryptedChat encryptedChat = MessagesController.getInstance().getEncryptedChat(chat_id); if (encryptedChat != null) { - identiconView.setBytes(encryptedChat.auth_key); + IdenticonDrawable drawable = new IdenticonDrawable(); + identiconView.setImageDrawable(drawable); + drawable.setBytes(encryptedChat.auth_key); TLRPC.User user = MessagesController.getInstance().getUser(encryptedChat.user_id); textView.setText(Html.fromHtml(LocaleController.formatString("EncryptionKeyDescription", R.string.EncryptionKeyDescription, user.first_name, user.first_name))); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java index a086266ed..6869ee2bb 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java @@ -39,6 +39,7 @@ import android.widget.Toast; import org.telegram.android.AndroidUtilities; import org.telegram.PhoneFormat.PhoneFormat; +import org.telegram.android.ContactsController; import org.telegram.android.SendMessagesHelper; import org.telegram.messenger.ConnectionsManager; import org.telegram.messenger.FileLog; @@ -204,7 +205,6 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa Bundle args = new Bundle(); args.putBoolean("onlyUsers", true); args.putBoolean("destroyAfterSelect", true); - args.putBoolean("usersAsSections", true); args.putBoolean("createSecretChat", true); presentFragment(new ContactsActivity(args)); } @@ -268,7 +268,6 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa Bundle args = new Bundle(); args.putBoolean("onlyUsers", true); args.putBoolean("destroyAfterSelect", true); - args.putBoolean("usersAsSections", true); args.putBoolean("createSecretChat", true); presentFragment(new ContactsActivity(args)); drawerLayoutContainer.closeDrawer(false); @@ -277,15 +276,29 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa args.putBoolean("broadcast", true); presentFragment(new GroupCreateActivity(args)); drawerLayoutContainer.closeDrawer(false); - } else if (position == 8) { + } else if (position == 6) { presentFragment(new ContactsActivity(null)); drawerLayoutContainer.closeDrawer(false); - } else if (position == 9) { + } else if (position == 7) { + try { + Intent intent = new Intent(Intent.ACTION_SEND); + intent.setType("text/plain"); + intent.putExtra(Intent.EXTRA_TEXT, ContactsController.getInstance().getInviteText()); + startActivity(intent); + } catch (Exception e) { + FileLog.e("tmessages", e); + } drawerLayoutContainer.closeDrawer(false); - } else if (position == 10) { + } else if (position == 8) { presentFragment(new SettingsActivity()); drawerLayoutContainer.closeDrawer(false); - } else if (position == 11) { + } else if (position == 9) { + try { + Intent pickIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(LocaleController.getString("TelegramFaqUrl", R.string.TelegramFaqUrl))); + startActivity(pickIntent); + } catch (Exception e) { + FileLog.e("tmessages", e); + } drawerLayoutContainer.closeDrawer(false); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivitySmsView.java b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivitySmsView.java index 6c5898cd9..9f8eb75b6 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivitySmsView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivitySmsView.java @@ -144,7 +144,7 @@ public class LoginActivitySmsView extends SlideView implements NotificationCente } codeField.setText(""); AndroidUtilities.setWaitingForSms(true); - NotificationCenter.getInstance().addObserver(this, 998); + NotificationCenter.getInstance().addObserver(this, NotificationCenter.didReceiveSmsCode); currentParams = params; waitingForSms = true; String phone = params.getString("phone"); @@ -279,7 +279,7 @@ public class LoginActivitySmsView extends SlideView implements NotificationCente nextPressed = true; waitingForSms = false; AndroidUtilities.setWaitingForSms(false); - NotificationCenter.getInstance().removeObserver(this, 998); + NotificationCenter.getInstance().removeObserver(this, NotificationCenter.didReceiveSmsCode); final TLRPC.TL_auth_signIn req = new TLRPC.TL_auth_signIn(); req.phone_number = requestPhone; req.phone_code = codeField.getText().toString(); @@ -353,7 +353,7 @@ public class LoginActivitySmsView extends SlideView implements NotificationCente destroyCodeTimer(); currentParams = null; AndroidUtilities.setWaitingForSms(false); - NotificationCenter.getInstance().removeObserver(this, 998); + NotificationCenter.getInstance().removeObserver(this, NotificationCenter.didReceiveSmsCode); waitingForSms = false; } @@ -361,7 +361,7 @@ public class LoginActivitySmsView extends SlideView implements NotificationCente public void onDestroyActivity() { super.onDestroyActivity(); AndroidUtilities.setWaitingForSms(false); - NotificationCenter.getInstance().removeObserver(this, 998); + NotificationCenter.getInstance().removeObserver(this, NotificationCenter.didReceiveSmsCode); destroyTimer(); destroyCodeTimer(); waitingForSms = false; @@ -378,7 +378,7 @@ public class LoginActivitySmsView extends SlideView implements NotificationCente @Override public void didReceivedNotification(int id, final Object... args) { - if (id == 998) { + if (id == NotificationCenter.didReceiveSmsCode) { AndroidUtilities.runOnUIThread(new Runnable() { @Override public void run() { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java index 5fae08af3..9eb7d940e 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java @@ -259,6 +259,9 @@ public class MediaActivity extends BaseFragment implements NotificationCenter.No @Override public void onResume() { super.onResume(); + if (parentLayout != null) { + parentLayout.getDrawerLayoutContainer().setStatusBarColor(0xff54759e); + } if (listAdapter != null) { listAdapter.notifyDataSetChanged(); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java index 72b762e10..7dc66a992 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java @@ -44,7 +44,7 @@ import org.telegram.ui.Adapters.MessagesActivityAdapter; import org.telegram.ui.Adapters.MessagesActivitySearchAdapter; import org.telegram.ui.AnimationCompat.ObjectAnimatorProxy; import org.telegram.ui.AnimationCompat.ViewProxy; -import org.telegram.ui.Cells.ChatOrUserCell; +import org.telegram.ui.Cells.UserCell; import org.telegram.ui.Cells.DialogCell; import org.telegram.ui.Views.ActionBar.ActionBarLayer; import org.telegram.ui.Views.ActionBar.ActionBarMenu; @@ -266,9 +266,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter @Override public void onClick(View v) { Bundle args = new Bundle(); - args.putBoolean("onlyUsers", true); args.putBoolean("destroyAfterSelect", true); - args.putBoolean("usersAsSections", true); presentFragment(new ContactsActivity(args)); } }); @@ -613,8 +611,8 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter } } cell.update(mask); - } else if (child instanceof ChatOrUserCell) { - ((ChatOrUserCell) child).update(mask); + } else if (child instanceof UserCell) { + ((UserCell) child).update(mask); } } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java similarity index 58% rename from TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java rename to TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java index 46bdd0189..f4996bf94 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java @@ -12,14 +12,17 @@ import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; -import android.graphics.Typeface; import android.net.Uri; +import android.os.Build; import android.os.Bundle; +import android.util.TypedValue; +import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; -import android.widget.ImageButton; +import android.widget.FrameLayout; +import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; @@ -35,20 +38,28 @@ import org.telegram.android.NotificationCenter; import org.telegram.messenger.R; import org.telegram.android.MessageObject; import org.telegram.ui.Adapters.BaseFragmentAdapter; +import org.telegram.ui.Cells.DividerCell; +import org.telegram.ui.Cells.EmptyCell; +import org.telegram.ui.Cells.TextCell; +import org.telegram.ui.Cells.TextDetailCell; import org.telegram.ui.Views.ActionBar.ActionBarLayer; import org.telegram.ui.Views.ActionBar.ActionBarMenu; import org.telegram.ui.Views.ActionBar.ActionBarMenuItem; import org.telegram.ui.Views.AvatarDrawable; import org.telegram.ui.Views.BackupImageView; import org.telegram.ui.Views.ActionBar.BaseFragment; -import org.telegram.ui.Views.IdenticonView; -import org.telegram.ui.Views.SettingsSectionLayout; +import org.telegram.ui.Views.IdenticonDrawable; import java.util.ArrayList; -public class UserProfileActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate, MessagesActivity.MessagesActivityDelegate, PhotoViewer.PhotoViewerProvider { +public class ProfileActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate, MessagesActivity.MessagesActivityDelegate, PhotoViewer.PhotoViewerProvider { private ListView listView; private ListAdapter listAdapter; + private BackupImageView avatarImage; + private TextView nameTextView; + private TextView onlineTextView; + FrameLayout nameContainer; + private int user_id; private int totalMediaCount = -1; private boolean creatingChat = false; @@ -62,19 +73,18 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen private final static int edit_contact = 4; private final static int delete_contact = 5; - private int avatarRow; - private int phoneSectionRow; + private int emptyRow; private int phoneRow; private int usernameRow; - private int settingsSectionRow; private int settingsTimerRow; private int settingsKeyRow; private int settingsNotificationsRow; - private int sharedMediaSectionRow; private int sharedMediaRow; + private int startSecretChatRow; + private int sectionRow; private int rowCount = 0; - public UserProfileActivity(Bundle args) { + public ProfileActivity(Bundle args) { super(args); } @@ -115,41 +125,12 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen MessagesController.getInstance().cancelLoadFullUser(user_id); } - private void updateRowsIds() { - rowCount = 0; - avatarRow = rowCount++; - phoneSectionRow = rowCount++; - phoneRow = rowCount++; - TLRPC.User user = MessagesController.getInstance().getUser(user_id); - if (user != null && user.username != null && user.username.length() > 0) { - usernameRow = rowCount++; - } else { - usernameRow = -1; - } - settingsSectionRow = rowCount++; - if (currentEncryptedChat instanceof TLRPC.TL_encryptedChat) { - settingsTimerRow = rowCount++; - settingsKeyRow = rowCount++; - } else { - settingsTimerRow = -1; - settingsKeyRow = -1; - } - settingsNotificationsRow = rowCount++; - sharedMediaSectionRow = rowCount++; - sharedMediaRow = rowCount++; - } - @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { + actionBarLayer.setBackgroundColor(AvatarDrawable.getProfileBackColorForId(user_id)); actionBarLayer.setBackButtonImage(R.drawable.ic_ab_back); actionBarLayer.setBackOverlay(R.layout.updating_state_layout); - if (dialog_id != 0) { - actionBarLayer.setTitle(LocaleController.getString("SecretTitle", R.string.SecretTitle)); - actionBarLayer.setTitleIcon(R.drawable.ic_lock_white, AndroidUtilities.dp(4)); - } else { - actionBarLayer.setTitle(LocaleController.getString("ContactInfo", R.string.ContactInfo)); - } actionBarLayer.setActionBarMenuOnItemClick(new ActionBarLayer.ActionBarMenuOnItemClick() { @Override public void onItemClick(final int id) { @@ -185,7 +166,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen args.putBoolean("onlySelect", true); args.putBoolean("serverOnly", true); MessagesActivity fragment = new MessagesActivity(args); - fragment.setDelegate(UserProfileActivity.this); + fragment.setDelegate(ProfileActivity.this); presentFragment(fragment); } else if (id == edit_contact) { Bundle args = new Bundle(); @@ -215,44 +196,95 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen createActionBarMenu(); - fragmentView = inflater.inflate(R.layout.user_profile_layout, container, false); listAdapter = new ListAdapter(getParentActivity()); - TextView textView = (TextView)fragmentView.findViewById(R.id.start_secret_button_text); - textView.setText(LocaleController.getString("StartEncryptedChat", R.string.StartEncryptedChat)); + fragmentView = new FrameLayout(getParentActivity()); + FrameLayout frameLayout = (FrameLayout) fragmentView; - View startSecretButton = fragmentView.findViewById(R.id.start_secret_button); - startSecretButton.setOnClickListener(new View.OnClickListener() { + nameContainer = new FrameLayout(getParentActivity()); + nameContainer.setBackgroundColor(AvatarDrawable.getProfileBackColorForId(user_id)); + frameLayout.addView(nameContainer); + FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) nameContainer.getLayoutParams(); + layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT; + layoutParams.height = AndroidUtilities.dp(88); + nameContainer.setLayoutParams(layoutParams); + + avatarImage = new BackupImageView(getParentActivity()); + avatarImage.imageReceiver.setRoundRadius(AndroidUtilities.dp(30)); + avatarImage.processDetach = false; + nameContainer.addView(avatarImage); + FrameLayout.LayoutParams layoutParams1 = (FrameLayout.LayoutParams) avatarImage.getLayoutParams(); + layoutParams1.gravity = (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.BOTTOM; + layoutParams1.width = AndroidUtilities.dp(60); + layoutParams1.height = AndroidUtilities.dp(60); + layoutParams1.leftMargin = LocaleController.isRTL ? 0 : AndroidUtilities.dp(17); + layoutParams1.rightMargin = LocaleController.isRTL ? AndroidUtilities.dp(17) : 0; + layoutParams1.bottomMargin = AndroidUtilities.dp(22); + avatarImage.setLayoutParams(layoutParams1); + avatarImage.setOnClickListener(new View.OnClickListener() { @Override - public void onClick(View view) { - if (getParentActivity() == null) { - return; + public void onClick(View v) { + TLRPC.User user = MessagesController.getInstance().getUser(user_id); + if (user.photo != null && user.photo.photo_big != null) { + PhotoViewer.getInstance().setParentActivity(getParentActivity()); + PhotoViewer.getInstance().openPhoto(user.photo.photo_big, ProfileActivity.this); } - AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); - builder.setMessage(LocaleController.getString("AreYouSureSecretChat", R.string.AreYouSureSecretChat)); - builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); - builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialogInterface, int i) { - creatingChat = true; - MessagesController.getInstance().startSecretChat(getParentActivity(), MessagesController.getInstance().getUser(user_id)); - } - }); - builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); - showAlertDialog(builder); } }); - if (dialog_id == 0) { - startSecretButton.setVisibility(View.VISIBLE); - } else { - startSecretButton.setVisibility(View.GONE); - } - listView = (ListView)fragmentView.findViewById(R.id.listView); + nameTextView = new TextView(getParentActivity()); + nameTextView.setTextColor(0xffffffff); + nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 20); + nameTextView.setLines(1); + nameTextView.setMaxLines(1); + nameTextView.setSingleLine(true); + nameTextView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT)); + nameTextView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); + nameContainer.addView(nameTextView); + layoutParams1 = (FrameLayout.LayoutParams) nameTextView.getLayoutParams(); + layoutParams1.width = FrameLayout.LayoutParams.WRAP_CONTENT; + layoutParams1.height = FrameLayout.LayoutParams.WRAP_CONTENT; + layoutParams1.leftMargin = AndroidUtilities.dp(LocaleController.isRTL ? 16 : 97); + layoutParams1.rightMargin = AndroidUtilities.dp(LocaleController.isRTL ? 97 : 16); + layoutParams1.bottomMargin = AndroidUtilities.dp(51); + layoutParams1.gravity = (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.BOTTOM; + nameTextView.setLayoutParams(layoutParams1); + + onlineTextView = new TextView(getParentActivity()); + onlineTextView.setTextColor(0xffd0e4ea); + onlineTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14); + onlineTextView.setLines(1); + onlineTextView.setMaxLines(1); + onlineTextView.setSingleLine(true); + onlineTextView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT)); + nameContainer.addView(onlineTextView); + layoutParams1 = (FrameLayout.LayoutParams) onlineTextView.getLayoutParams(); + layoutParams1.width = FrameLayout.LayoutParams.WRAP_CONTENT; + layoutParams1.height = FrameLayout.LayoutParams.WRAP_CONTENT; + layoutParams1.leftMargin = AndroidUtilities.dp(LocaleController.isRTL ? 16 : 97); + layoutParams1.rightMargin = AndroidUtilities.dp(LocaleController.isRTL ? 97 : 16); + layoutParams1.bottomMargin = AndroidUtilities.dp(30); + layoutParams1.gravity = (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.BOTTOM; + onlineTextView.setLayoutParams(layoutParams1); + + listView = new ListView(getParentActivity()); + listView.setDivider(null); + listView.setDividerHeight(0); + listView.setVerticalScrollBarEnabled(false); + frameLayout.addView(listView); + layoutParams = (FrameLayout.LayoutParams) listView.getLayoutParams(); + layoutParams.topMargin = AndroidUtilities.dp(88); + layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT; + layoutParams.height = FrameLayout.LayoutParams.MATCH_PARENT; + listView.setLayoutParams(layoutParams); + listView.setAdapter(listAdapter); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView adapterView, View view, final int i, long l) { + if (getParentActivity() == null) { + return; + } if (i == sharedMediaRow) { Bundle args = new Bundle(); if (dialog_id != 0) { @@ -274,6 +306,50 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen Bundle args = new Bundle(); args.putLong("dialog_id", dialog_id == 0 ? user_id : dialog_id); presentFragment(new ProfileNotificationsActivity(args)); + } else if (i == startSecretChatRow) { + AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); + builder.setMessage(LocaleController.getString("AreYouSureSecretChat", R.string.AreYouSureSecretChat)); + builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); + builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + creatingChat = true; + MessagesController.getInstance().startSecretChat(getParentActivity(), MessagesController.getInstance().getUser(user_id)); + } + }); + builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); + showAlertDialog(builder); + } else if (i == phoneRow) { + final TLRPC.User user = MessagesController.getInstance().getUser(user_id); + if (user == null || user.phone == null || user.phone.length() == 0 || getParentActivity() == null) { + return; + } + + AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); + builder.setItems(new CharSequence[] {LocaleController.getString("Call", R.string.Call), LocaleController.getString("Copy", R.string.Copy)}, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + if (i == 0) { + try { + Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:+" + user.phone)); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + getParentActivity().startActivity(intent); + } catch (Exception e) { + FileLog.e("tmessages", e); + } + } else if (i == 1) { + if(Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB) { + android.text.ClipboardManager clipboard = (android.text.ClipboardManager)ApplicationLoader.applicationContext.getSystemService(Context.CLIPBOARD_SERVICE); + clipboard.setText(user.phone); + } else { + android.content.ClipboardManager clipboard = (android.content.ClipboardManager)ApplicationLoader.applicationContext.getSystemService(Context.CLIPBOARD_SERVICE); + android.content.ClipData clip = android.content.ClipData.newPlainText("label", user.phone); + clipboard.setPrimaryClip(clip); + } + } + } + }); + showAlertDialog(builder); } } }); @@ -282,6 +358,33 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen } else { MessagesController.getInstance().getMediaCount(user_id, classGuid, true); } + + ImageView writeButton = new ImageView(getParentActivity()); + writeButton.setImageResource(R.drawable.floating_states); + frameLayout.addView(writeButton); + layoutParams1 = (FrameLayout.LayoutParams) writeButton.getLayoutParams(); + layoutParams1.width = FrameLayout.LayoutParams.WRAP_CONTENT; + layoutParams1.height = FrameLayout.LayoutParams.WRAP_CONTENT; + layoutParams1.leftMargin = AndroidUtilities.dp(LocaleController.isRTL ? 16 : 0); + layoutParams1.rightMargin = AndroidUtilities.dp(LocaleController.isRTL ? 0 : 16); + layoutParams1.topMargin = AndroidUtilities.dp(58); + layoutParams1.gravity = (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT); + writeButton.setLayoutParams(layoutParams1); + writeButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + TLRPC.User user = MessagesController.getInstance().getUser(user_id); + if (user == null || user instanceof TLRPC.TL_userEmpty) { + return; + } + NotificationCenter.getInstance().postNotificationName(NotificationCenter.closeChats); + Bundle args = new Bundle(); + args.putInt("user_id", user_id); + presentFragment(new ChatActivity(args), true); + } + }); + + updateUserData(); } else { ViewGroup parent = (ViewGroup)fragmentView.getParent(); if (parent != null) { @@ -295,10 +398,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen if (id == NotificationCenter.updateInterfaces) { int mask = (Integer)args[0]; if ((mask & MessagesController.UPDATE_MASK_AVATAR) != 0 || (mask & MessagesController.UPDATE_MASK_NAME) != 0) { - updateRowsIds(); - if (listView != null) { - listView.invalidateViews(); - } + updateUserData(); } } else if (id == NotificationCenter.contactsDidLoaded) { createActionBarMenu(); @@ -344,6 +444,9 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen @Override public void onResume() { super.onResume(); + if (parentLayout != null) { + parentLayout.getDrawerLayoutContainer().setStatusBarColor(AvatarDrawable.getProfileBackColorForId(user_id)); + } if (listAdapter != null) { listAdapter.notifyDataSetChanged(); } @@ -358,24 +461,17 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen if (user != null && user.photo != null && user.photo.photo_big != null) { TLRPC.FileLocation photoBig = user.photo.photo_big; if (photoBig.local_id == fileLocation.local_id && photoBig.volume_id == fileLocation.volume_id && photoBig.dc_id == fileLocation.dc_id) { - int count = listView.getChildCount(); - for (int a = 0; a < count; a++) { - View view = listView.getChildAt(a); - BackupImageView avatarImage = (BackupImageView)view.findViewById(R.id.settings_avatar_image); - if (avatarImage != null) { - int coords[] = new int[2]; - avatarImage.getLocationInWindow(coords); - PhotoViewer.PlaceProviderObject object = new PhotoViewer.PlaceProviderObject(); - object.viewX = coords[0]; - object.viewY = coords[1] - AndroidUtilities.statusBarHeight; - object.parentView = listView; - object.imageReceiver = avatarImage.imageReceiver; - object.user_id = user_id; - object.thumb = object.imageReceiver.getBitmap(); - object.size = -1; - return object; - } - } + int coords[] = new int[2]; + avatarImage.getLocationInWindow(coords); + PhotoViewer.PlaceProviderObject object = new PhotoViewer.PlaceProviderObject(); + object.viewX = coords[0]; + object.viewY = coords[1] - AndroidUtilities.statusBarHeight; + object.parentView = nameContainer; + object.imageReceiver = avatarImage.imageReceiver; + object.user_id = user_id; + object.thumb = object.imageReceiver.getBitmap(); + object.size = -1; + return object; } } return null; @@ -402,6 +498,50 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen @Override public int getSelectedCount() { return 0; } + private void updateRowsIds() { + rowCount = 0; + emptyRow = rowCount++; + phoneRow = rowCount++; + TLRPC.User user = MessagesController.getInstance().getUser(user_id); + if (user != null && user.username != null && user.username.length() > 0) { + usernameRow = rowCount++; + } else { + usernameRow = -1; + } + sectionRow = rowCount++; + if (currentEncryptedChat instanceof TLRPC.TL_encryptedChat) { + settingsTimerRow = rowCount++; + settingsKeyRow = rowCount++; + } else { + settingsTimerRow = -1; + settingsKeyRow = -1; + } + settingsNotificationsRow = rowCount++; + sharedMediaRow = rowCount++; + if (currentEncryptedChat == null) { + startSecretChatRow = rowCount++; + } else { + startSecretChatRow = -1; + } + } + + private void updateUserData() { + TLRPC.User user = MessagesController.getInstance().getUser(user_id); + TLRPC.FileLocation photo = null; + TLRPC.FileLocation photoBig = null; + if (user.photo != null) { + photo = user.photo.photo_small; + photoBig = user.photo.photo_big; + } + avatarImage.setImage(photo, "50_50", new AvatarDrawable(user, true)); + avatarImage.imageReceiver.setVisible(!PhotoViewer.getInstance().isShowingImage(photoBig), false); + + nameTextView.setText(ContactsController.formatName(user.first_name, user.last_name)); + onlineTextView.setText(LocaleController.formatUserStatus(user)); + + avatarImage.imageReceiver.setVisible(!PhotoViewer.getInstance().isShowingImage(photoBig), false); + } + private void createActionBarMenu() { ActionBarMenu menu = actionBarLayer.createMenu(); menu.clearItems(); @@ -472,7 +612,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen @Override public boolean isEnabled(int i) { - return i == phoneRow || i == settingsTimerRow || i == settingsKeyRow || i == settingsNotificationsRow || i == sharedMediaRow; + return i == phoneRow || i == settingsTimerRow || i == settingsKeyRow || i == settingsNotificationsRow || i == sharedMediaRow || i == startSecretChatRow; } @Override @@ -499,191 +639,72 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen public View getView(int i, View view, ViewGroup viewGroup) { int type = getItemViewType(i); if (type == 0) { - BackupImageView avatarImage; - TextView onlineText; - TLRPC.User user = MessagesController.getInstance().getUser(user_id); if (view == null) { - LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.user_profile_avatar_layout, viewGroup, false); - - onlineText = (TextView)view.findViewById(R.id.settings_online); - avatarImage = (BackupImageView)view.findViewById(R.id.settings_avatar_image); - avatarImage.processDetach = false; - avatarImage.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - TLRPC.User user = MessagesController.getInstance().getUser(user_id); - if (user.photo != null && user.photo.photo_big != null) { - PhotoViewer.getInstance().setParentActivity(getParentActivity()); - PhotoViewer.getInstance().openPhoto(user.photo.photo_big, UserProfileActivity.this); - } - } - }); - } else { - avatarImage = (BackupImageView)view.findViewById(R.id.settings_avatar_image); - onlineText = (TextView)view.findViewById(R.id.settings_online); + view = new EmptyCell(mContext, 36); } - TextView textView = (TextView)view.findViewById(R.id.settings_name); - Typeface typeface = AndroidUtilities.getTypeface("fonts/rmedium.ttf"); - textView.setTypeface(typeface); - - textView.setText(ContactsController.formatName(user.first_name, user.last_name)); - onlineText.setText(LocaleController.formatUserStatus(user)); - - TLRPC.FileLocation photo = null; - TLRPC.FileLocation photoBig = null; - if (user.photo != null) { - photo = user.photo.photo_small; - photoBig = user.photo.photo_big; - } - avatarImage.setImage(photo, "50_50", new AvatarDrawable(user)); - avatarImage.imageReceiver.setVisible(!PhotoViewer.getInstance().isShowingImage(photoBig), false); - return view; } else if (type == 1) { if (view == null) { - view = new SettingsSectionLayout(mContext); - } - if (i == phoneSectionRow) { - ((SettingsSectionLayout) view).setText(LocaleController.getString("Info", R.string.Info)); - } else if (i == settingsSectionRow) { - ((SettingsSectionLayout) view).setText(LocaleController.getString("SETTINGS", R.string.SETTINGS)); - } else if (i == sharedMediaSectionRow) { - ((SettingsSectionLayout) view).setText(LocaleController.getString("SHAREDMEDIA", R.string.SHAREDMEDIA)); + view = new DividerCell(mContext); + view.setPadding(AndroidUtilities.dp(72), 0, 0, 0); } } else if (type == 2) { final TLRPC.User user = MessagesController.getInstance().getUser(user_id); if (view == null) { - LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.user_profile_phone_layout, viewGroup, false); - view.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if (user.phone == null || user.phone.length() == 0 || getParentActivity() == null) { - return; - } - - AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); - - builder.setItems(new CharSequence[] {LocaleController.getString("Copy", R.string.Copy)}, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialogInterface, int i) { - if (i == 0) { - int sdk = android.os.Build.VERSION.SDK_INT; - if(sdk < android.os.Build.VERSION_CODES.HONEYCOMB) { - android.text.ClipboardManager clipboard = (android.text.ClipboardManager)ApplicationLoader.applicationContext.getSystemService(Context.CLIPBOARD_SERVICE); - clipboard.setText(user.phone); - } else { - android.content.ClipboardManager clipboard = (android.content.ClipboardManager)ApplicationLoader.applicationContext.getSystemService(Context.CLIPBOARD_SERVICE); - android.content.ClipData clip = android.content.ClipData.newPlainText("label", user.phone); - clipboard.setPrimaryClip(clip); - } - } - } - }); - showAlertDialog(builder); - } - }); - ImageButton button = (ImageButton)view.findViewById(R.id.settings_edit_name); - button.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - TLRPC.User user = MessagesController.getInstance().getUser(user_id); - if (user == null || user instanceof TLRPC.TL_userEmpty) { - return; - } - NotificationCenter.getInstance().postNotificationName(NotificationCenter.closeChats); - Bundle args = new Bundle(); - args.putInt("user_id", user_id); - presentFragment(new ChatActivity(args), true); - } - }); - button = (ImageButton)view.findViewById(R.id.settings_call_phone); - button.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - try { - Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:+" + user.phone)); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - getParentActivity().startActivity(intent); - } catch (Exception e) { - FileLog.e("tmessages", e); - } - } - }); + view = new TextDetailCell(mContext); } - ImageButton button = (ImageButton)view.findViewById(R.id.settings_call_phone); - button.setVisibility(user.phone == null || user.phone.length() == 0 ? View.GONE : View.VISIBLE); + TextDetailCell textDetailCell = (TextDetailCell) view; - TextView textView = (TextView)view.findViewById(R.id.settings_row_text); - TextView detailTextView = (TextView)view.findViewById(R.id.settings_row_text_detail); - View divider = view.findViewById(R.id.settings_row_divider); if (i == phoneRow) { + String text; if (user.phone != null && user.phone.length() != 0) { - textView.setText(PhoneFormat.getInstance().format("+" + user.phone)); + text = PhoneFormat.getInstance().format("+" + user.phone); } else { - textView.setText(LocaleController.getString("NumberUnknown", R.string.NumberUnknown)); + text = LocaleController.getString("NumberUnknown", R.string.NumberUnknown); } - divider.setVisibility(usernameRow != -1 ? View.VISIBLE : View.INVISIBLE); - detailTextView.setText(LocaleController.getString("PhoneMobile", R.string.PhoneMobile)); + textDetailCell.setTextAndValue(text, LocaleController.getString("PhoneMobile", R.string.PhoneMobile)); + } else if (i == usernameRow) { + String text; + if (user != null && user.username != null && user.username.length() != 0) { + text = "@" + user.username; + } else { + text = "-"; + } + textDetailCell.setTextAndValue(text, LocaleController.getString("Username", R.string.Username)); } } else if (type == 3) { if (view == null) { - LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.user_profile_leftright_row_layout, viewGroup, false); + view = new TextCell(mContext); } - TextView textView = (TextView)view.findViewById(R.id.settings_row_text); - TextView detailTextView = (TextView)view.findViewById(R.id.settings_row_text_detail); + TextCell textCell = (TextCell) view; + textCell.setTextColor(0xff000000); - View divider = view.findViewById(R.id.settings_row_divider); if (i == sharedMediaRow) { - textView.setText(LocaleController.getString("SharedMedia", R.string.SharedMedia)); + String value; if (totalMediaCount == -1) { - detailTextView.setText(LocaleController.getString("Loading", R.string.Loading)); + value = LocaleController.getString("Loading", R.string.Loading); } else { - detailTextView.setText(String.format("%d", totalMediaCount)); + value = String.format("%d", totalMediaCount); } - divider.setVisibility(View.INVISIBLE); + textCell.setTextAndValue(LocaleController.getString("SharedMedia", R.string.SharedMedia), value); } else if (i == settingsTimerRow) { TLRPC.EncryptedChat encryptedChat = MessagesController.getInstance().getEncryptedChat((int)(dialog_id >> 32)); - textView.setText(LocaleController.getString("MessageLifetime", R.string.MessageLifetime)); - divider.setVisibility(View.VISIBLE); + String value; if (encryptedChat.ttl == 0) { - detailTextView.setText(LocaleController.getString("ShortMessageLifetimeForever", R.string.ShortMessageLifetimeForever)); + value = LocaleController.getString("ShortMessageLifetimeForever", R.string.ShortMessageLifetimeForever); } else { - detailTextView.setText(AndroidUtilities.formatTTLString(encryptedChat.ttl)); + value = AndroidUtilities.formatTTLString(encryptedChat.ttl); } - } else if (i == usernameRow) { - TLRPC.User user = MessagesController.getInstance().getUser(user_id); - textView.setText(LocaleController.getString("Username", R.string.Username)); - if (user != null && user.username != null && user.username.length() != 0) { - detailTextView.setText("@" + user.username); - } else { - detailTextView.setText("-"); - } - divider.setVisibility(View.INVISIBLE); - } - } else if (type == 4) { - if (view == null) { - LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.user_profile_identicon_layout, viewGroup, false); - } - TextView textView = (TextView)view.findViewById(R.id.settings_row_text); - View divider = view.findViewById(R.id.settings_row_divider); - divider.setVisibility(View.VISIBLE); - IdenticonView identiconView = (IdenticonView)view.findViewById(R.id.identicon_view); - TLRPC.EncryptedChat encryptedChat = MessagesController.getInstance().getEncryptedChat((int)(dialog_id >> 32)); - identiconView.setBytes(encryptedChat.auth_key); - textView.setText(LocaleController.getString("EncryptionKey", R.string.EncryptionKey)); - } else if (type == 5) { - if (view == null) { - LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - view = li.inflate(R.layout.settings_row_button_layout, viewGroup, false); - } - TextView textView = (TextView)view.findViewById(R.id.settings_row_text); - View divider = view.findViewById(R.id.settings_row_divider); - if (i == settingsNotificationsRow) { - textView.setText(LocaleController.getString("NotificationsAndSounds", R.string.NotificationsAndSounds)); - divider.setVisibility(View.INVISIBLE); + textCell.setTextAndValue(LocaleController.getString("MessageLifetime", R.string.MessageLifetime), value); + } else if (i == settingsNotificationsRow) { + textCell.setText(LocaleController.getString("NotificationsAndSounds", R.string.NotificationsAndSounds)); + } else if (i == startSecretChatRow) { + textCell.setText(LocaleController.getString("StartEncryptedChat", R.string.StartEncryptedChat)); + textCell.setTextColor(0xff37a919); + } else if (i == settingsKeyRow) { + IdenticonDrawable identiconDrawable = new IdenticonDrawable(); + TLRPC.EncryptedChat encryptedChat = MessagesController.getInstance().getEncryptedChat((int)(dialog_id >> 32)); + identiconDrawable.setBytes(encryptedChat.auth_key); + textCell.setTextAndValueDrawable(LocaleController.getString("EncryptionKey", R.string.EncryptionKey), identiconDrawable); } } return view; @@ -691,25 +712,21 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen @Override public int getItemViewType(int i) { - if (i == avatarRow) { + if (i == emptyRow) { return 0; - } else if (i == phoneSectionRow || i == settingsSectionRow || i == sharedMediaSectionRow) { + } else if (i == sectionRow) { return 1; - } else if (i == phoneRow) { + } else if (i == phoneRow || i == usernameRow) { return 2; - } else if (i == sharedMediaRow || i == settingsTimerRow || i == usernameRow) { + } else if (i == sharedMediaRow || i == settingsTimerRow || i == settingsNotificationsRow || i == startSecretChatRow || i == settingsKeyRow) { return 3; - } else if (i == settingsKeyRow) { - return 4; - } else if (i == settingsNotificationsRow) { - return 5; } return 0; } @Override public int getViewTypeCount() { - return 6; + return 4; } @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ProfileNotificationsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ProfileNotificationsActivity.java index 58c0ccc6f..3aadeff64 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ProfileNotificationsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ProfileNotificationsActivity.java @@ -253,6 +253,14 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi return fragmentView; } + @Override + public void onResume() { + super.onResume(); + if (parentLayout != null) { + parentLayout.getDrawerLayoutContainer().setStatusBarColor(0xff54759e); + } + } + public void updateServerNotificationsSettings() { if ((int)dialog_id == 0) { return; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsersActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsersActivity.java index 96ffb2676..490cb5194 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsersActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsersActivity.java @@ -27,7 +27,7 @@ import org.telegram.android.MessagesController; import org.telegram.android.NotificationCenter; import org.telegram.messenger.R; import org.telegram.ui.Adapters.BaseFragmentAdapter; -import org.telegram.ui.Cells.ChatOrUserCell; +import org.telegram.ui.Cells.UserCell; import org.telegram.ui.Views.ActionBar.ActionBarLayer; import org.telegram.ui.Views.ActionBar.ActionBarMenu; import org.telegram.ui.Views.ActionBar.BaseFragment; @@ -72,7 +72,6 @@ public class SettingsBlockedUsersActivity extends BaseFragment implements Notifi Bundle args = new Bundle(); args.putBoolean("onlyUsers", true); args.putBoolean("destroyAfterSelect", true); - args.putBoolean("usersAsSections", true); args.putBoolean("returnAsResult", true); ContactsActivity fragment = new ContactsActivity(args); fragment.setDelegate(SettingsBlockedUsersActivity.this); @@ -111,7 +110,7 @@ public class SettingsBlockedUsersActivity extends BaseFragment implements Notifi if (i < MessagesController.getInstance().blockedUsers.size()) { Bundle args = new Bundle(); args.putInt("user_id", MessagesController.getInstance().blockedUsers.get(i)); - presentFragment(new UserProfileActivity(args)); + presentFragment(new ProfileActivity(args)); } } }); @@ -177,8 +176,8 @@ public class SettingsBlockedUsersActivity extends BaseFragment implements Notifi int count = listView.getChildCount(); for (int a = 0; a < count; a++) { View child = listView.getChildAt(a); - if (child instanceof ChatOrUserCell) { - ((ChatOrUserCell) child).update(mask); + if (child instanceof UserCell) { + ((UserCell) child).update(mask); } } } @@ -244,12 +243,11 @@ public class SettingsBlockedUsersActivity extends BaseFragment implements Notifi int type = getItemViewType(i); if (type == 0) { if (view == null) { - view = new ChatOrUserCell(mContext); - ((ChatOrUserCell)view).usePadding = false; - ((ChatOrUserCell)view).useSeparator = true; + view = new UserCell(mContext); + ((UserCell)view).useSeparator = true; } TLRPC.User user = MessagesController.getInstance().getUser(MessagesController.getInstance().blockedUsers.get(i)); - ((ChatOrUserCell)view).setData(user, null, null, null, user.phone != null && user.phone.length() != 0 ? PhoneFormat.getInstance().format("+" + user.phone) : LocaleController.getString("NumberUnknown", R.string.NumberUnknown)); + ((UserCell)view).setData(user, null, user.phone != null && user.phone.length() != 0 ? PhoneFormat.getInstance().format("+" + user.phone) : LocaleController.getString("NumberUnknown", R.string.NumberUnknown)); } else if (type == 1) { if (view == null) { LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java index 881d75bf2..104a2bd60 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java @@ -16,6 +16,7 @@ import android.content.Intent; import android.content.SharedPreferences; import android.content.res.Configuration; import android.graphics.Bitmap; +import android.graphics.Point; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; @@ -222,7 +223,8 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica if (requestCode == 10) { Utilities.addMediaToGallery(currentPicturePath); try { - Bitmap bitmap = ImageLoader.loadBitmap(currentPicturePath, null, AndroidUtilities.dp(320), AndroidUtilities.dp(480)); + Point screenSize = AndroidUtilities.getRealScreenSize(); + Bitmap bitmap = ImageLoader.loadBitmap(currentPicturePath, null, screenSize.x, screenSize.y); File toFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "wallpaper-temp.jpg"); FileOutputStream stream = new FileOutputStream(toFile); bitmap.compress(Bitmap.CompressFormat.JPEG, 87, stream); @@ -238,7 +240,8 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica return; } try { - Bitmap bitmap = ImageLoader.loadBitmap(null, data.getData(), AndroidUtilities.dp(320), AndroidUtilities.dp(480)); + Point screenSize = AndroidUtilities.getRealScreenSize(); + Bitmap bitmap = ImageLoader.loadBitmap(null, data.getData(), screenSize.x, screenSize.y); File toFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "wallpaper-temp.jpg"); FileOutputStream stream = new FileOutputStream(toFile); bitmap.compress(Bitmap.CompressFormat.JPEG, 87, stream); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarDrawable.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarDrawable.java index 23a406d07..ef9eeed0d 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarDrawable.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarDrawable.java @@ -26,11 +26,14 @@ public class AvatarDrawable extends Drawable { private static Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); private static TextPaint namePaint; private static int[] arrColors = {0xffe56555, 0xfff28c48, 0xffeec764, 0xff76c84d, 0xff5fbed5, 0xff549cdd, 0xff8e85ee, 0xfff2749a}; + private static int[] arrColorsProfiles = {0xffd86f65, 0xffdc9663, 0xffdebc68, 0xff67b35d, 0xff56a2bb, 0xff5c98cd, 0xff8c79d2, 0xffda738e}; + private static int[] arrColorsProfilesBack = {0xffca6056, 0xffcf8550, 0xffcfa742, 0xff56a14c, 0xff4492ac, 0xff4c84b6, 0xff7d6ac4, 0xffc9637e}; private int color; private StaticLayout textLayout; private float textWidth; private float textHeight; + private boolean isProfile; public AvatarDrawable() { super(); @@ -56,10 +59,28 @@ public class AvatarDrawable extends Drawable { } } + public AvatarDrawable(TLRPC.User user, boolean profile) { + this(user); + isProfile = profile; + } + + public AvatarDrawable(TLRPC.Chat chat, boolean profile) { + this(chat); + isProfile = profile; + } + public static int getColorForId(int id) { return arrColors[Math.abs(id) % arrColors.length]; } + public static int getProfileColorForId(int id) { + return arrColorsProfiles[Math.abs(id) % arrColorsProfiles.length]; + } + + public static int getProfileBackColorForId(int id) { + return arrColorsProfilesBack[Math.abs(id) % arrColorsProfilesBack.length]; + } + public void setInfo(TLRPC.User user) { if (user != null) { setInfo(user.id, user.first_name, user.last_name, false); @@ -77,7 +98,11 @@ public class AvatarDrawable extends Drawable { } public void setInfo(int id, String firstName, String lastName, boolean isBroadcast) { - color = arrColors[Math.abs(id) % arrColors.length]; + if (isProfile) { + color = arrColorsProfiles[Math.abs(id) % arrColors.length]; + } else { + color = arrColors[Math.abs(id) % arrColors.length]; + } String text = ""; if (firstName != null && firstName.length() > 0) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/IdenticonView.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/IdenticonDrawable.java similarity index 63% rename from TMessagesProj/src/main/java/org/telegram/ui/Views/IdenticonView.java rename to TMessagesProj/src/main/java/org/telegram/ui/Views/IdenticonDrawable.java index 52e18d260..6ceba01c7 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/IdenticonView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/IdenticonDrawable.java @@ -1,22 +1,22 @@ /* - * This is the source code of Telegram for Android v. 1.3.2. + * This is the source code of Telegram for Android v. 1.7.x. * It is licensed under GNU GPL v. 2 or later. * You should have received a copy of the license in this archive (see LICENSE). * - * Copyright Nikolai Kudashov, 2013. + * Copyright Nikolai Kudashov, 2013-2014. */ package org.telegram.ui.Views; -import android.content.Context; import android.graphics.Canvas; +import android.graphics.ColorFilter; import android.graphics.Paint; -import android.util.AttributeSet; -import android.view.View; +import android.graphics.drawable.Drawable; +import org.telegram.android.AndroidUtilities; import org.telegram.messenger.Utilities; -public class IdenticonView extends View { +public class IdenticonDrawable extends Drawable { private byte[] data; private Paint paint = new Paint(); private int colors[] = { @@ -26,18 +26,6 @@ public class IdenticonView extends View { 0xff2f99c9 }; - public IdenticonView(Context context) { - super(context); - } - - public IdenticonView(Context context, AttributeSet attrs) { - super(context, attrs); - } - - public IdenticonView(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - } - int get_bits(int bitOffset, int numBits) { numBits = (int)Math.pow(2, numBits) - 1; int offset = bitOffset / 8; @@ -56,20 +44,19 @@ public class IdenticonView extends View { System.arraycopy(data, 0, temp, 0, data.length); data = temp; } - invalidate(); + invalidateSelf(); } @Override - protected void onDraw(Canvas canvas) { - super.onDraw(canvas); + public void draw(Canvas canvas) { if (data == null) { return; } int bitPointer = 0; - float rectSize = (float)Math.floor(Math.min(getWidth(), getHeight()) / 8.0f); - float xOffset = Math.max(0, (getWidth() - rectSize * 8) / 2); - float yOffset = Math.max(0, (getHeight() - rectSize * 8) / 2); + float rectSize = (float)Math.floor(Math.min(getBounds().width(), getBounds().height()) / 8.0f); + float xOffset = Math.max(0, (getBounds().width() - rectSize * 8) / 2); + float yOffset = Math.max(0, (getBounds().height() - rectSize * 8) / 2); for (int iy = 0; iy < 8; iy++) { for (int ix = 0; ix < 8; ix++) { int byteValue = get_bits(bitPointer, 2); @@ -80,4 +67,29 @@ public class IdenticonView extends View { } } } + + @Override + public void setAlpha(int alpha) { + + } + + @Override + public void setColorFilter(ColorFilter cf) { + + } + + @Override + public int getOpacity() { + return 0; + } + + @Override + public int getIntrinsicWidth() { + return AndroidUtilities.dp(32); + } + + @Override + public int getIntrinsicHeight() { + return AndroidUtilities.dp(32); + } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/SectionedBaseAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/SectionedBaseAdapter.java index 1c9f97d68..5cfa5f3e0 100755 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/SectionedBaseAdapter.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/SectionedBaseAdapter.java @@ -8,7 +8,6 @@ package org.telegram.ui.Views; -import android.database.DataSetObserver; import android.util.SparseArray; import android.view.View; import android.view.ViewGroup; @@ -223,11 +222,4 @@ public abstract class SectionedBaseAdapter extends BaseFragmentAdapter implement mSectionCount = getSectionCount(); return mSectionCount; } - - @Override - public void unregisterDataSetObserver(DataSetObserver observer) { - if (observer != null) { - super.unregisterDataSetObserver(observer); - } - } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/SectionsListView.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/SectionsListView.java new file mode 100644 index 000000000..d2ee0169c --- /dev/null +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/SectionsListView.java @@ -0,0 +1,215 @@ +/* + * This is the source code of Telegram for Android v. 1.7.x. + * It is licensed under GNU GPL v. 2 or later. + * You should have received a copy of the license in this archive (see LICENSE). + * + * Copyright Nikolai Kudashov, 2013-2014. + */ + +package org.telegram.ui.Views; + +import android.content.Context; +import android.graphics.Canvas; +import android.util.AttributeSet; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AbsListView; +import android.widget.AdapterView; +import android.widget.ListAdapter; +import android.widget.ListView; + +import org.telegram.messenger.FileLog; +import org.telegram.ui.Adapters.BaseSectionsAdapter; + +import java.util.ArrayList; + +public class SectionsListView extends ListView implements AbsListView.OnScrollListener { + + private ArrayList headers = new ArrayList(); + private ArrayList headersCache = new ArrayList(); + private OnScrollListener mOnScrollListener; + private BaseSectionsAdapter mAdapter; + private int currentFirst = -1; + private int currentVisible = -1; + private int startSection; + private int sectionsCount; + + public SectionsListView(Context context) { + super(context); + super.setOnScrollListener(this); + } + + public SectionsListView(Context context, AttributeSet attrs) { + super(context, attrs); + super.setOnScrollListener(this); + } + + public SectionsListView(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + super.setOnScrollListener(this); + } + + @Override + public void setAdapter(ListAdapter adapter) { + if (mAdapter == adapter) { + return; + } + headers.clear(); + headersCache.clear(); + if (adapter instanceof BaseSectionsAdapter) { + mAdapter = (BaseSectionsAdapter) adapter; + } else { + mAdapter = null; + } + super.setAdapter(adapter); + } + + @Override + public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { + if (mOnScrollListener != null) { + mOnScrollListener.onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount); + } + if (mAdapter == null) { + return; + } + + headersCache.addAll(headers); + headers.clear(); + + if (mAdapter.getCount() == 0) { + return; + } + + if (currentFirst != firstVisibleItem || currentVisible != visibleItemCount) { + currentFirst = firstVisibleItem; + currentVisible = visibleItemCount; + + sectionsCount = 1; + startSection = mAdapter.getSectionForPosition(firstVisibleItem); + int itemNum = firstVisibleItem + mAdapter.getCountForSection(startSection) - mAdapter.getPositionInSectionForPosition(firstVisibleItem); + while (true) { + if (itemNum >= firstVisibleItem + visibleItemCount) { + break; + } + itemNum += mAdapter.getCountForSection(startSection + sectionsCount); + sectionsCount++; + } + } + + int itemNum = firstVisibleItem; + for (int a = startSection; a < startSection + sectionsCount; a++) { + View header = null; + if (!headersCache.isEmpty()) { + header = headersCache.get(0); + headersCache.remove(0); + } + header = getSectionHeaderView(a, header); + headers.add(header); + int count = mAdapter.getCountForSection(a); + if (a == startSection) { + int pos = mAdapter.getPositionInSectionForPosition(itemNum); + if (pos == count - 1) { + header.setTag(-header.getHeight()); + } else if (pos == count - 2) { + View child = getChildAt(itemNum - firstVisibleItem); + int headerTop = child.getTop(); + if (headerTop < 0) { + header.setTag(headerTop); + } else { + header.setTag(0); + } + } else { + header.setTag(0); + } + itemNum += count - mAdapter.getPositionInSectionForPosition(firstVisibleItem); + } else { + View child = getChildAt(itemNum - firstVisibleItem); + header.setTag(child.getTop()); + itemNum += count; + } + } + + invalidate(); + } + + @Override + public void onScrollStateChanged(AbsListView view, int scrollState) { + if (mOnScrollListener != null) { + mOnScrollListener.onScrollStateChanged(view, scrollState); + } + } + + private View getSectionHeaderView(int section, View oldView) { + boolean shouldLayout = oldView == null; + View view = mAdapter.getSectionHeaderView(section, oldView, this); + if (shouldLayout) { + ensurePinnedHeaderLayout(view, false); + } + return view; + } + + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + if (mAdapter == null || headers.isEmpty()) { + return; + } + for (View header : headers) { + ensurePinnedHeaderLayout(header, true); + } + } + + private void ensurePinnedHeaderLayout(View header, boolean forceLayout) { + if (header.isLayoutRequested() || forceLayout) { + ViewGroup.LayoutParams layoutParams = header.getLayoutParams(); + int heightSpec = MeasureSpec.makeMeasureSpec(layoutParams.height, MeasureSpec.EXACTLY); + int widthSpec = MeasureSpec.makeMeasureSpec(layoutParams.width, MeasureSpec.EXACTLY); + try { + header.measure(widthSpec, heightSpec); + } catch (Exception e) { + FileLog.e("tmessages", e); + } + header.layout(0, 0, header.getMeasuredWidth(), header.getMeasuredHeight()); + } + } + + @Override + protected void dispatchDraw(Canvas canvas) { + super.dispatchDraw(canvas); + if (mAdapter == null || headers.isEmpty()) { + return; + } + for (View header : headers) { + int saveCount = canvas.save(); + int top = (Integer)header.getTag(); + canvas.translate(0, top); + canvas.clipRect(0, 0, getWidth(), header.getMeasuredHeight()); + if (top < 0) { + canvas.saveLayerAlpha(0, top, header.getWidth(), top + canvas.getHeight(), (int)(255 * (1.0f + (float)top / (float)header.getMeasuredHeight())), Canvas.HAS_ALPHA_LAYER_SAVE_FLAG); + } + header.draw(canvas); + canvas.restoreToCount(saveCount); + } + } + + @Override + public void setOnScrollListener(OnScrollListener l) { + mOnScrollListener = l; + } + + public void setOnItemClickListener(SectionsListView.OnItemClickListener listener) { + super.setOnItemClickListener(listener); + } + + public static abstract class OnItemClickListener implements AdapterView.OnItemClickListener { + @Override + public void onItemClick(AdapterView adapterView, View view, int rawPosition, long id) { + SectionedBaseAdapter adapter = (SectionedBaseAdapter) adapterView.getAdapter(); + int section = adapter.getSectionForPosition(rawPosition); + int position = adapter.getPositionInSectionForPosition(rawPosition); + onItemClick(adapterView, view, section, position, id); + } + + public abstract void onItemClick(AdapterView adapterView, View view, int section, int position, long id); + } +} diff --git a/TMessagesProj/src/main/res/drawable-hdpi/bigtimer.png b/TMessagesProj/src/main/res/drawable-hdpi/bigtimer.png deleted file mode 100755 index 083bb13a6850efee0c8578e12ef30109c3a1ae05..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 940 zcmV;d15^BoP)_N-i&0br^-!RMA-?rc`I0C_4?z_6RD@A% zAVFmi1(qUIlF&<0xFjqDK@nNewtWZAg~PCSclO?y&4n5GnAtOP@0>H|XU^H{<@5Pi zHMeE4DsN5zCx8>6%G+|2FH5J>TI*7&)RNY~D3A}pXf>G7rjT>a2Ta-h9MBrD{H?C9 z==zBb4fFsW@J*o;?Sw*$1ARbZDVR__a2&V~`~ub}^W?-6K)+y^oca>*8ff`n0;~ou z0Q10Apc7aTur?{yJ^&6fodkLcbXU{|V9U*X;u{J~{{+7CcooBMBwzxucC`2C)t-Mlab4VZ6XmB)pB?*Ybj zA`70U)4vI<=c&KIJ7AYDfVC)u&B+_MQloOu=8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#WJpPv7$2*p;|v=vp`VK5+W|Gy8PwHu!zzhqxu(kzek9{dIm`dHsdE Y)#sjmy0-uP?9K8P8TF?AzS@8B2dT{>YybcN literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-hdpi/ic_lock_green.png b/TMessagesProj/src/main/res/drawable-hdpi/ic_lock_green.png deleted file mode 100644 index a7adbff6107f40c781480d40a97253240c0ef815..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^{6H+q!3HE}&fc;eNJ*BsMwA5SrAC@>VOEQt?OMvTRDSr z1<%~X^wgl##FWaylc_cg49rTIArU1JzCKpT`MG+DAT@dwxdlMo3=B5*6$OdO*{LN8 zNvY|XdA3ULckfqH$V{%1*XSQL?vFu&J;D8jzb> zlBiITo0C^;Rbi_HHrEQs1_|pcDS(xfWZNo192Makpx~Tel&WB=XRMoSU}&gdW~OIo zVrph)sH0$HU}&Uo07PcGh9*{~W>!Y#3Q(W~w5=#5%__*n4QdyVXRDM^Qc_^0uU}qX zu2*iXmtT~wZ)j<02{OaTNEfI=x41H|B(Xv_uUHvof=g;~a#3bMNoIbY0?5R~r2Ntn zTP2`NAzsKWfE$}v3=Jk=fazBx7U&!58GyV5Q|Rl9UukYGTy=3tP%6T`SPd=?sVqp< z4@xc0FD*(2MqHXQ$f^P>=c3falKi5O{QMkPCr&1k+G|j zfsvUBOs`9Ra%paAUI|QZ3PP_XPQ9R{kXrz>*(J3ovn(~mttdZN0qkX~Ox$iU!)YE= zZwhX=nB&x|4|I$^C}NQ!8YToxJs>7L*#bH6grAxROzlO$WPMb)*OGyOvBuNIF{I+w zmdTbL%#I>$=Gl94Z5#|*6?V5iU=(XAQ@RmRHKmE;miChEg4WU9B1%ePVOkM4G7=R# zA~GH)9jOpF;^rvw_$%+e14d`mgb&KwwN>u^eE!Vr?@9BXTMDjfWL(kAd}3A|SCc~4 zUg7?Z?+47bocP0=mT*e9_0UM9_$fnV-iL+KJKK17^BnVfY9KRf z^_0{HZZm)Hv(HL?7j6 zL)+)z)HC@HZ*MS54%Ss)5LYFzYN?34$z;_TyhqI{t|&`?{*zhGRWrXi_C;&)jZK=a z?w@Wd@{3Imo`3Le{A`b_uT6S7HqKjCs2j#A(h-0D$DiH)ACjypg`TB0uG>=bX7ZI^ zEf>^3@7ec2;+o=8v!G|I)=uYsQYI9(K=Rvy%ZvEeC7zgSB64YAkEeI?(y)ktXQHlk zXIgh{5Ha0(&fY8Z^r9ywUj0VP685vaf78#v%uqEoq-*g-$5v3;_!} B%Gm$_ literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-hdpi/list_secret.png b/TMessagesProj/src/main/res/drawable-hdpi/list_secret.png new file mode 100755 index 0000000000000000000000000000000000000000..54ed6bf2882d02c06ff3a6338c8bf231ab838f54 GIT binary patch literal 1119 zcmaJ=Uue@n9M0^zjp>-^5T^(sQ<=^tO`B#mG|sK*T)~dn6|4_}S#n+DmRwA3HtU0I zV~C1^=)i$8l@;+1_~3&Niil%~iXgHnIt4|<2N8UoBIsqV(+6uvF84dW@B96|<6WJ* zYO2>&69iEc?~s!CUyHw0RTX$0ofvhEdK62eZkRzi*#bnX3VQ$<*X3T21hP7K=rM>8 zgon~nX_QXv78Iz{vWuY|-NbByh_pDStn>jy_JCf^5UH*|HhE^}bhQnc3BM|UmgwGx{knH#jyP>Ec0b8*&6KT*OT}8PE4j_@jk^W9WHy6sV4xyb{ln!;a@|qTP3&0$mUbAZ?H1I@g_H%Y zbS%M=dW&4ObSzv+E`x(%+{XUZ=;9Hc9(TJmw%Ax2d|=>dxA0i=7mx18S7IhEwWgf8 zo*zGdws-=k=L$EM7fuYn@*ax~&xcli^?sP>J<`lH+yK(c6|>{zg$%(qc{b12OxN%9 ze0oqmewv#juI=kOWe=sj$HGJD`X`mgpN(Aic-Cw@dt-RKzCdL2!kKxI?DQV|URjvA z^f|JpzhYTa(_ia>C8@EEqnd8 zdb;I#-TNs&k$hKu>su{17WdvCe>7XQtiR6ts^i6vbGz@ozxuhH?U=24@+3H^Tc&t;p*>+&$7t)+>1ONa4 literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-hdpi/phone.png b/TMessagesProj/src/main/res/drawable-hdpi/phone.png new file mode 100755 index 0000000000000000000000000000000000000000..7936266c911961094422c436ae29afef42c1507f GIT binary patch literal 1394 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbBBuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFe_z-M3hAM`dB6B=jtVb)aX^@765fKFxc2v6eK2Rr0UTq__OB&@Hb09I0xZL0)vRD^GUf^&XRs)DJWv2L<~p`n7AnVzAE zshOFfj)IYap^?4;5Si&3npl~dSs9rtK!Fm_wxX0Ys~{IQs9ivwtx`rwNr9EVetCJh zUb(Seeo?xx^|#0uTKVr7^KE~&-IMVSR9nfZANAQKal@=Hr> zm4GgVcpgi&u1T;Y}Gc(1?$;raR#n8ye%+$ci(9qSy(b3t-(Z$rw(#6Ew z(!|^xrq?AuximL5uLPzy1)F! zNq_$Tw?CY~PsN@kVS3pK%CIWM0n zB$(CkE}18E;knQIrb2th+Ur2YcPqa5Ft#Px@0H!c*ioM#IG?M;NAK=yql~K?7=0_G z0&LP1w6A-5ys3A%W4mCht$|6OvTELhU3~{H{8_=26fxOICPJZ#cSUosADA%sQXe6Uzw{Ye#PxW86<2qxBh=x?r zgiBL2wuHp9AIYkaaSnMsc}V53qP6;-bxQd=U1u-tp1^g!@vVka zcS}e{;D&O8uQ86QySN3S89o*%{IiSLb!kD80$0?c<4hl&GR%&%z7u@o70lW2tIT_W z1WQX}gzT-8PnwegcGnuZvOa!MaArmG28IR(W`_9Es&v-AtRhe;=;`X`vd$@?2>{a7 B<*)z% literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-hdpi/popup_fixed.9.png b/TMessagesProj/src/main/res/drawable-hdpi/popup_fixed.9.png old mode 100644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*2-0Oku}2@^(L zHEOL=dj%II+(bH-?_N~71TU(%SGUgj)h+ij;{|z{(Y@Y#p0D?+e?%eS2pXjWpNW3} X3V}6-U+B$#00000NkvXXu0mjfgx-Jh diff --git a/TMessagesProj/src/main/res/drawable-mdpi/bigtimer.png b/TMessagesProj/src/main/res/drawable-mdpi/bigtimer.png deleted file mode 100755 index 6e92a895bb7b4a9b0df76f3a5d0264f799bd6bec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 653 zcmV;80&@L{P)1`E%^rT9z31b7p7VU29VHfvner(`raVi*ffBtp_0WWlBHtzfqoy%?t z@N^caHReA6nt(WV175)hOCujv;P)g&Ej7Hc{3SfMkAr-O!2Ei5A0U{&_Ccy~T4dByI4KU}c zTuuXb+$D{gl&Eq9M)`XgR2hlD1bbYBeM3jR9?%i-0M1m?F`Wa$)Lw~J-J*6Fi9j2* zKgoGBsML()kft-v)jg2PVp#`jsNa&Dzl>W~aWaa@_YL*MwMEu}56#AjWB@1{%xdN1 zsl|+`0DqhlQV!fxcT3bjpW2>?#-FSMC)86C4mha~jTGSy!za37OowqBua9WDLB9hC zov49%F89Dt2FCk&t&kP$@oZ=mV*?MAhs$HIonZQz_y=X3Z$Z(TySUe#Zhs}y?*dfy z97n6#)7RjERo()+G?xp*u2jXR+W|UZ<%?-JL2pM{v~C!_&2&#i=F13TWAwm7@n9KyF#^~?XH)H!?dUsGnZVZ&Cu9OCed`Al1&1w;zQcX-p?6MDwib|jKsrsN)5VB|5Cc6*DVP?*S@B9A$ zKmRvV&5Rys+qiurMNw_(gHo1^9pu^C8X#}==i^~AY{SWMoI?}1tT>Pw(vb>5+EgZC z7ApG8)bFsLqWrXxAIIbJAyGpnqj(smV%mgFQT+oIThU4o0~JmhR-9gX^q2;Q9;e5m zGAG*!STqjKIxsgon%8DaT1=-0_JjV4NCZrX6;LscS*}=#(<{0nnS0wT4OSqy6sK2{ z8kaL5fgA{;OgN}+3G z)7278yCG}2YsW+mjIAg(%QKu;QXMGE--nuJ1MT80{4d{c3cL9k8?ssGqG?AXjhpE5 zLfK-%feJ=W9-(9PQ_K_*Ms5+=AdwTmo-xDHQQ7TT!OOCkwp^@O8ca)ZnkX=ap^Fhg z;(JqlDIv;*c|I8#N{0ISV%+eM5R-cO1Xt%uNSijHh3j0s!HscExthU;8EYgo7#1s)0X!w=4w+^ zXCM%m1{XG{y8=%NzV~7Pt(-rk!)!&;Q8H7r>vVs;2{mzcX_K_qcm! zU(B8P%jjxf+Mpf)%zD-8{&IEjYkRfUI#PR5+I!@4Y50$+TT^;21upm&C;$1i=b^eE zoH*NE+k8&`aLLy{_{zWV_=k=?GsRA{``RhKWig!jgzoed{ELr@ftOnjZ+*D#ZY#5X tzBqStJ{t+Wt)6?9VPhAMyk6Jx6Se8V{lwE>T7L6>1nK0cbbGjP=3hWeacuwq literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-mdpi/grouplist.png b/TMessagesProj/src/main/res/drawable-mdpi/grouplist.png deleted file mode 100755 index d585fb8754f9b6c04bba4e25956b83576da1647c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 377 zcmV-<0fzpGP)&00004XF*Lt006JZ zHwB960000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBUz3rR#lRCwBA z{Qv(ygTB5#0~U|~#AZNz5Qx_U@h=7 z=7+MGfjA$Crvb4yv4#o(F(;ZB$RI5!yAFsaKz*?Vh+T;>lo^NXze8zzG;u#-41Ep6 z*U-ei0P!6tTNF)>huAQkj>ex0HJAa(a2R+*tf8}j_yrPwA`*KF68kSyEm4MsLn90Z z%#hf-f%qnry%mU`5;D{Sh))9XA|Pf%5(lN#dqCU(b(uO;+y;o#(8HAxnxjC9mIARc z19<=x-hDva4a`wrU@o0Zih+!bj0{*(04V)#ME3qZXrL1XK)yo*f1&sV-22o9009O7 XSD8J%YyFsD00000NkvXXu0mjfd%=w( diff --git a/TMessagesProj/src/main/res/drawable-mdpi/header_shadow.png b/TMessagesProj/src/main/res/drawable-mdpi/header_shadow.png new file mode 100755 index 0000000000000000000000000000000000000000..3f23c3eb5c6f701aa99333238862943f16a31edd GIT binary patch literal 939 zcmaJ=O^ee&7>8RIiOJNYz3I)H z;Mu?6!JByS;zj%cf(L(q7w;n0Nw?{Gu!bb_!Sg)tJMa6RIHtGfcqw-ORnw#gKo%ug z5ZSAhBn7D&k}F{IKo%|b#;9wyHnG@Bhf_);BnWAm@@bhT@kEfS)oQLG%O!>=C5wxgJ6qJ zXcu4P`%mGdzlgBV#R-|mE^FNQC=V4OBgPITai5U0qKcg_G*y%(si`!SieZR~Vkl*`B5I9-YZ7-J;E)zv z?}97u?PMi*PmJ^6HN zTejF5ABW8CF|+lTpReDtD{$g^`)%6=gZeQet?CMSZ R*Q?L@^|6|5^Ud+_`5&vNArb%p literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-mdpi/ic_lock_green.png b/TMessagesProj/src/main/res/drawable-mdpi/ic_lock_green.png deleted file mode 100644 index f700548daae315bc62b9b35dbf38feb263a047d2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 229 zcmeAS@N?(olHy`uVBq!ia0vp^AT}Qd8;}%R+`Ae`NtU=qlmzFem6RtIr7}3C1v2z)hZG1Q2)pO ze+Q=yzmedI6VfN<^&Z~fv*1y$Pk^7|ly^)?sv7Sax}G+3%y0_Tu$5i$o1LTiMu1^z zO6wX0rWFs=&)6yaHs2&8%sjCnqqT=e`$rx_rXABOJ43;R94tRpymy-PiPZa9G*08)UKh`idtFiV_Za`naQN-#LOmk+DvK#ro=R84^?(D^V*E<%o}H3 zOas=<*+UOyFBaJa1rcRIWcN@HQBY|0s2)UuP!U19D0=YVo7z+l#$jgOAHMJV z{oe2Q&74d19`e@jtfwf-o9L0!WNakQrVSqQ9$tzT$(iz#oFa_NtY>J9>6iiteh8SewkY+^b*ZlwFT-*|6E86Q@{D&27qL<#~C&>@yVK_4+}p%A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essagesProj/src/main/res/drawable-mdpi/popup_fixed.9.png b/TMessagesProj/src/main/res/drawable-mdpi/popup_fixed.9.png old mode 100644 new mode 100755 index e9204993dc43cd9559caf103779567c5c59e11cc..8b72316de3ee7b3ae4dd8dd6f9f0618b5bfc112b GIT binary patch literal 1312 zcmeAS@N?(olHy`uVBq!ia0vp^PC%^0!3HE>FW}z|6H_V+Po~;1Ffc1+hD4M^`1)8S=jZArg4F0$^BXQ!4Z zB&DWj=GiK}-@RW+Av48RDcsc8z_-9TH6zobswg$M$}c3jDm&RSMakYy!KT6rXh3di zNuokUZcbjYRfVk**jy_h8zii+qySb@l5ML5aa4qFfP!;=QL2Kep0RGSfuW&-nVFuU ziK&^Hp^k!)fuWJU0T7w#8k$&{npqi{D?ot~(6*wKG^-#NH>h1eo~=?wNlAf~zJ7Um zxn8-kUVc%!zM-Y1CCCgTBVC{h-Qvo;lEez#ykcdT2`;I{$wiq3C7Jno3Lp~`lk!VT zY?Xj6g?J&i0B&qvF*KNf0j6J(SfFpHX8`gNOrftYexnUy@&(kzb(T9Bihb5uTZsl3!k| z30CjxYvq|&T#}fVoa*Ufs{}MbFEca6%EZ{vz{SzX(ahY**wE0`#KOSM$imFh%*EB* z#L>je8K&1IKe;qFHLnDwHwB^B38!9AQpha;+U$~Alv$RV;#QQOs{r=0RVHq?Sl~1d zsy79=$*i0Nl0smO(Ce+3<+_TQi8-I$kE<0`s{E3nn0&G$Or)~ZMCyobcfrZL!V*ZnK* z|4;U(WYOCDVmY#hH`rWrYLSp+K4g6CjZvrI-mkomHoe|8_xnG=7S^XeJB8VwEee{G zIm0HPuy=uZecKL+wuc8Lij_BtEs*fPb}PE(kHee8t2!*T?E((E+^l7 zdRd;odA=rWZc^LW`9sIby(LN0)~9c^Ue4@CxuJdCdUH~EovtXCeU%FB&~g!dq~8*8 zxK-_sONY{LEsqXQJxgz2wxib13iyRWpe(F-BuG-mOt7)}m;yDuPwC zif)QUD0U^dDHQ3(RlAY?igvGmO8gD2py_w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1;nWLC3b_S9n_W_iGRsm^+=}vZ6~JD$%Eav!W1Qwe z^`_u`as9%gCZ6wqG3Y7)B|F|lP!<~Pxz^Mz|>v@Ox6?g{G)82|a>vmIowCIX>3eWYR3)$JGF4~Hmk$3NI40)j7e=~Ls({*2ot0MA= z9vOBL5AOs%b`boAZKR}W>Z ze6o%%6Z3f%|KMhUZsu?QU7r7pHFjE`aM;`%qsiDGmhYO<9q0L~Jf|%oFrqzwyG!zi z>>&MnE6zG*UFS5<>)_&3$$n$qBXQV(Ro>6_wyONZ7ZuaFXJ#nNSP6>ecKAnZ8eTUn}OKkUL>dYu@_#Q*LO!YD}(Z5agKpXyUo~49pDog^%5m Tcb>TyRKj_>`njxgN@xNA;y>fS literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/grouplist.png b/TMessagesProj/src/main/res/drawable-xhdpi/grouplist.png deleted file mode 100755 index fc062608bf20a70b6627ae7098225188a326e9d6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 598 zcmV-c0;&CpP)AbteIYk+tz5dWoxBQIXONOFjF0r4&% zb^>BHAXbMud?pZY0b-uP5cPFHT#85D1L~0hbtpeHx(R^P;60Qat4|B912x&QzG07*qoM6N<$f>7t_M*si- diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/header_shadow.png b/TMessagesProj/src/main/res/drawable-xhdpi/header_shadow.png new file mode 100755 index 0000000000000000000000000000000000000000..5492342b54ec86b3c01d2f62f1a330fc669f5500 GIT binary patch literal 956 zcmaJ=J#W)M7&f$2sG^9mu=I58021+M>?l@D8pjEZRELm6YQ{MBC9zWbjC~Jux@_|a~vV4%nj-GI2*2Z^H9!(*aBn(4(6ykIHoM~gDif^o4Ga01IGM@oUF`G2VA zEzuEaqRV{$DIB$@0pgk{!sF1UjqC3wp#rrWB8%X#jq!0>#l{d591U>*$}I)lJ#u{q zPojHsylJX6KO&ZIqne>Xs=&Igqw2b(m$G?Tk$F)NDp_5smMexXmc<-jHF9#wHLyMQ zkWW&sbIDa!auX|f0gY^+(0z)WYKT2BKeFns&P7_Ox8ORfbIGpcax@t(Y3yH(PPeFg zlIha6bg?u(@~PWHYU?-Of4!qug0C5+cKoI1bi0k-{?+sS^J{0%tnIzi^|O=i_TJB( mm%mT>!>>CxBc$7X`{EDXCnr1r literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/ic_lock_green.png b/TMessagesProj/src/main/res/drawable-xhdpi/ic_lock_green.png deleted file mode 100755 index 8515448c4656828d64763e43720de821b65fc155..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 296 zcmeAS@N?(olHy`uVBq!ia0vp^B0wy|!3HD~Z_Q5tQj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>JicWdDIEGZ*O8WEvzdf@lqcHPSM&-j?b}>b14s$q;Jaf?D z60PPvqTX0xCorFh^AG=jj|;6j4tLm&NH^S&?@(=+A=#z6AW3>bR>a0kH+ESE8P}Hg zLJc!`JG?*ayfDS%aDqZtq3V83J7(dFKl&RicsiagwBXTdm=1*{Bg#__r_wjpydTO7<4&SF!~t=UNk7+ sG?hBNn5|FBV@>1o6&d$38yJ`wVvH4wTNzrP0e!{b>FVdQ&MBb@0C+xY*#H0l diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/list_group.png b/TMessagesProj/src/main/res/drawable-xhdpi/list_group.png new file mode 100755 index 0000000000000000000000000000000000000000..98e1e2be89cfd71a0c1c021c7860bc4b60b33956 GIT binary patch literal 1388 zcmeAS@N?(olHy`uVBq!ia0vp^azHG`!3HF+C+nOCQj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS=07?_nZLn2Bde0{8v^Kf6`()~Xj@TAnpKdC8`Lf!&sHg;q@=(~U%$M( zT(8_%FTW^V-_X+15@d#vkuFe$ZgFK^Nn(X=Ua>OF1ees}+T7#d8#0MoBXEYLU9GXQxBrqI_HztY@Xxa#7Ppj3o=u^L<)Qdy9y zACy|0Us{w5jJPyqkW~d%&PAz-CHX}m`T04pPz=b(FUc>?$S+WE4mMNJ2+zz*$uBR~ z1grP;werj>E=kNwPW5!LRRWrzmzkMjW#Hm!?rdOaZf5QT40Tr%Cv!75OBXW(S3@@o zOIJ5zm|mCsATTyALtl;P{bldG)xGXdO%EgvITPB2|qOtnA(eg$@*FK3rz+F#s{7*jv*Dd zj!fO}E#oM1{Ck+|log!{98Dc}I1id-_C(C>S};dJO8?d}AJL8_0RcV_>lJQjazu65 zuM3nGwN>G0Y8AWgGO1&#y`EQx!mmmL?!!gDtsjZoy?HbHX037lz1f{d9~T~WUcW&4 z)kE_&hgz@BJpHuCK(v+h*K8NNs2Rr|@S^4cB z-;$nX3+yv2e_jffnJKg>t%A2yq4bydxd#$_|DT^!UHM<`*8*S5&9BvYqy=jrO_vd$@?2>^f@ B1w8-& literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/list_secret.png b/TMessagesProj/src/main/res/drawable-xhdpi/list_secret.png new file mode 100755 index 0000000000000000000000000000000000000000..f4ebc8b571721c05c847200eef830af3a47a5e22 GIT binary patch literal 1144 zcmeAS@N?(olHy`uVBq!ia0vp^B0wy`!3HFMdEYGqQj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS=07?_nZLn2Bde0{8v^Kf6`()~Xj@TAnpKdC8`Lf!&sHg;q@=(~U%$M( zT(8_%FTW^V-_X+15@d#vkuFe$ZgFK^Nn(X=Ua>OF1ees}+T7#d8#0MoBXEYLU9GXQxBrqI_HztY@Xxa#7Ppj3o=u^L<)Qdy9y zACy|0Us{w5jJPyqkW~d%&PAz-CHX}m`T04pPz=b(FUc>?$S+WE4mMNJ2+zz*$uBR~ z1grP;werj>E=kNwPW5!LRRWrzmzkMjTYG&@}W@zYYV(DgVVhQA!xjI>z zT39&3^t$9Hm*%GCmB93-AoRN7)C)=qxdlL*T~doO%TiO^it=+6z+Se>#O)SmoaRCG zrr>sq3r@ZIK*#8VA{Hs4VM4&v17gCHEsz6G_^Elo)LsNk)?58ouLWj_H=ZtzAr-fh z{`~)M&upf!)iYMk<0->Nb%E7Rt@+F!%M|8)I`jUSbIvb`jglNDYXm$>84RVF%RX>- zoNjFMbC{lRC@F$0q1BQfcpQVrWKg^k7^DgTe~DWM4f D`#*cY literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/phone.png b/TMessagesProj/src/main/res/drawable-xhdpi/phone.png new file mode 100755 index 0000000000000000000000000000000000000000..bed929c52edfc61ecbc0cc963b30bf2c90cbb20a GIT binary patch literal 1571 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWuD@%u1Od5hW46K32*3xq68pHF_1f1wh>l3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|81#=KlDb#X~hD#E>34K5C;EJ)Q4 zN-fSWElLJPT$(b-ssbzLqSVBa{GyQj{2W*)24v)y2=9ZF3nBND}m`vLFjeDsTY(KatnYqyQCInmZhe+73JqDfW2&$iQ6p}IL(9V zO~LIJOPqT3fsWA!MJ!T8!-RmT2gHOYTObFX@Kf`Esl5o8tRrq*(PUs?n(pc17*cU7 z>CgZF_J;%5e0ZE?da4qxFe~3>*4d$wlOA8p9%S4QA<+Ntx3C}c zAKO%qcOFg)isE@Y>H{7zcvYt?`O?YV_(NVOUaTXXf2NTyXA4hNP8@$65#Be;j9@sCycC@prg7Y~Q`+U zzPjj7&^n|v^(2F&$YIt?oF|MGsu?;~H_W@?(d*MQPu*d0QEbGLWy~L$6vPe*elqSb zh-2tzZIlQJ^jR9F*|Iui)nO$${v*#9nD8`o-EmF1q1fcz)auphXe@BQIV@+6$D>ad zW)!eK;&!;>yX>cZh9t8A!z*zK#*dCVMHfXZ=B*NyRAhMNZtdi~+`f6Eni^X}*H)>F zoHg=Yat)2A9b{OJ+;iAduTjOowvBP4u)u8thi5|fCM2>QcK`}G?A?{45XSz$s-gKnc1uPq18-!lLKtHbZw9+3ThzPHj@>B}9$(J5G)2Oz_E8`|IOR2q cFtA84yo;GCd`Bpj4^(V>y85}Sb4q9e0C8w900000 literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/popup_fixed.9.png b/TMessagesProj/src/main/res/drawable-xhdpi/popup_fixed.9.png old mode 100644 new mode 100755 index a081ceb95dbefcbd63d8fea534f5e6b06006868b..c94b50ef8f530226fcb6df0717add637daca4316 GIT binary patch literal 1744 zcmeAS@N?(olHy`uVBq!ia0vp^O+f6#!3HE}zvlA8U}fi7AzZCsS=07?_nZLn2Bde0{8v^Kf6`()~Xj@TAnpKdC8`Lf!&sHg;q@=(~U%$M( zT(8_%FTW^V-_X+15@d#vkuFe$ZgFK^Nn(X=Ua>OF1ees}+T7#d8#0MoBXEYLU9GXQxBrqI_HztY@Xxa#7Ppj3o=u^L<)Qdy9y zACy|0Us{w5jJPyqkW~d%&PAz-CHX}m`T04pPz=b(FUc>?$S+WE4mMNJ2+zz*$uBR~ z1grP;werj>E=kNwPW5!LRRWrzmzkMjW#D9BZfI`iY-a9cY-s3e;^=B&>}2fX=w@W< z;%sDK4Abk9pIn-onpXnTn}X2mf>SRjDdZLaZFWg5$}CGwaVyHtRRDY0DigO`9C4Zl z)tiFbElxP~>H{644~kf%h=vIPQxAvHLCehN~I#)dy zy#uznbS;^@hrPx^kg5AY{XaFy$?IHXrZmhrq2a$mq_X;ElxOG#?h8#E4M@F*>gP7P9?n|!`$XsUgU0iP*Po9T>{E&C+r#$RbHN(-mpi7puw<&<74;DCXM5VQ zfGd#IBf%|^#c0Xo1%^(%A-x((Je&b#4~3W{pG`j?vf$mK|94j#wd^sS!4z^Vxjt6P z>41&Vm-T<_K2|U8fBo*g)cb?U)>|z^uI+N3{lr*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JCSZ8#Q>6#OTSNBkh4D9~X^%n{zas__ zDC?y5kSHr;1FHIraNJ~Q0cYGRA{d?`o%><@fwXN=$m)mOxaFHfh*}q-0v|PYQBrN970w`9Wv#0V04v1P}oPB7g`W5CKF0fe0W12t)u8Kp+B$ f00R5?SAYQkkzjMFqH46!00000NkvXXu0mjf;GiOF diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/broadcast_w.png b/TMessagesProj/src/main/res/drawable-xxhdpi/broadcast_w.png new file mode 100755 index 0000000000000000000000000000000000000000..c60de471f969a6e68d7357aee1b92058b3c8731b GIT binary patch literal 1594 zcmeAS@N?(olHy`uVBq!ia0vp^_CRdI!3HERo=z$RQj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS=07?_nZLn2Bde0{8v^K0UTq__OB&@Hb09I0xZL0)vRD^GUf^&XRs)DJWv2L<~p`n7AnVzAE zshOFfj)IYap^?4;5Si&3npl~dSs9rtK!Fm_wxX0Ys~{IQs9ivwtx`rwNr9EVetCJh zUb(Seeo?xx^|#0uTKVr7^KE~&-IMVSR9nfZANAQKal@=Hr> zm4GgVcpgi&u1T;Y}Gc(1?$ko-*(Z#^j%+$cx(9qSy$<*1{*~G}e$-u(N zz}49irq?AuximL5uLPzy1)*<0Kevsa@QKCP#OaWcwPeYQ`?^aWNM2H8;B;-nx{(V?J}&vsRn>lgb{ zjV_7zG9s~iDlUInBq%A!>Gr`vclFob$?1+ymj1qNzWe>#Gk+cw-?}^V@0tAcvhp;c zzQ-JAll6Bn>ov+hu$5q6FFfmXc~kWQt@9ga?>hCK+5f;z-E)ziS!#0`rXOt2J)(Ik zSgP~->74XGaTBhn+>T9{rR*p8{fs<=|G}9G;_AtB-exCgt*D4GzRxhP`I!@USMal! zal2Eu%?=fjn106mRL=aMTjfa~CT^BL)6iugw=}5#l)({m`)^kcU4Po|aAhMy)#7y~ zTOYDNP^|qVs=52}(G@1D`@80yEMFezSo^Q7^U=INg^3vxYHp=eCO%!eXX^G(VfRi& zS8C@YI6rTktT&AOH|^x7^#?Yr{In(RDr4L%s|SCX-afFIVd`4%J zPoUo0^4~`+>i0=}steDIKe6tixmfG&HFJUs`gb3k5wJx~{)uh9^ctg6YenBJTHY1G zw7hk9^QYB8)u;CO|B{XS!*aFf)87ef{0C+&RA$dy>r@%$zD0@qB5BnO7ajI=5A%j_FUb*@2TC z(hV!vlOIS&FeoqR>=WI^Stzo_@Lat%*A0!BHTl2)A60z#uJ6vl9c^XxdoL#P<@@dU zeb=(kbvfr5yJz=rPw@M6|6r~B^S^@c^v9=$yuB!Y!r{>S+ zvln6}DA%0y?O%B(-~V!q?t?{BYISxW_F8%F;aYA3234MGisy{lD?p{Wr>mdKI;Vst E0FJ3~nE(I) literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/grouplist.png b/TMessagesProj/src/main/res/drawable-xxhdpi/grouplist.png deleted file mode 100755 index b63fa34e3de3a8eaf00f6265e2aea59f4a358348..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 877 zcmV-z1CsoSP)h zrR-=Gk(P*9Ekjxju?%ba{>&NHn0wFfoO|v$JNJJ18up%hXMUgaJHPYiZl>96iZp9~ z)CUv_h0Z_a;So3oH{h@EI=mf60M%;MFMwS-3g3e#x?HQnW%w!lc`s!^pQYzqhQ9>_ zFJv}cg+IbmNdrKEJ%{@lZTG=5@a;qZ!1y1=#}k8Fi}0Z&WI&PG^PS4V<2?-ky-(>p z8sWRo8Qe20XBhfC;5!5IhP~g`C^Lwx%(Or7C-}Ym{0qNAM~wIaFc1+w1%H|Wc@>_9 z4|ZH5_!kHWAWZqnfT%jI==rzs5aT&BfN;w-02@_28x|BZ__n5HU2+D%N)Zatgl7B0 zRGWRR1WnZl$*!D>nWZm=AFrb=%LVp~O91N@0Q|OGUFebhX%Jk zR@9F*VRnS})5ki1j=5@@X*$ao%N4`l;v9f(7L=G{d`@>(LPl1603bbL&Ik?JmZLX9 z?*P?gC|UzR}&a93}-3#S$M1E;7W{darvAbZ|fNRjM=uWABv6FGJ3!68~}nJl7SaBm#*|4;g>w{;2f&Z zxj?@n`;3**c{z%pDbO*|dJ}Zk(s@8xy3%DSJ1KZa?^loo^RWRy;Iz-aC|YOvSrLyK z62hz;*AImH&~&%n(f$G;R;&O(&_w-)?1jAO9o1w;EfY}H?9dfJq4m!DC45BmwzlMo zlBUTG768OfV|+b}qWYYeBf~n7d{{jpE&v?C^NGjHz00000NkvXXu0mjf DH?WA* diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/header_shadow.png b/TMessagesProj/src/main/res/drawable-xxhdpi/header_shadow.png new file mode 100755 index 0000000000000000000000000000000000000000..382af9c5019c73479c213753252b133fb88461f8 GIT binary patch literal 956 zcmaJ=J#W)M7&ad&rJ@o{2&R+6K!Nx(abgowxp6`x;V4QXH49Q4`;u6Redc_@P8KS* zu1G8(#6RE3!d?VC+H zZqV=QX8OPJ=IJ{++#;0@X`w!eZ44R1MLh^=zCD0VXuH#AUto!0F0o#_Lps(I%|SkA zrx-5rL&|2D(ryyk&Il6Fg99(n*BJ?rW%rzrHE`a z4Tzm&gDA69Fk$3iFC-ocK&oi>(1hqL&GhUDez=kiqD7f#!T7`ud65&+BQ1fJ^?#`E zuh0=`!t;FpDIB$@A>^AdLKE!J#`QC4s8B0oXcL6n2#uFjYzz@W(GZ28+)}{Z121q< z9PP~UmZjB#h}eMxYo^Xp1 zFd$2=d(Ji1a#Jh#A&qQ8>^+BW6(b+akF0s?b1AIVTX5a=xfIuOd72ELHukSZFSn?B z(&@^!bg?o%45-^NwRQ7{Dbp(<)J&tDeC@g2ZliyEv2*zQCU^Ay&d=kWlPhm8XRgcN lUv)ppk`jyU zfOtC8x1<1&uQP#`AHt=836EwsAYM#{rLbsO%(#-@jZ_~i0P!v$=AkeReF1p@=<^4} z`nZ(}mNG!iXeHLihCsX(he3a!iDxGezeGxW?$E@?fw)xA94Q}U=6OOvZHdF;3FwxhIRGR#5r?!TF>$Pj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~@0 S$Ce6E@#E?0=d#Wzp$PyT&7`*g literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/phone.png b/TMessagesProj/src/main/res/drawable-xxhdpi/phone.png new file mode 100755 index 0000000000000000000000000000000000000000..4d899437885392b19784e89afc41fcb57a756af8 GIT binary patch literal 1860 zcmaJ?X;c$e6rL1~8WltkOhp|dZfKSX5Xg`~kO2vYK*Rv4LN#Uv2$)Pv1~Pz0!g6q< zRTOJ`po)kU5KvKDH&Ac^af524sI{&I6@<2ma>Uw+g7!!0oSC`rz4^ZH-gobPXEw;g z7L8|o&Hw;lyfhezplq=98BM3&k==(EQHDtbDv2d{9AQ!!Fu)(hS7M-4tBS`WFcq4* z`XVL*02`J@p(K>DP*{y?IVvlLLu&OD8vsOpq+X>?!U%9B7O&BXSv@CDvp@|hW<`6- zcrtwemY@kvGhj>7!W8PXB()G_`T2q(5~c*S7@-15?JAuSCdI7xx-d1iE^}GndkB#v zW_<`sDU*W%xB&w_IqqyV4}w5}fCG7W3Ixyskk5noTpo1`*pLV8DS-K2;NZogycy6q zI06Y8^hM3YtOSD4!(6V(Wa60IIk+L73kiins|KIXrVwmns*X^RY@KoDkOG1k)dr28 z(BL}Is;F9tClg{873qg9X!Rdub;iLoQ3>OcDm@qC@T^-J0?K6n57lZvqK!lZ_9@=~ z6gDbS^%yq-GvdhxHC4E{nO0YNIKY6Z2;88+@l``vlqcW>ZcM=SV89XqI5%3OLvfRF z-g~@E21|8DLZwq73QHh2zL{vPT>XzPSBW2>(vnlUXfJ zC&q?EvywJ6*L1&wc7ZkVDJj$;y(Y|f?aqr&@q5+iWvu(_N?vAyhg;sGr>Y5)CG;&c z6ku9SX*s{hMImQiJ@>;nPVQlswO*0M;rFZbW&77kVx?grsGRw(rE)}_4-met=gc03 z-}#N=bDd)k$fwFPHm{~v*p^w;MWGhj+dn7Ao1dDOiY{D?n%d&LdG&=d+s^Dp?`?`v zH##9(OZd!4`iqKftj5ibZOEAex-*Zcg7k~>!7ar>Gf^I6vQx!}ktt;S^XgjUH zwT9foFMcyk{k?NkMzBnB%(iuNdJq39M%FeTR-Vk_tc=Orbni3_oG7^WN2FeLqG7d7 zr|PqP?G|F)HXazW?$$wJ$Gw(Ba?-$}(&KmT^aB;-nD0;TIx$#eo6#i@nwY~O*n`?8N$Gnma_%|xmqpj3v&Ncb7wN8K-0cMSyUp!U_jxh+>s-4_ z-%c;6H#Ht*H~&xsZ` z$ygKG8sy!Ul=pZ<4tcZy8=jbW-m!RE&`R;b1c7CJxB>EfuB7p9+zKNl6Y!&wQC3O zr`TL~kF-lBm-M+Jr4kqQO}sfiXY|?jZr9*51L-cwVUSG|z&DQrZJMlh;6?_G4(#f! U&zF{wC$0ZAXLa=KgO5VKL7v# literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/popup_fixed.9.png b/TMessagesProj/src/main/res/drawable-xxhdpi/popup_fixed.9.png old mode 100644 new mode 100755 index fb7d715fae95068bb35b8e306300615a041ae173..050190c718687b57b510230d8b28ed7217ee49d5 GIT binary patch literal 2195 zcmb7GX;2es8gAGygu~ecgjrmHra=*bT#&HD1VRoZLgWetMAVQp5@XUa=@5>=1(s6~ zTm+9%Tr6dVLns7lQE*0OMwD4$aG>yj6tJb}2r3GWATzj)BhLPit=g{c?|AEZp7;3P z`l^c}wr*Z!xyBLzfK|c}eiSx$VP7Kt6Kpj7)p``098f_l8jU2O2B{VXg5*dd3<_1! zJ#Z8(m8b3Rfms0X2S_1~MPo%_Oc|mgNtZCBRFwu}0{|;9RU?%tVH8Y+_bAkC=y~TA z2vo?~kc2Lxh%`JnSrL-1g`?BAie>3anZFzg3;#-y)P41FmkF?L#C1_ODQb_MWX)= zRjEFpb!Zg)d%PbN)``sRCav-H#tc zr%`!~U|taaFN|d_ACc)*uo_+F%75q5R^%?Vf=YvV=EGV=3M>!SA}a7*%1p(Iu~36o z)O*jBuN(_yMJ^c&hP-sJ|8>yICaimwmLJ*{+k9wzS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$RsPL;!Z9N7#j8 z@D`{oeq=nV^EkgPFY)w?D69ED-G{X_NKEKJZs1xGaOniH2_7X~{UR@HE@3&sOT|Co z#5w_#L&=g(BH<<=?*+7G1YbaWDKVY)YARZecwSMn^z%mgYOWNwy%n{NNSd(j5+if9 f1zIhoiod0v*<5qVc8@`9bcY~@Epz{Enjimvf&M|# diff --git a/TMessagesProj/src/main/res/layout-ar/user_profile_identicon_layout.xml b/TMessagesProj/src/main/res/layout-ar/user_profile_identicon_layout.xml deleted file mode 100644 index c35c5daa2..000000000 --- a/TMessagesProj/src/main/res/layout-ar/user_profile_identicon_layout.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/layout/contacts_layout.xml b/TMessagesProj/src/main/res/layout/contacts_layout.xml deleted file mode 100644 index 8b281bc3e..000000000 --- a/TMessagesProj/src/main/res/layout/contacts_layout.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - diff --git a/TMessagesProj/src/main/res/layout/identicon_layout.xml b/TMessagesProj/src/main/res/layout/identicon_layout.xml index 1b4dac4d7..aed5e9270 100644 --- a/TMessagesProj/src/main/res/layout/identicon_layout.xml +++ b/TMessagesProj/src/main/res/layout/identicon_layout.xml @@ -15,9 +15,10 @@ android:paddingTop="20dp" android:paddingBottom="20dp"> - diff --git a/TMessagesProj/src/main/res/layout/user_profile_identicon_layout.xml b/TMessagesProj/src/main/res/layout/user_profile_identicon_layout.xml deleted file mode 100644 index ae0129fed..000000000 --- a/TMessagesProj/src/main/res/layout/user_profile_identicon_layout.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/TMessagesProj/src/main/res/layout/user_profile_layout.xml b/TMessagesProj/src/main/res/layout/user_profile_layout.xml deleted file mode 100644 index f9583be97..000000000 --- a/TMessagesProj/src/main/res/layout/user_profile_layout.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - diff --git a/TMessagesProj/src/main/res/values/strings.xml b/TMessagesProj/src/main/res/values/strings.xml index 35a1c4601..c5e718a90 100644 --- a/TMessagesProj/src/main/res/values/strings.xml +++ b/TMessagesProj/src/main/res/values/strings.xml @@ -187,11 +187,11 @@ Block Edit Delete - HOME - MOBILE - WORK - OTHER - MAIN + Home + Mobile + Work + Other + Main Contact Info PHONE Start Secret Chat