From ce33df07ad27f64ec578d7a0770e251f6fbffdfe Mon Sep 17 00:00:00 2001 From: DrKLO Date: Tue, 18 Nov 2014 01:04:31 +0300 Subject: [PATCH] More Android L design --- .../telegram/android/AndroidUtilities.java | 32 ++-- .../telegram/android/ContactsController.java | 45 ++++++ .../org/telegram/android/ImageLoader.java | 17 ++- .../telegram/android/MessagesController.java | 3 +- .../java/org/telegram/messenger/TLRPC.java | 20 ++- .../org/telegram/messenger/Utilities.java | 4 +- .../ui/ActionBar/ActionBarLayout.java | 8 + .../ui/ActionBar/ActionBarMenuItem.java | 2 +- .../ui/ActionBar/DrawerLayoutContainer.java | 2 - .../ui/Adapters/ContactsSearchAdapter.java | 2 +- .../ui/Adapters/DialogsSearchAdapter.java | 9 +- .../AnimationCompat/ObjectAnimatorProxy.java | 5 + .../org/telegram/ui/Cells/DialogCell.java | 8 +- .../java/org/telegram/ui/Cells/EmptyCell.java | 1 + .../java/org/telegram/ui/Cells/TextCell.java | 8 +- .../java/org/telegram/ui/ChatActivity.java | 33 +++-- .../telegram/ui/GroupCreateFinalActivity.java | 12 +- .../org/telegram/ui/IdenticonActivity.java | 1 - .../org/telegram/ui/LastSeenActivity.java | 138 ++++++++++++------ .../java/org/telegram/ui/LaunchActivity.java | 7 +- .../java/org/telegram/ui/LoginActivity.java | 8 +- .../org/telegram/ui/MessagesActivity.java | 2 +- .../java/org/telegram/ui/PhotoViewer.java | 13 ++ .../telegram/ui/PrivacySettingsActivity.java | 13 +- .../java/org/telegram/ui/ProfileActivity.java | 12 +- .../org/telegram/ui/SettingsActivity.java | 14 +- .../org/telegram/ui/Views/AvatarDrawable.java | 61 +++++--- .../org/telegram/ui/Views/AvatarUpdater.java | 2 +- .../ui/Views/ChatActivityEnterView.java | 50 +++++-- .../java/org/telegram/ui/Views/EmojiView.java | 19 +-- .../ui/Views/PagerSlidingTabStrip.java | 30 ---- .../java/org/telegram/ui/Views/Switch.java | 3 +- .../org/telegram/ui/Views/TimerDrawable.java | 4 +- .../main/res/drawable-hdpi/ic_ab_attach.png | Bin 1677 -> 2106 bytes .../main/res/drawable-hdpi/ic_ab_location.png | Bin 929 -> 656 bytes .../main/res/drawable-mdpi/ic_ab_location.png | Bin 676 -> 432 bytes .../main/res/drawable-xhdpi/ic_ab_attach.png | Bin 2573 -> 2620 bytes .../res/drawable-xhdpi/ic_ab_location.png | Bin 1192 -> 815 bytes .../main/res/drawable-xxhdpi/ic_ab_attach.png | Bin 2413 -> 3605 bytes .../res/drawable-xxhdpi/ic_ab_location.png | Bin 1801 -> 1143 bytes .../res/drawable-xxhdpi/ic_lock_header.png | Bin 0 -> 1300 bytes .../src/main/res/layout/chat_layout.xml | 5 +- .../res/layout/popup_notification_layout.xml | 7 +- .../src/main/res/values-v21/styles.xml | 4 +- TMessagesProj/src/main/res/values/strings.xml | 8 +- 45 files changed, 381 insertions(+), 231 deletions(-) create mode 100644 TMessagesProj/src/main/res/drawable-xxhdpi/ic_lock_header.png diff --git a/TMessagesProj/src/main/java/org/telegram/android/AndroidUtilities.java b/TMessagesProj/src/main/java/org/telegram/android/AndroidUtilities.java index 84f46c41..91ac10b6 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/AndroidUtilities.java +++ b/TMessagesProj/src/main/java/org/telegram/android/AndroidUtilities.java @@ -71,24 +71,22 @@ public class AndroidUtilities { if (manager != null && manager.getDefaultDisplay() != null) { int rotation = manager.getDefaultDisplay().getRotation(); int orientation = activity.getResources().getConfiguration().orientation; + int SCREEN_ORIENTATION_REVERSE_LANDSCAPE = 8; + int SCREEN_ORIENTATION_REVERSE_PORTRAIT = 9; + if (Build.VERSION.SDK_INT < 9) { + SCREEN_ORIENTATION_REVERSE_LANDSCAPE = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE; + SCREEN_ORIENTATION_REVERSE_PORTRAIT = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; + } if (rotation == Surface.ROTATION_270) { if (orientation == Configuration.ORIENTATION_PORTRAIT) { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } else { - if (Build.VERSION.SDK_INT >= 9) { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE); - } else { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); - } + activity.setRequestedOrientation(SCREEN_ORIENTATION_REVERSE_LANDSCAPE); } } else if (rotation == Surface.ROTATION_90) { if (orientation == Configuration.ORIENTATION_PORTRAIT) { - if (Build.VERSION.SDK_INT >= 9) { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT); - } else { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); - } + activity.setRequestedOrientation(SCREEN_ORIENTATION_REVERSE_PORTRAIT); } else { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } @@ -100,17 +98,9 @@ public class AndroidUtilities { } } else { if (orientation == Configuration.ORIENTATION_LANDSCAPE) { - if (Build.VERSION.SDK_INT >= 9) { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE); - } else { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); - } + activity.setRequestedOrientation(SCREEN_ORIENTATION_REVERSE_LANDSCAPE); } else { - if (Build.VERSION.SDK_INT >= 9) { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT); - } else { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); - } + activity.setRequestedOrientation(SCREEN_ORIENTATION_REVERSE_PORTRAIT); } } } @@ -472,7 +462,7 @@ public class AndroidUtilities { return size; } - public static void setListViewEdgeEffectColor(ListView listView, int color) { + public static void setListViewEdgeEffectColor(AbsListView listView, int color) { if (Build.VERSION.SDK_INT >= 21) { try { Field field = AbsListView.class.getDeclaredField("mEdgeGlowTop"); diff --git a/TMessagesProj/src/main/java/org/telegram/android/ContactsController.java b/TMessagesProj/src/main/java/org/telegram/android/ContactsController.java index ba0e4c0a..40bdfedb 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/ContactsController.java +++ b/TMessagesProj/src/main/java/org/telegram/android/ContactsController.java @@ -41,6 +41,7 @@ import java.util.Locale; import java.util.concurrent.ConcurrentHashMap; public class ContactsController { + private Account currentAccount; private boolean loadingContacts = false; private static final Object loadContactsSync = new Object(); @@ -108,6 +109,13 @@ public class ContactsController { return localInstance; } + public ContactsController() { + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); + if (preferences.getBoolean("needGetStatuses", false)) { + reloadContactsStatuses(); + } + } + public void cleanup() { contactsBook.clear(); contactsBookSPhones.clear(); @@ -1577,6 +1585,42 @@ public class ContactsController { }, true, RPCRequest.RPCRequestClassGeneric); } + public void reloadContactsStatuses() { + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); + final SharedPreferences.Editor editor = preferences.edit(); + editor.putBoolean("needGetStatuses", true).commit(); + TLRPC.TL_contacts_getStatuses req = new TLRPC.TL_contacts_getStatuses(); + ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() { + @Override + public void run(final TLObject response, TLRPC.TL_error error) { + if (error == null) { + AndroidUtilities.runOnUIThread(new Runnable() { + @Override + public void run() { + editor.remove("needGetStatuses").commit(); + TLRPC.Vector vector = (TLRPC.Vector) response; + if (!vector.objects.isEmpty()) { + ArrayList dbUsersStatus = new ArrayList(); + for (Object object : vector.objects) { + TLRPC.User toDbUser = new TLRPC.User(); + TLRPC.TL_contactStatus status = (TLRPC.TL_contactStatus) object; + TLRPC.User user = MessagesController.getInstance().getUser(status.user_id); + if (user != null) { + user.status = status.status; + } + toDbUser.status = status.status; + dbUsersStatus.add(toDbUser); + } + MessagesStorage.getInstance().updateUsers(dbUsersStatus, true, true, true); + } + NotificationCenter.getInstance().postNotificationName(NotificationCenter.updateInterfaces, MessagesController.UPDATE_MASK_STATUS); + } + }); + } + } + }); + } + public void loadPrivacySettings() { if (loadingDeleteInfo == 0) { loadingDeleteInfo = 1; @@ -1650,6 +1694,7 @@ public class ContactsController { public void setPrivacyRules(ArrayList rules) { privacyRules = rules; NotificationCenter.getInstance().postNotificationName(NotificationCenter.privacyRulesUpdated); + reloadContactsStatuses(); } public static String formatName(String firstName, String lastName) { diff --git a/TMessagesProj/src/main/java/org/telegram/android/ImageLoader.java b/TMessagesProj/src/main/java/org/telegram/android/ImageLoader.java index 4a77aed9..b2030a68 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/ImageLoader.java +++ b/TMessagesProj/src/main/java/org/telegram/android/ImageLoader.java @@ -1117,9 +1117,9 @@ public class ImageLoader { return b; } - private static TLRPC.PhotoSize scaleAndSaveImageInternal(Bitmap bitmap, int w, int h, float photoW, float photoH, float scaleFactor, int quality, boolean cache) throws Exception { + private static TLRPC.PhotoSize scaleAndSaveImageInternal(Bitmap bitmap, int w, int h, float photoW, float photoH, float scaleFactor, int quality, boolean cache, boolean scaleAnyway) throws Exception { Bitmap scaledBitmap = null; - if (scaleFactor > 1) { + if (scaleFactor > 1 || scaleAnyway) { scaledBitmap = Bitmap.createScaledBitmap(bitmap, w, h, true); } else { scaledBitmap = bitmap; @@ -1171,6 +1171,10 @@ public class ImageLoader { } public static TLRPC.PhotoSize scaleAndSaveImage(Bitmap bitmap, float maxWidth, float maxHeight, int quality, boolean cache) { + return scaleAndSaveImage(bitmap, maxWidth, maxHeight, quality, cache, 0, 0); + } + + public static TLRPC.PhotoSize scaleAndSaveImage(Bitmap bitmap, float maxWidth, float maxHeight, int quality, boolean cache, int minWidth, int minHeight) { if (bitmap == null) { return null; } @@ -1179,7 +1183,12 @@ public class ImageLoader { if (photoW == 0 || photoH == 0) { return null; } + boolean scaleAnyway = false; float scaleFactor = Math.max(photoW / maxWidth, photoH / maxHeight); + if (scaleFactor < 1 && minWidth != 0 && minHeight != 0) { + scaleFactor = Math.max(photoW / minWidth, photoH / minHeight); + scaleAnyway = true; + } int w = (int)(photoW / scaleFactor); int h = (int)(photoH / scaleFactor); if (h == 0 || w == 0) { @@ -1187,13 +1196,13 @@ public class ImageLoader { } try { - return scaleAndSaveImageInternal(bitmap, w, h, photoW, photoH, scaleFactor, quality, cache); + return scaleAndSaveImageInternal(bitmap, w, h, photoW, photoH, scaleFactor, quality, cache, scaleAnyway); } catch (Throwable e) { FileLog.e("tmessages", e); ImageLoader.getInstance().clearMemory(); System.gc(); try { - return scaleAndSaveImageInternal(bitmap, w, h, photoW, photoH, scaleFactor, quality, cache); + return scaleAndSaveImageInternal(bitmap, w, h, photoW, photoH, scaleFactor, quality, cache, scaleAnyway); } catch (Throwable e2) { FileLog.e("tmessages", e2); return null; diff --git a/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java b/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java index 27fb562f..6e34e320 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java +++ b/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java @@ -1375,10 +1375,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter @Override public void run() { int lower_id = (int)dialog_id; + int high_id = (int)(dialog_id >> 32); if (!isCache) { MessagesStorage.getInstance().putMessages(messagesRes, dialog_id); } - if (lower_id != 0 && isCache && messagesRes.messages.size() == 0 && (load_type == 0 || load_type == 2 || load_type == 3)) { + if (high_id != 1 && lower_id != 0 && isCache && messagesRes.messages.size() == 0 && (load_type == 0 || load_type == 2 || load_type == 3)) { AndroidUtilities.runOnUIThread(new Runnable() { @Override public void run() { diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/TLRPC.java b/TMessagesProj/src/main/java/org/telegram/messenger/TLRPC.java index 2a9a055d..b00dd153 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/TLRPC.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/TLRPC.java @@ -272,20 +272,20 @@ public class TLRPC { } public static class TL_contactStatus extends TLObject { - public static int constructor = 0xaa77b873; + public static int constructor = 0xd3680c61; public int user_id; - public int expires; + public UserStatus status; public void readParams(AbsSerializedData stream) { user_id = stream.readInt32(); - expires = stream.readInt32(); + status = (UserStatus)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()); } public void serializeToStream(AbsSerializedData stream) { stream.writeInt32(constructor); stream.writeInt32(user_id); - stream.writeInt32(expires); + status.serializeToStream(stream); } } @@ -7389,6 +7389,18 @@ public class TLRPC { public static class TL_contacts_getStatuses extends TLObject { public static int constructor = 0xc4a353ee; + public ArrayList id = new ArrayList(); + + public Class responseClass () { + return Vector.class; + } + + public void parseVector(Vector vector, AbsSerializedData data) { + int size = data.readInt32(); + for (int a = 0; a < size; a++) { + vector.objects.add(TLClassStore.Instance().TLdeserialize(data, data.readInt32())); + } + } public void serializeToStream(AbsSerializedData stream) { stream.writeInt32(constructor); diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java b/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java index 4823e512..5ae3d1e6 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java @@ -114,7 +114,7 @@ public class Utilities { private native static void aesIgeEncryption(ByteBuffer buffer, byte[] key, byte[] iv, boolean encrypt, int offset, int length); public static void aesIgeEncryption(ByteBuffer buffer, byte[] key, byte[] iv, boolean encrypt, boolean changeIv, int offset, int length) { - aesIgeEncryption(buffer, key, changeIv ? iv : iv.clone(), encrypt, offset, length); + aesIgeEncryption(buffer, key, changeIv ? iv : (byte [])iv.clone(), encrypt, offset, length); } public static Integer parseInt(String value) { @@ -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/ActionBar/ActionBarLayout.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarLayout.java index dc1641d7..088ff141 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarLayout.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarLayout.java @@ -633,6 +633,10 @@ public class ActionBarLayout extends FrameLayout { currentAnimation.start(); } } else { + if (backgroundView != null) { + ViewProxy.setAlpha(backgroundView, 1.0f); + backgroundView.setVisibility(VISIBLE); + } fragment.onOpenAnimationEnd(); } return true; @@ -789,6 +793,10 @@ public class ActionBarLayout extends FrameLayout { if (removeActionBarExtraHeight) { previousFragment.actionBar.setOccupyStatusBar(false); } + ViewGroup parent = (ViewGroup) previousFragment.actionBar.getParent(); + if (parent != null) { + parent.removeView(previousFragment.actionBar); + } containerView.addView(previousFragment.actionBar); } containerView.addView(fragmentView); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java index ba83613b..f417a566 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java @@ -264,7 +264,7 @@ public class ActionBarMenuItem extends ImageView { private int getBottomOffsetY() { getLocationOnScreen(location); - int diff = location[1] - (Build.VERSION.SDK_INT >= 21 ? AndroidUtilities.statusBarHeight : 0) + getMeasuredHeight() - menuHeight; + int diff = location[1] - AndroidUtilities.statusBarHeight + getMeasuredHeight() - menuHeight; int y = AndroidUtilities.dp(8) - menuHeight; if (diff < 0) { y -= diff; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/DrawerLayoutContainer.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/DrawerLayoutContainer.java index aeada83f..63405c64 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/DrawerLayoutContainer.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/DrawerLayoutContainer.java @@ -218,7 +218,6 @@ public class DrawerLayoutContainer extends FrameLayout { } private void onDrawerAnimationEnd(boolean opened) { - AndroidUtilities.unlockOrientation((Activity) getContext()); startedTracking = false; currentAnimation = null; drawerOpened = opened; @@ -257,7 +256,6 @@ public class DrawerLayoutContainer extends FrameLayout { startedTrackingX = (int) ev.getX(); } beginTrackingSent = false; - AndroidUtilities.lockOrientation((Activity)getContext()); } public boolean isDrawerOpened() { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsSearchAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsSearchAdapter.java index d9999a6a..f2ae0178 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsSearchAdapter.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/ContactsSearchAdapter.java @@ -234,7 +234,7 @@ public class ContactsSearchAdapter 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); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsSearchAdapter.java b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsSearchAdapter.java index 2a680d84..25405724 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsSearchAdapter.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Adapters/DialogsSearchAdapter.java @@ -48,13 +48,15 @@ public class DialogsSearchAdapter extends BaseContactsSearchAdapter { private long reqId = 0; private int lastReqId; private MessagesActivitySearchAdapterDelegate delegate; + private boolean needMessagesSearch; public static interface MessagesActivitySearchAdapterDelegate { public abstract void searchStateChanged(boolean searching); } - public DialogsSearchAdapter(Context context) { + public DialogsSearchAdapter(Context context, boolean messagesSearch) { mContext = context; + needMessagesSearch = messagesSearch; } public void setDelegate(MessagesActivitySearchAdapterDelegate delegate) { @@ -62,6 +64,9 @@ public class DialogsSearchAdapter extends BaseContactsSearchAdapter { } private void searchMessagesInternal(final String query) { + if (!needMessagesSearch) { + return; + } if (reqId != 0) { ConnectionsManager.getInstance().cancelRpc(reqId, true); reqId = 0; @@ -412,7 +417,7 @@ public class DialogsSearchAdapter 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); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/AnimationCompat/ObjectAnimatorProxy.java b/TMessagesProj/src/main/java/org/telegram/ui/AnimationCompat/ObjectAnimatorProxy.java index d4432f09..c9fd8cf1 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/AnimationCompat/ObjectAnimatorProxy.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/AnimationCompat/ObjectAnimatorProxy.java @@ -121,4 +121,9 @@ public class ObjectAnimatorProxy { } return this; } + + @Override + public boolean equals(Object o) { + return objectAnimator == o; + } } 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 575ded30..26bc739b 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java @@ -120,7 +120,7 @@ public class DialogCell extends BaseCell { nameUnknownPaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG); nameUnknownPaint.setTextSize(AndroidUtilities.dp(17)); - nameUnknownPaint.setColor(0xff548ab6); + nameUnknownPaint.setColor(0xff4d83b3); nameUnknownPaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf")); messagePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG); @@ -132,7 +132,7 @@ public class DialogCell extends BaseCell { messagePrintingPaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG); messagePrintingPaint.setTextSize(AndroidUtilities.dp(16)); - messagePrintingPaint.setColor(0xff548ab6); + messagePrintingPaint.setColor(0xff4d83b3); timePaint = new TextPaint(TextPaint.ANTI_ALIAS_FLAG); timePaint.setTextSize(AndroidUtilities.dp(13)); @@ -325,10 +325,10 @@ public class DialogCell extends BaseCell { checkMessage = false; if (message.messageOwner.media != null && !(message.messageOwner.media instanceof TLRPC.TL_messageMediaEmpty)) { currentMessagePaint = messagePrintingPaint; - messageString = Emoji.replaceEmoji(Html.fromHtml(String.format("%s: %s", name, message.messageText)), messagePaint.getFontMetricsInt(), AndroidUtilities.dp(20)); + messageString = Emoji.replaceEmoji(Html.fromHtml(String.format("%s: %s", name, message.messageText)), messagePaint.getFontMetricsInt(), AndroidUtilities.dp(20)); } else { if (message.messageOwner.message != null) { - messageString = Emoji.replaceEmoji(Html.fromHtml(String.format("%s: %s", name, message.messageOwner.message.replace("\n", " ").replace("<", "<").replace(">", ">"))), messagePaint.getFontMetricsInt(), AndroidUtilities.dp(20)); + messageString = Emoji.replaceEmoji(Html.fromHtml(String.format("%s: %s", name, message.messageOwner.message.replace("\n", " ").replace("<", "<").replace(">", ">"))), messagePaint.getFontMetricsInt(), AndroidUtilities.dp(20)); } } } else { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/EmptyCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/EmptyCell.java index 0454b426..fd06f4e8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/EmptyCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/EmptyCell.java @@ -28,6 +28,7 @@ public class EmptyCell extends FrameLayout { public void setHeight(int height) { cellHeight = height; + requestLayout(); } @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCell.java index cb10f1ee..0c05b6e5 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextCell.java @@ -58,8 +58,8 @@ public class TextCell extends FrameLayout { 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.leftMargin = AndroidUtilities.dp(LocaleController.isRTL ? 24 : 0); + layoutParams.rightMargin = AndroidUtilities.dp(LocaleController.isRTL ? 0 : 24); layoutParams.gravity = LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT; valueTextView.setLayoutParams(layoutParams); @@ -80,8 +80,8 @@ public class TextCell extends FrameLayout { 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.leftMargin = AndroidUtilities.dp(LocaleController.isRTL ? 24 : 0); + layoutParams.rightMargin = AndroidUtilities.dp(LocaleController.isRTL ? 0 : 24); layoutParams.gravity = (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.CENTER_VERTICAL; valueImageView.setLayoutParams(layoutParams); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index 94edf8c8..dbd02eb3 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -453,7 +453,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not lastStatus = null; actionBar.setBackButtonImage(R.drawable.ic_ab_back); - actionBar.setBackOverlay(R.layout.updating_state_layout); actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() { @Override public void onItemClick(final int id) { @@ -699,16 +698,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } presentFragment(new ProfileActivity(args)); } else if (currentChat != null) { - if (info != null && info instanceof TLRPC.TL_chatParticipantsForbidden) { - return; - } - int count = currentChat.participants_count; - if (info != null) { - count = info.participants.size(); - } - if (count == 0 || currentChat.left || currentChat instanceof TLRPC.TL_chatForbidden) { - return; - } Bundle args = new Bundle(); args.putInt("chat_id", currentChat.id); ProfileActivity fragment = new ProfileActivity(args); @@ -718,6 +707,16 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } }); + if (currentChat != null) { + int count = currentChat.participants_count; + if (info != null) { + count = info.participants.size(); + } + if (count == 0 || currentChat.left || currentChat instanceof TLRPC.TL_chatForbidden || info != null && info instanceof TLRPC.TL_chatParticipantsForbidden) { + avatarContainer.setEnabled(false); + } + } + avatarImageView = new BackupImageView(getParentActivity()); avatarImageView.imageReceiver.setRoundRadius(AndroidUtilities.dp(21)); avatarImageView.processDetach = false; @@ -768,10 +767,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not updateSubtitle(); if (currentEncryptedChat != null) { - nameTextView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_white, 0, 0, 0); - nameTextView.setCompoundDrawablePadding(AndroidUtilities.dp(4)); - } else if (currentChat != null && currentChat.id < 0) { - nameTextView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.broadcast2, 0, 0, 0); + nameTextView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_header, 0, 0, 0); nameTextView.setCompoundDrawablePadding(AndroidUtilities.dp(4)); } @@ -2471,6 +2467,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not getParentActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); } + if (chatAdapter != null) { + chatAdapter.notifyDataSetChanged(); + } + checkActionBarMenu(); NotificationsController.getInstance().setOpennedDialogId(dialog_id); @@ -2543,7 +2543,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not @Override public void onPause() { super.onPause(); - actionBar.hideActionMode(); chatActivityEnterView.hideEmojiPopup(); paused = true; NotificationsController.getInstance().setOpennedDialogId(0); @@ -2660,6 +2659,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not forwaringMessage = null; selectedMessagesCanCopyIds.clear(); selectedMessagesIds.clear(); + actionBar.hideActionMode(); if (single || type < 2 || type == 6) { if (type >= 0) { @@ -2928,6 +2928,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } selectedMessagesCanCopyIds.clear(); selectedMessagesIds.clear(); + actionBar.hideActionMode(); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java index 953cca7c..f30cbf03 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java @@ -51,6 +51,8 @@ import java.util.ArrayList; import java.util.concurrent.Semaphore; public class GroupCreateFinalActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate, AvatarUpdater.AvatarUpdaterDelegate { + + private ListAdapter listAdapter; private ListView listView; private EditText nameTextView; private TLRPC.FileLocation avatar; @@ -126,6 +128,14 @@ public class GroupCreateFinalActivity extends BaseFragment implements Notificati avatarUpdater.clear(); } + @Override + public void onResume() { + super.onResume(); + if (listAdapter != null) { + listAdapter.notifyDataSetChanged(); + } + } + @Override public View createView(LayoutInflater inflater, ViewGroup container) { if (fragmentView == null) { @@ -297,7 +307,7 @@ public class GroupCreateFinalActivity extends BaseFragment implements Notificati listView.setDivider(null); listView.setDividerHeight(0); listView.setVerticalScrollBarEnabled(false); - listView.setAdapter(new ListAdapter(getParentActivity())); + listView.setAdapter(listAdapter = new ListAdapter(getParentActivity())); linearLayout.addView(listView); layoutParams = (LinearLayout.LayoutParams) listView.getLayoutParams(); layoutParams.width = LinearLayout.LayoutParams.MATCH_PARENT; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java index fdfc54f0..b3551522 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java @@ -49,7 +49,6 @@ public class IdenticonActivity extends BaseFragment { actionBar.setBackButtonImage(R.drawable.ic_ab_back); actionBar.setBackOverlay(R.layout.updating_state_layout); actionBar.setTitle(LocaleController.getString("EncryptionKey", R.string.EncryptionKey)); - actionBar.setTitleIcon(R.drawable.ic_lock_white, AndroidUtilities.dp(4)); actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() { @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LastSeenActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LastSeenActivity.java index 86be9fa8..99c5cd1e 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LastSeenActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LastSeenActivity.java @@ -8,8 +8,12 @@ package org.telegram.ui; +import android.app.Activity; import android.app.AlertDialog; +import android.app.ProgressDialog; import android.content.Context; +import android.content.DialogInterface; +import android.content.SharedPreferences; import android.os.Bundle; import android.text.Spannable; import android.text.method.LinkMovementMethod; @@ -105,59 +109,30 @@ public class LastSeenActivity extends BaseFragment implements NotificationCenter if (id == -1) { finishFragment(); } else if (id == done_button) { - TLRPC.TL_account_setPrivacy req = new TLRPC.TL_account_setPrivacy(); - req.key = new TLRPC.TL_inputPrivacyKeyStatusTimestamp(); - if (currentType != 0 && currentPlus.size() > 0) { - TLRPC.TL_inputPrivacyValueAllowUsers rule = new TLRPC.TL_inputPrivacyValueAllowUsers(); - for (Integer uid : currentPlus) { - TLRPC.User user = MessagesController.getInstance().getUser(uid); - if (user != null) { - TLRPC.InputUser inputUser = MessagesController.getInputUser(user); - if (inputUser != null) { - rule.users.add(inputUser); - } - } - } - req.rules.add(rule); + if (getParentActivity() == null) { + return; } - if (currentType != 1 && currentMinus.size() > 0) { - TLRPC.TL_inputPrivacyValueDisallowUsers rule = new TLRPC.TL_inputPrivacyValueDisallowUsers(); - for (Integer uid : currentMinus) { - TLRPC.User user = MessagesController.getInstance().getUser(uid); - if (user != null) { - TLRPC.InputUser inputUser = MessagesController.getInputUser(user); - if (inputUser != null) { - rule.users.add(inputUser); - } - } - } - req.rules.add(rule); - } - if (currentType == 0) { - req.rules.add(new TLRPC.TL_inputPrivacyValueAllowAll()); - } else if (currentType == 1) { - req.rules.add(new TLRPC.TL_inputPrivacyValueDisallowAll()); - } else if (currentType == 2) { - req.rules.add(new TLRPC.TL_inputPrivacyValueAllowContacts()); - } - ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() { - @Override - public void run(final TLObject response, final TLRPC.TL_error error) { - AndroidUtilities.runOnUIThread(new Runnable() { + + if (currentType != 0) { + final SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); + boolean showed = preferences.getBoolean("privacyAlertShowed", false); + if (!showed) { + AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); + builder.setMessage(LocaleController.getString("CustomHelp", R.string.CustomHelp)); + builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); + builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() { @Override - public void run() { - if (error == null) { - finishFragment(); - TLRPC.TL_account_privacyRules rules = (TLRPC.TL_account_privacyRules) response; - MessagesController.getInstance().putUsers(rules.users, false); - ContactsController.getInstance().setPrivacyRules(rules.rules); - } else { - showErrorAlert(); - } + public void onClick(DialogInterface dialogInterface, int i) { + applyCurrentPrivacySettings(); + preferences.edit().putBoolean("privacyAlertShowed", true).commit(); } }); + builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); + showAlertDialog(builder); + return; } - }, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassFailOnServerErrors); + } + applyCurrentPrivacySettings(); } } }); @@ -271,6 +246,73 @@ public class LastSeenActivity extends BaseFragment implements NotificationCenter } } + private void applyCurrentPrivacySettings() { + TLRPC.TL_account_setPrivacy req = new TLRPC.TL_account_setPrivacy(); + req.key = new TLRPC.TL_inputPrivacyKeyStatusTimestamp(); + if (currentType != 0 && currentPlus.size() > 0) { + TLRPC.TL_inputPrivacyValueAllowUsers rule = new TLRPC.TL_inputPrivacyValueAllowUsers(); + for (Integer uid : currentPlus) { + TLRPC.User user = MessagesController.getInstance().getUser(uid); + if (user != null) { + TLRPC.InputUser inputUser = MessagesController.getInputUser(user); + if (inputUser != null) { + rule.users.add(inputUser); + } + } + } + req.rules.add(rule); + } + if (currentType != 1 && currentMinus.size() > 0) { + TLRPC.TL_inputPrivacyValueDisallowUsers rule = new TLRPC.TL_inputPrivacyValueDisallowUsers(); + for (Integer uid : currentMinus) { + TLRPC.User user = MessagesController.getInstance().getUser(uid); + if (user != null) { + TLRPC.InputUser inputUser = MessagesController.getInputUser(user); + if (inputUser != null) { + rule.users.add(inputUser); + } + } + } + req.rules.add(rule); + } + if (currentType == 0) { + req.rules.add(new TLRPC.TL_inputPrivacyValueAllowAll()); + } else if (currentType == 1) { + req.rules.add(new TLRPC.TL_inputPrivacyValueDisallowAll()); + } else if (currentType == 2) { + req.rules.add(new TLRPC.TL_inputPrivacyValueAllowContacts()); + } + final ProgressDialog progressDialog = new ProgressDialog(getParentActivity()); + progressDialog.setMessage(LocaleController.getString("Loading", R.string.Loading)); + progressDialog.setCanceledOnTouchOutside(false); + progressDialog.setCancelable(false); + progressDialog.show(); + + ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() { + @Override + public void run(final TLObject response, final TLRPC.TL_error error) { + AndroidUtilities.runOnUIThread(new Runnable() { + @Override + public void run() { + try { + progressDialog.dismiss(); + } catch (Exception e) { + FileLog.e("tmessages", e); + } + if (error == null) { + finishFragment(); + TLRPC.TL_account_privacyRules rules = (TLRPC.TL_account_privacyRules) response; + MessagesController.getInstance().putUsers(rules.users, false); + ContactsController.getInstance().setPrivacyRules(rules.rules); + } else { + showErrorAlert(); + } + } + }); + } + }, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassFailOnServerErrors); + } + private void showErrorAlert() { if (getParentActivity() == null) { return; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java index d54c273c..06b83bd1 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java @@ -735,6 +735,7 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa } } else { actionBarLayout.presentFragment(fragment, true); + if (sendingText != null) { fragment.processSendingText(sendingText); } @@ -1156,10 +1157,8 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa } layersActionBarLayout.closeLastFragment(!forceWithoutAnimation); } - if (actionBarLayout.fragmentsStack.size() > 1) { - actionBarLayout.presentFragment(fragment, actionBarLayout.fragmentsStack.size() > 1, forceWithoutAnimation, false); - return false; - } + actionBarLayout.presentFragment(fragment, actionBarLayout.fragmentsStack.size() > 1, forceWithoutAnimation, false); + return false; } } else if (layout != layersActionBarLayout) { layersActionBarLayout.setVisibility(View.VISIBLE); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java index 06f8cef0..0ed36108 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java @@ -994,7 +994,7 @@ public class LoginActivity extends BaseFragment { codeField.setHintTextColor(0xff979797); codeField.setImeOptions(EditorInfo.IME_ACTION_NEXT | EditorInfo.IME_FLAG_NO_EXTRACT_UI); codeField.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); - codeField.setInputType(InputType.TYPE_CLASS_NUMBER); + codeField.setInputType(InputType.TYPE_CLASS_PHONE); codeField.setMaxLines(1); codeField.setPadding(0, 0, 0, 0); addView(codeField); @@ -1037,7 +1037,7 @@ public class LoginActivity extends BaseFragment { problemText.setVisibility(time < 1000 ? VISIBLE : GONE); problemText.setGravity(Gravity.LEFT); problemText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14); - problemText.setTextColor(0xff548ab6); + problemText.setTextColor(0xff4d83b3); problemText.setLineSpacing(AndroidUtilities.dp(2), 1.0f); problemText.setPadding(0, AndroidUtilities.dp(2), 0, AndroidUtilities.dp(12)); addView(problemText); @@ -1078,7 +1078,7 @@ public class LoginActivity extends BaseFragment { TextView wrongNumber = new TextView(context); wrongNumber.setGravity(Gravity.LEFT | Gravity.CENTER_HORIZONTAL); - wrongNumber.setTextColor(0xff548ab6); + wrongNumber.setTextColor(0xff4d83b3); wrongNumber.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14); wrongNumber.setLineSpacing(AndroidUtilities.dp(2), 1.0f); wrongNumber.setPadding(0, AndroidUtilities.dp(24), 0, 0); @@ -1487,7 +1487,7 @@ public class LoginActivity extends BaseFragment { TextView wrongNumber = new TextView(context); wrongNumber.setText(LocaleController.getString("CancelRegistration", R.string.CancelRegistration)); wrongNumber.setGravity(Gravity.LEFT | Gravity.CENTER_HORIZONTAL); - wrongNumber.setTextColor(0xff548ab6); + wrongNumber.setTextColor(0xff4d83b3); wrongNumber.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14); wrongNumber.setLineSpacing(AndroidUtilities.dp(2), 1.0f); wrongNumber.setPadding(0, AndroidUtilities.dp(24), 0, 0); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java index c02d0d2c..2810445d 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java @@ -223,7 +223,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter fragmentView = inflater.inflate(R.layout.messages_list, container, false); dialogsAdapter = new DialogsAdapter(getParentActivity(), serverOnly); - dialogsSearchAdapter = new DialogsSearchAdapter(getParentActivity()); + dialogsSearchAdapter = new DialogsSearchAdapter(getParentActivity(), !onlySelect); dialogsSearchAdapter.setDelegate(new DialogsSearchAdapter.MessagesActivitySearchAdapterDelegate() { @Override public void searchStateChanged(boolean search) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java b/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java index 528750df..29abbe13 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java @@ -10,6 +10,7 @@ package org.telegram.ui; import android.annotation.SuppressLint; import android.app.Activity; +import android.app.AlertDialog; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; @@ -628,6 +629,12 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat if (f != null && f.exists()) { MediaController.saveFile(f.toString(), parentActivity, currentFileNames[0].endsWith("mp4") ? 1 : 0, null); + } else { + AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity); + builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); + builder.setPositiveButton(R.string.OK, null); + builder.setMessage(LocaleController.getString("PleaseDownload", R.string.PleaseDownload)); + builder.show().setCanceledOnTouchOutside(true); } } else if (id == gallery_menu_showall) { if (opennedFromMedia) { @@ -745,6 +752,12 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat } intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(f)); parentActivity.startActivity(intent); + } else { + AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity); + builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); + builder.setPositiveButton(R.string.OK, null); + builder.setMessage(LocaleController.getString("PleaseDownload", R.string.PleaseDownload)); + builder.show().setCanceledOnTouchOutside(true); } } catch (Exception e) { FileLog.e("tmessages", e); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/PrivacySettingsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/PrivacySettingsActivity.java index 0ebc8432..987226d6 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/PrivacySettingsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/PrivacySettingsActivity.java @@ -172,7 +172,6 @@ public class PrivacySettingsActivity extends BaseFragment implements Notificatio AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); builder.setTitle(LocaleController.getString("DeleteAccountTitle", R.string.DeleteAccountTitle)); builder.setItems(new CharSequence[] { - LocaleController.getString("DeleteAccountNever", R.string.DeleteAccountNever), LocaleController.formatPluralString("Months", 1), LocaleController.formatPluralString("Months", 3), LocaleController.formatPluralString("Months", 6), @@ -181,13 +180,13 @@ public class PrivacySettingsActivity extends BaseFragment implements Notificatio @Override public void onClick(DialogInterface dialog, int which) { int value = 0; - if (which == 1) { + if (which == 0) { value = 30; - } else if (which == 2) { + } else if (which == 1) { value = 60; - } else if (which == 3) { + } else if (which == 2) { value = 182; - } else if (which == 4) { + } else if (which == 3) { value = 365; } final ProgressDialog progressDialog = new ProgressDialog(getParentActivity()); @@ -366,9 +365,7 @@ public class PrivacySettingsActivity extends BaseFragment implements Notificatio value = LocaleController.getString("Loading", R.string.Loading); } else { int ttl = ContactsController.getInstance().getDeleteAccountTTL(); - if (ttl == 0) { - value = LocaleController.getString("DeleteAccountNever", R.string.DeleteAccountNever); - } else if (ttl <= 182) { + if (ttl <= 182) { value = LocaleController.formatPluralString("Months", ttl / 30); } else if (ttl == 365) { value = LocaleController.formatPluralString("Years", ttl / 365); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java index 568accd3..131b3180 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java @@ -222,7 +222,6 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. actionBar.setBackgroundColor(AvatarDrawable.getProfileBackColorForId(user_id != 0 ? user_id : chat_id)); actionBar.setItemsBackground(AvatarDrawable.getButtonColorForId(user_id != 0 ? user_id : chat_id)); actionBar.setBackButtonImage(R.drawable.ic_ab_back); - actionBar.setBackOverlay(R.layout.updating_state_layout); actionBar.setExtraHeight(AndroidUtilities.dp(88), false); if (AndroidUtilities.isTablet()) { actionBar.setOccupyStatusBar(false); @@ -409,8 +408,6 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. onlineTextView.setLayoutParams(layoutParams); listView = new ListView(getParentActivity()); - listView.setDrawingCacheEnabled(false); - listView.setDrawingCacheBackgroundColor(0); listView.setDivider(null); listView.setDividerHeight(0); listView.setVerticalScrollBarEnabled(false); @@ -554,7 +551,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. frameLayout.addView(actionBar); - if (user_id != 0 || chat_id >= 0) { + if (user_id != 0 || chat_id >= 0 && !currentChat.left) { writeButton = new ImageView(getParentActivity()); if (user_id != 0) { writeButton.setImageResource(R.drawable.floating_user_states); @@ -602,7 +599,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. avatarUpdater.openCamera(); } else if (i == 1) { avatarUpdater.openGallery(); - } else if (i == 3) { + } else if (i == 2) { MessagesController.getInstance().changeChatAvatar(chat_id, null); } } @@ -890,7 +887,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. public void willSwitchFromPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) { } @Override - public void willHidePhotoViewer() { } + public void willHidePhotoViewer() { + avatarImage.imageReceiver.setVisible(true, true); + } @Override public boolean isPhotoChecked(int index) { return false; } @@ -1065,6 +1064,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter. photoBig = chat.photo.photo_big; } avatarImage.setImage(photo, "50_50", new AvatarDrawable(chat)); + avatarImage.imageReceiver.setVisible(!PhotoViewer.getInstance().isShowingImage(photoBig), false); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java index d9eb509e..4160af3f 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java @@ -18,7 +18,6 @@ import android.content.SharedPreferences; import android.content.pm.PackageInfo; import android.content.res.Configuration; import android.net.Uri; -import android.os.Build; import android.os.Bundle; import android.text.Html; import android.text.Spannable; @@ -211,11 +210,11 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter usernameRow = rowCount++; settingsSectionRow = rowCount++; settingsSectionRow2 = rowCount++; - enableAnimationsRow = rowCount++; notificationRow = rowCount++; privacyRow = rowCount++; backgroundRow = rowCount++; languageRow = rowCount++; + enableAnimationsRow = rowCount++; mediaDownloadSection = rowCount++; mediaDownloadSection2 = rowCount++; mobileDownloadRow = rowCount++; @@ -264,7 +263,6 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter actionBar.setBackgroundColor(AvatarDrawable.getProfileBackColorForId(5)); actionBar.setItemsBackground(AvatarDrawable.getButtonColorForId(5)); actionBar.setBackButtonImage(R.drawable.ic_ab_back); - actionBar.setBackOverlay(R.layout.updating_state_layout); actionBar.setExtraHeight(AndroidUtilities.dp(88), false); if (AndroidUtilities.isTablet()) { actionBar.setOccupyStatusBar(false); @@ -637,7 +635,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter avatarUpdater.openCamera(); } else if (i == 1) { avatarUpdater.openGallery(); - } else if (i == 3) { + } else if (i == 2) { MessagesController.getInstance().deleteUserPhoto(null); } } @@ -716,7 +714,9 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter public void willSwitchFromPhoto(MessageObject messageObject, TLRPC.FileLocation fileLocation, int index) { } @Override - public void willHidePhotoViewer() { } + public void willHidePhotoViewer() { + avatarImage.imageReceiver.setVisible(true, true); + } @Override public boolean isPhotoChecked(int index) { return false; } @@ -1034,7 +1034,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter int size = preferences.getInt("fons_size", AndroidUtilities.isTablet() ? 18 : 16); textCell.setTextAndValue(LocaleController.getString("TextSize", R.string.TextSize), String.format("%d", size), true); } else if (i == languageRow) { - textCell.setTextAndValue(LocaleController.getString("Language", R.string.Language), LocaleController.getCurrentLanguageName(), false); + textCell.setTextAndValue(LocaleController.getString("Language", R.string.Language), LocaleController.getCurrentLanguageName(), true); } else if (i == contactsSortRow) { String value; SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); @@ -1074,7 +1074,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); if (i == enableAnimationsRow) { - textCell.setTextAndCheck(LocaleController.getString("EnableAnimations", R.string.EnableAnimations), preferences.getBoolean("view_animations", true), true); + textCell.setTextAndCheck(LocaleController.getString("EnableAnimations", R.string.EnableAnimations), preferences.getBoolean("view_animations", true), false); } else if (i == sendByEnterRow) { textCell.setTextAndCheck(LocaleController.getString("SendByEnter", R.string.SendByEnter), preferences.getBoolean("send_by_enter", false), false); } else if (i == saveToGalleryRow) { 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 6abea8e8..983d4cb9 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarDrawable.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarDrawable.java @@ -21,8 +21,11 @@ import org.telegram.android.AndroidUtilities; import org.telegram.messenger.FileLog; import org.telegram.messenger.R; import org.telegram.messenger.TLRPC; +import org.telegram.messenger.UserConfig; import org.telegram.ui.ApplicationLoader; +import java.util.Locale; + public class AvatarDrawable extends Drawable { private static Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); @@ -58,47 +61,69 @@ public class AvatarDrawable extends Drawable { } public AvatarDrawable(TLRPC.User user) { - this(); + this(user, false); + } + + public AvatarDrawable(TLRPC.Chat chat) { + this(chat, false); + } + + public AvatarDrawable(TLRPC.User user, boolean profile) { + isProfile = profile; if (user != null) { setInfo(user.id, user.first_name, user.last_name, false); } } - public AvatarDrawable(TLRPC.Chat chat) { - this(); + public AvatarDrawable(TLRPC.Chat chat, boolean profile) { + isProfile = profile; if (chat != null) { setInfo(chat.id, chat.title, null, chat.id < 0); } } - 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 getColorIndex(int id) { + try { + String str; + if (id >= 0) { + str = String.format(Locale.US, "%d%d", id, UserConfig.getClientUserId()); + } else { + str = String.format(Locale.US, "%d", id); + } + if (str.length() > 15) { + str = str.substring(0, 15); + } + java.security.MessageDigest md = java.security.MessageDigest.getInstance("MD5"); + byte[] digest = md.digest(str.getBytes()); + int b = digest[Math.abs(id % 16)]; + if (b < 0) { + b += 256; + } + return Math.abs(b) % arrColors.length; + } catch (Exception e) { + FileLog.e("tmessages", e); + } + return id % arrColors.length; } public static int getColorForId(int id) { - return arrColors[Math.abs(id) % arrColors.length]; + return arrColors[getColorIndex(id)]; } public static int getButtonColorForId(int id) { - return arrColorsButtons[Math.abs(id) % arrColorsButtons.length]; + return arrColorsButtons[getColorIndex(id)]; } public static int getProfileColorForId(int id) { - return arrColorsProfiles[Math.abs(id) % arrColorsProfiles.length]; + return arrColorsProfiles[getColorIndex(id)]; } public static int getProfileTextColorForId(int id) { - return arrColorsProfilesText[Math.abs(id) % arrColorsProfilesText.length]; + return arrColorsProfilesText[getColorIndex(id)]; } public static int getProfileBackColorForId(int id) { - return arrColorsProfilesBack[Math.abs(id) % arrColorsProfilesBack.length]; + return arrColorsProfilesBack[getColorIndex(id)]; } public void setInfo(TLRPC.User user) { @@ -119,9 +144,9 @@ public class AvatarDrawable extends Drawable { public void setInfo(int id, String firstName, String lastName, boolean isBroadcast) { if (isProfile) { - color = arrColorsProfiles[Math.abs(id) % arrColorsProfiles.length]; + color = arrColorsProfiles[getColorIndex(id)]; } else { - color = arrColors[Math.abs(id) % arrColors.length]; + color = arrColors[getColorIndex(id)]; } drawBrodcast = isBroadcast; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarUpdater.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarUpdater.java index 9f7e5ccf..c462cd51 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarUpdater.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarUpdater.java @@ -120,7 +120,7 @@ public class AvatarUpdater implements NotificationCenter.NotificationCenterDeleg return; } smallPhoto = ImageLoader.scaleAndSaveImage(bitmap, 100, 100, 80, false); - bigPhoto = ImageLoader.scaleAndSaveImage(bitmap, 800, 800, 80, false); + bigPhoto = ImageLoader.scaleAndSaveImage(bitmap, 800, 800, 80, false, 320, 320); if (bigPhoto != null && smallPhoto != null) { if (returnOnly) { if (delegate != null) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/ChatActivityEnterView.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/ChatActivityEnterView.java index e22e2400..6fb21f52 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/ChatActivityEnterView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/ChatActivityEnterView.java @@ -70,7 +70,9 @@ public class ChatActivityEnterView implements NotificationCenter.NotificationCen private FrameLayout attachButton; private AnimatorSetProxy runningAnimation; private AnimatorSetProxy runningAnimation2; + private ObjectAnimatorProxy runningAnimationAudio; private int runningAnimationType; + private int audioInterfaceState; private int keyboardHeight; private int keyboardHeightLand; @@ -502,6 +504,10 @@ public class ChatActivityEnterView implements NotificationCenter.NotificationCen private void updateAudioRecordIntefrace() { if (recordingAudio) { + if (audioInterfaceState == 1) { + return; + } + audioInterfaceState = 1; try { if (mWakeLock == null) { PowerManager pm = (PowerManager) ApplicationLoader.applicationContext.getSystemService(Context.POWER_SERVICE); @@ -521,16 +527,21 @@ public class ChatActivityEnterView implements NotificationCenter.NotificationCen params.leftMargin = AndroidUtilities.dp(30); slideText.setLayoutParams(params); ViewProxy.setAlpha(slideText, 1); - recordPanel.setX(AndroidUtilities.displaySize.x); - ObjectAnimatorProxy animatorProxy = ObjectAnimatorProxy.ofFloatProxy(recordPanel, "translationX", 0).setDuration(300); - animatorProxy.addListener(new AnimatorListenerAdapterProxy() { + ViewProxy.setX(recordPanel, AndroidUtilities.displaySize.x); + if (runningAnimationAudio != null) { + runningAnimationAudio.cancel(); + } + runningAnimationAudio = ObjectAnimatorProxy.ofFloatProxy(recordPanel, "translationX", 0).setDuration(300); + runningAnimationAudio.addListener(new AnimatorListenerAdapterProxy() { @Override public void onAnimationEnd(Object animator) { - ViewProxy.setX(recordPanel, 0); + if (runningAnimationAudio != null && runningAnimationAudio.equals(animator)) { + ViewProxy.setX(recordPanel, 0); + } } }); - animatorProxy.setInterpolator(new AccelerateDecelerateInterpolator()); - animatorProxy.start(); + runningAnimationAudio.setInterpolator(new AccelerateDecelerateInterpolator()); + runningAnimationAudio.start(); } else { if (mWakeLock != null) { try { @@ -541,20 +552,29 @@ public class ChatActivityEnterView implements NotificationCenter.NotificationCen } } AndroidUtilities.unlockOrientation(parentActivity); + if (audioInterfaceState == 0) { + return; + } + audioInterfaceState = 0; - ObjectAnimatorProxy animatorProxy = ObjectAnimatorProxy.ofFloatProxy(recordPanel, "translationX", AndroidUtilities.displaySize.x).setDuration(300); - animatorProxy.addListener(new AnimatorListenerAdapterProxy() { + if (runningAnimationAudio != null) { + runningAnimationAudio.cancel(); + } + runningAnimationAudio = ObjectAnimatorProxy.ofFloatProxy(recordPanel, "translationX", AndroidUtilities.displaySize.x).setDuration(300); + runningAnimationAudio.addListener(new AnimatorListenerAdapterProxy() { @Override public void onAnimationEnd(Object animator) { - FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) slideText.getLayoutParams(); - params.leftMargin = AndroidUtilities.dp(30); - slideText.setLayoutParams(params); - ViewProxy.setAlpha(slideText, 1); - recordPanel.setVisibility(View.GONE); + if (runningAnimationAudio != null && runningAnimationAudio.equals(animator)) { + FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) slideText.getLayoutParams(); + params.leftMargin = AndroidUtilities.dp(30); + slideText.setLayoutParams(params); + ViewProxy.setAlpha(slideText, 1); + recordPanel.setVisibility(View.GONE); + } } }); - animatorProxy.setInterpolator(new AccelerateDecelerateInterpolator()); - animatorProxy.start(); + runningAnimationAudio.setInterpolator(new AccelerateDecelerateInterpolator()); + runningAnimationAudio.start(); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/EmojiView.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/EmojiView.java index 5c959f5a..eb018421 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/EmojiView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/EmojiView.java @@ -10,7 +10,6 @@ package org.telegram.ui.Views; import android.content.Context; import android.database.DataSetObserver; -import android.graphics.drawable.GradientDrawable; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.text.TextUtils; @@ -114,10 +113,11 @@ public class EmojiView extends LinearLayout { EmojiGridAdapter localEmojiGridAdapter = new EmojiGridAdapter(Emoji.data[i]); gridView.setAdapter(localEmojiGridAdapter); + AndroidUtilities.setListViewEdgeEffectColor(gridView, 0xff999999); adapters.add(localEmojiGridAdapter); } - setBackgroundDrawable(new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[] { -14145496, -16777216 })); + setBackgroundColor(0xff222222); pager = new ViewPager(getContext()); pager.setAdapter(new EmojiPagesAdapter()); PagerSlidingTabStrip tabs = new PagerSlidingTabStrip(getContext()); @@ -258,33 +258,30 @@ public class EmojiView extends LinearLayout { private class EmojiPagesAdapter extends PagerAdapter implements PagerSlidingTabStrip.IconTabProvider { - private EmojiPagesAdapter() { - } - public void destroyItem(ViewGroup paramViewGroup, int paramInt, Object paramObject) { View localObject; if (paramInt == 0) { - localObject = EmojiView.this.recentsWrap; + localObject = recentsWrap; } else { - localObject = EmojiView.this.views.get(paramInt); + localObject = views.get(paramInt); } paramViewGroup.removeView(localObject); } public int getCount() { - return EmojiView.this.views.size(); + return views.size(); } public int getPageIconResId(int paramInt) { - return EmojiView.this.icons[paramInt]; + return icons[paramInt]; } public Object instantiateItem(ViewGroup paramViewGroup, int paramInt) { View localObject; if (paramInt == 0) { - localObject = EmojiView.this.recentsWrap; + localObject = recentsWrap; } else { - localObject = EmojiView.this.views.get(paramInt); + localObject = views.get(paramInt); } paramViewGroup.addView(localObject); return localObject; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/PagerSlidingTabStrip.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/PagerSlidingTabStrip.java index 42b79cfb..e3ab3e1c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/PagerSlidingTabStrip.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/PagerSlidingTabStrip.java @@ -55,11 +55,9 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { private float currentPositionOffset = 0f; private Paint rectPaint; - private Paint dividerPaint; private int indicatorColor = 0xFF666666; private int underlineColor = 0x1A000000; - private int dividerColor = 0x1A000000; private boolean shouldExpand = false; private boolean textAllCaps = true; @@ -69,7 +67,6 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { private int underlineHeight = 2; private int dividerPadding = 12; private int tabPadding = 24; - private int dividerWidth = 1; private int tabTextSize = 12; private int tabTextColor = 0xFF666666; @@ -108,17 +105,12 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { underlineHeight = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, underlineHeight, dm); dividerPadding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dividerPadding, dm); tabPadding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, tabPadding, dm); - dividerWidth = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dividerWidth, dm); tabTextSize = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, tabTextSize, dm); rectPaint = new Paint(); rectPaint.setAntiAlias(true); rectPaint.setStyle(Style.FILL); - dividerPaint = new Paint(); - dividerPaint.setAntiAlias(true); - dividerPaint.setStrokeWidth(dividerWidth); - defaultTabLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT); if (locale == null) { @@ -322,14 +314,6 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { rectPaint.setColor(underlineColor); canvas.drawRect(0, height - underlineHeight, tabsContainer.getWidth(), height, rectPaint); - - // draw divider - - dividerPaint.setColor(dividerColor); - for (int i = 0; i < tabCount - 1; i++) { - View tab = tabsContainer.getChildAt(i); - canvas.drawLine(tab.getRight(), dividerPadding, tab.getRight(), height - dividerPadding, dividerPaint); - } } private class PageListener implements OnPageChangeListener { @@ -419,20 +403,6 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { return underlineColor; } - public void setDividerColor(int dividerColor) { - this.dividerColor = dividerColor; - invalidate(); - } - - public void setDividerColorResource(int resId) { - this.dividerColor = getResources().getColor(resId); - invalidate(); - } - - public int getDividerColor() { - return dividerColor; - } - public void setUnderlineHeight(int underlineHeightPx) { this.underlineHeight = underlineHeightPx; invalidate(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/Switch.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/Switch.java index 7e1f1a56..e9da9a3b 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/Switch.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/Switch.java @@ -525,7 +525,8 @@ public class Switch extends CompoundButton { final int thumbLeft = thumbInitialLeft - padding.left; final int thumbRight = thumbInitialLeft + mThumbWidth + padding.right; - mThumbDrawable.setBounds(thumbLeft, switchTop, thumbRight, switchBottom); + int offset = (AndroidUtilities.density == 1.5f ? AndroidUtilities.dp(1) : 0); + mThumbDrawable.setBounds(thumbLeft, switchTop + offset, thumbRight, switchBottom + offset); final Drawable background = getBackground(); if (background != null) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/TimerDrawable.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/TimerDrawable.java index 2a9dc523..1df99ecd 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/TimerDrawable.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/TimerDrawable.java @@ -90,8 +90,8 @@ public class TimerDrawable extends Drawable { @Override public void draw(Canvas canvas) { - int width = canvas.getWidth(); - int height = canvas.getHeight(); + int width = getBounds().width(); + int height = getBounds().height(); Drawable drawable = null; if (time == 0) { drawable = timerDrawable; diff --git a/TMessagesProj/src/main/res/drawable-hdpi/ic_ab_attach.png b/TMessagesProj/src/main/res/drawable-hdpi/ic_ab_attach.png index c7da348aa96f9929dc143738f18c269f4951f0a4..0ab1bfbdaa8b3f300e2a6b13f6de1a4b6599141b 100755 GIT binary patch delta 1437 zcmZ{dYdF&j0EgX5J!gc+rCg3hF2}9Lj13j-?^Ya_BsrGL%yqO3>x5+qVN{z6p|DUI z6E(-Csad%+=2pn1ZAH0sEv01%N|H126%5&dUpdOpHjzMke4rkWL0ai4{5qjrh;C-Oi;{$sPJX zV7=YR0Gx#Pi^L$%+Xrm6b17ExF2t%f1%ix>0^I}Ye3CG}P;xOhAV58*-?lZ!Rvi-? z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oeIS diff --git a/TMessagesProj/src/main/res/drawable-hdpi/ic_ab_location.png b/TMessagesProj/src/main/res/drawable-hdpi/ic_ab_location.png index fe539cf5cb353e689c45eaf0c012c12a60d34dac..9f11eace7d3eb056b82bfcfb312da07be29eaac4 100755 GIT binary patch literal 656 zcmV;B0&o3^P)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00Ia}L_t(Y$KBSyN*qxX$8nX2M$i|Ce_kSm2rGiNVj(_< zf6{0p3*u^%#v+|q1xX`_R*HzEQ+HAEN#aHn*ZriJ>+I}0v%5(wLhh|*&Y3UwoaRtLt|_Ik&RbwXt?VtE%Cn zXGPlz3bvIJZ&%s@eF^SAtQoAc3|V&tHJTahtx|CIt?Dn%|N+u{IA|+=BL{( zs2I%xb%hY0G{HouGf>i*4w?(Gsa>kaf^%gLik9>yqE!Yn>7ZkpX~0CNo?snT#iPF0peay{pBGZgaWS@Ef$=0L5{js&wqwWhRM2H?-vN6s zB2(+{Xcc0|aw_P)Axd7fAsh720<`fOlzz2hD(Irw)uKHaitOciDHSvy+pj_Hb=LYl zp&HjpZ;F)M#OWUi>3^SAkVjxWQINL{n3@`Ff`jzRo&|Ra_g;%G-Me>TK0Zx{5kJ9n zR?|lJKGof#X}^b>>dcanG0$MP398$-AR`}}3EN7D$62C5lY1nbhEJ`eb}KlR6%02( zHbZRq+>ZD!$787K%8r5!JFa8#uQZ+}dmN1_WsalE`q;D@key~6daOe{IxwBgRQn^l q&$zwNQ@L6d{||p7Z~CLv=KckP9DzVPT0000iC?g(^F-BgW!?`(*`}Xd=-S6Fd`W`;M_kMq#^F8N#zUSNzy7TJb#GmJl5wj6D?o!%JnWkowx2@L4ZIiC13(F9;afur z0H)heTmjAkN4M#^3KW1mg!$1B0)Y7oD5ilPT7+1wEUz<4W)2f$U;v;`~x zYoe|L$N&k|cNsVhA=V-lfSI2MvZ9)pm;hdYp^X}2P6CsBMjToPjs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sjt)E{i22b$0SVH5?EI;UTmCszL+4hfMTxX(xnd{RbNeRZjo_ diff --git a/TMessagesProj/src/main/res/drawable-xhdpi/ic_ab_location.png b/TMessagesProj/src/main/res/drawable-xhdpi/ic_ab_location.png index f18f160a25bf450dc56b0731a34948bdb7bdc846..ebc61a535cffd4811dc7e556493f12059ac3cdea 100755 GIT binary patch literal 815 zcmV+~1JL}5P)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00O5;L_t(o!|j+&Pg6k@hHL4Uf-Vp(3pFCb&NOHUCJH9T zuwY9x(Xd1}Xfz=zzr%tp2DEI@y~dbeNP(z<8d62ehkv9^+WWY0I?UYOkEvp840Cs9 z-kE25=FB-W4G{RdU!aiyA%3;;KHwh!I=ROyzEEv><{6`7F90D%Si`M-&gTci;Q!LQ$DqO4JPSTn>3dvu_|C=AG0(H31As`D;Q(rzET(uKEF**b>rj z95OzyEz(h633>xYE3a=Wj416GABW!v@{TjX1$ZLwe7xn(av zrw~;*txdn|c)YS2qD!0$i<9nvyJF~qW}R_8!TRs4F5|X4;H8k<*L?5ZENw3y3+tRa zpqh~T6kFOe3r#7?eqqbm0il{BZ}q+zF^K%UMTNHyI_iHnbexTHIaEW;ewizn16 t?l8w^IdzTSkGF_Nno|G(002ovPDHLkV1g8GXXyX{ literal 1192 zcmV;Z1XufsP)J+w3g?4#au@37QZv1Q-Gg0fvC}SO&9@13(i{ z1?&*_=71;=0mgv&d~GV|v>ncH4hRDsz(s}9s|k@Y4D%b4-ewNCU zlmWN+{To2>dddN``47MoV2i`G$h;4M8K8VU5KznUT&uW8uKWr(1JnT9`2@I|f4{)- zzoN+>L_)ova{wtlrEu36a1R&)5;m5kywS!X5El37{o}wpzvTdO`_~HP2id|;Z7NUl z8+ZWh1SS-@WyH;JaD#v%R=!kNsuj4x3av%rZ0#O#o$|^Xg?D&Hz*V4HT)PJJyJV!> z3KA-~I(VA{5dRc_-$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XnZgU@s3{qk+)MksTeZ?(CbD_uu+VDpY@ z5X(IAx20Lfvevh4)WzT@bQlIS|KI%w7L8H*N9=y84cyvsfAz=?(5Mja0c~!J{EXmJ z$kD6Fjg#03Nt~^jskpT}&-R05%@`W^ehrP^AM`XGn7H5U6QC8FOFOxQsI{+tP+sVV zEbo0u{9*wdrQ@MFzvz$674$yzujd#3=&W_rxxS8arpy~LA&b}7Thtxj@LwkB36@&1 zDG)C1U80cGy6e;b`#K&`z;b0Uk^$9lAMv{#@F;(Kv}FL5ww10CH7+T zWV;8=n>tPWA=|bMWs0Wk+;1RCpq4_2E1Gno?cDCUDJnY0hNL5!@wTtE7FB$>SwYW* z^R~8JcT!pPg+y~|OC!;61Bae^O9$t2GG%)r$r29kT9S z-H~tGd}Ey<3@>|Zf;#U0dPt2Fjl@q6U-C9+_n9WP;FF7GhF!BZy_|C;1h8`9wx8%9 z`Qc-`#xX^vI42|;_W$sC_&CN5 YC~fyvZjMp<004jig8f5TjZ9wtpEWWP3jhEB diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/ic_ab_location.png b/TMessagesProj/src/main/res/drawable-xxhdpi/ic_ab_location.png index 076d7383f2917f7200ce8ab8cfb915573b9e381f..814bc8bd7534eca0ff13d6e916258de4c8b44c60 100755 GIT binary patch literal 1143 zcmV--1c>{IP)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00ZwyL_t(&-tC&rOO!zvz;`uVsYAK#u`-3g49kBYI*5b> zna~%C&>`E11^Xf?D5MVIp_>F2)*&LQf51>I1+gfzPr@RiB)xP|vr@8Or)cJ#nRjRA z-7I3~JD0e^wRFk2LdlJw+y2!AJ_+kRZ zsim7wgpE&Jrp5=$RiT&+udy9t93t`Ofa2`q1Fqve%`RWc9%mf`_>O+ca}CtUEK$Y` zyK@H==YsYn-{|Kw+o>Q)5k(}apq?|_<(pQ%!)EES<1FEt#`r__v)rh&f)*ZW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cyK^JEv1sG(PZf_d2H|mu;qrl7byg};E=;Hl;dAgw#~NSJ?r6qX9ISENhs8v zN|^K_08TW0hDoS=vdffhTf!cHF3KCI5)+pFrWoXXQ=nF>+0ZM3)s%dAoFXg;=?2^P zn@-ytVEV#OM=-nv#VE)N{`Azg8iboln*gSigDuH664T96BicN=Dd~0zqAQW{CIEfu zn-#WaEnb`&Y7azTCV0XUg%eE0!MPZp%Gd;;20U-@`Y&5Pn}cXeROo#BEXR;xFeMPj z(i#Vt(z`Ah&!fyJhQj9^o~YLh+h-h{Q_TvHGd%W`Z#n4jdFr(NAb%Ta|wCd%OVWb9F$&KkcFOZd`>bG8p;ICMsUJ19@|ED??LBr5B!;PN- zdv1nsof~sG6zX`WOytLs#wFK8>kL$UOV!X%R55HE5yt)#;8r#h3O;@xu$3FzG)(kD zG9cG;S`dAei~UT)?*l#ub8!oUG@tDB`6&8a56JPOEd@hVY`ZCjYty3o zHz1c9(zxFZe%2)t5r9A?i37rZN>h9Rh2N27BDh{V_xj6Vu2lj~n{*o-TU`kNY!~-9 zOp+IwuT(iS6<<+6&g&QM_0s%8js6svQ|PI;p^`lv2KPd&X}Fzb{gdYtaw@INyE(Ya zg8TY1#S>e?^!%_kG)V!9V>9*C&ICFiMY($+D4MF0s zu&ITYbx0XAgV z5z)lD7Tl9}l$@h#=P`)qhu@LS0k!_lxCyv3vq|NPZ5*(bf_@D67X1G$Dm9NqkS<&^ zSjMYtDN_f1ZKVpJ0w`1f6+oc^r~nF$1DsJ_MLnqk_(fm6JONGmKjn1}PyrMwfC`{c r0aO5m3ZMcgQ~(t~p#n4v{u5vTi=k?RtAMtY00000NkvXXu0mjf%;7w( diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/ic_lock_header.png b/TMessagesProj/src/main/res/drawable-xxhdpi/ic_lock_header.png new file mode 100644 index 0000000000000000000000000000000000000000..84625c32b76bffab79fddb4efcd18428feea8c56 GIT binary patch literal 1300 zcmeAS@N?(olHy`uVBq!ia0vp^3P7yI!3HERJ&c?Lq$EpRBT9nv(@M${i&7aJQ}UBi z6+Ckj(^G>|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%G|)h(aqA*!pzme+|ba~#L3js*~Qhwz}(Hm z(ACYw9H!SLKe;qFHLnDwHwB^B5~p5JQpha;+U$~Alv$RV;#QQOs{r=0RVHq?nBg=J zsy79 z^q*wz-+bl%8SMpWk)MMFmTsBJlI}KJ-FZ!f!(pRO9vf0r7A0@F>$htDw6@o7mEvDm zIz^lJD%SpunouMen0J2jf5tS6=c;Cm_Z&_*Dh^W>dG|8tAK?DLw5Q>} z?t<3_bv{gbGF%qRU(cB57M`%{!GrZ*lom;5Og{X6%Z`pr_Tw_2zqvOsGOSg*zITbm Rt6Wey<>~6@vd$@?2>|&B+jal| literal 0 HcmV?d00001 diff --git a/TMessagesProj/src/main/res/layout/chat_layout.xml b/TMessagesProj/src/main/res/layout/chat_layout.xml index a37e137c..82fef1b8 100644 --- a/TMessagesProj/src/main/res/layout/chat_layout.xml +++ b/TMessagesProj/src/main/res/layout/chat_layout.xml @@ -111,7 +111,7 @@ android:layout_marginTop="2dp" android:maxLines="4" android:textSize="18dp" - android:textColorHint="#909090" + android:textColorHint="#b2b2b2" android:ems="10" android:imeOptions="flagNoExtractUi" android:inputType="textCapSentences|textMultiLine" @@ -119,8 +119,9 @@ android:layout_marginLeft="52dp" android:layout_marginRight="2dp" android:layout_marginBottom="4dp" - android:paddingBottom="10dp" + android:paddingBottom="8dp" android:paddingTop="4dp" + android:background="@null" android:textCursorDrawable="@null" android:textColor="#000000"/> diff --git a/TMessagesProj/src/main/res/layout/popup_notification_layout.xml b/TMessagesProj/src/main/res/layout/popup_notification_layout.xml index 0bc24ab7..679cf1e8 100644 --- a/TMessagesProj/src/main/res/layout/popup_notification_layout.xml +++ b/TMessagesProj/src/main/res/layout/popup_notification_layout.xml @@ -51,9 +51,9 @@ android:layout_gravity="bottom" android:id="@+id/chat_text_edit" android:layout_marginTop="2dp" - android:maxLines="2" + android:maxLines="4" android:textSize="18dp" - android:textColorHint="#909090" + android:textColorHint="#b2b2b2" android:ems="10" android:imeOptions="flagNoExtractUi" android:inputType="textCapSentences|textMultiLine" @@ -61,8 +61,9 @@ android:layout_marginLeft="52dp" android:layout_marginRight="2dp" android:layout_marginBottom="4dp" - android:paddingBottom="10dp" + android:paddingBottom="8dp" android:paddingTop="4dp" + android:background="@null" android:textCursorDrawable="@null" android:textColor="#000000"/> diff --git a/TMessagesProj/src/main/res/values-v21/styles.xml b/TMessagesProj/src/main/res/values-v21/styles.xml index f21fc13a..87fc512c 100644 --- a/TMessagesProj/src/main/res/values-v21/styles.xml +++ b/TMessagesProj/src/main/res/values-v21/styles.xml @@ -35,7 +35,7 @@ #33000000 #54759e @style/Theme.TMessages.Dialog.Alert - #678cb9 + #4d83b3 diff --git a/TMessagesProj/src/main/res/values/strings.xml b/TMessagesProj/src/main/res/values/strings.xml index 6710582c..93ab6455 100644 --- a/TMessagesProj/src/main/res/values/strings.xml +++ b/TMessagesProj/src/main/res/values/strings.xml @@ -47,7 +47,7 @@ Clear history Delete and exit Delete chat - Hidden Name + Deleted Account Select Chat Tap and hold to view %1$s is using an older version of Telegram, so secret photos will be shown in compatibility mode.\n\nOnce %2$s updates Telegram, photos with timers for 1 minute or less will start working in \'Tap and hold to view\' mode, and you will be notified whenever the other party takes a screenshot. @@ -287,6 +287,7 @@ Gallery All Photos No photos yet + Please download media first Privacy and Security Privacy @@ -300,11 +301,10 @@ My Contacts (-%1$d, +%2$d) Nobody (+%1$d) Security - Delete my account - If Away For + Account self-destructs + If you\'re away for If you do not log in at least once within this period, your account will be deleted along with all groups, messages and contacts. Delete your account? - Never Change who can see your Last Seen time. Who can see your Last Seen time? Add exceptions