From 9d2dfd33eed31446632eac95119290e9c2d79d06 Mon Sep 17 00:00:00 2001 From: DrKLO Date: Thu, 26 Dec 2013 20:46:13 +0400 Subject: [PATCH] update to 1.3.7 --- TMessagesProj/src/main/AndroidManifest.xml | 4 +- .../src/main/java/org/telegram/TL/TLRPC.java | 2 +- .../messenger/ConnectionsManager.java | 12 ++ .../java/org/telegram/messenger/Emoji.java | 10 +- .../telegram/messenger/FileLoadOperation.java | 8 +- .../org/telegram/messenger/FileLoader.java | 2 - .../messenger/MessagesController.java | 14 +++ .../telegram/messenger/MessagesStorage.java | 1 + .../org/telegram/messenger/Utilities.java | 6 + .../org/telegram/ui/ApplicationActivity.java | 14 +-- .../java/org/telegram/ui/ChatActivity.java | 116 +++++++++--------- .../org/telegram/ui/ContactsActivity.java | 8 +- .../telegram/ui/CountrySelectActivity.java | 8 +- .../org/telegram/ui/GalleryImageViewer.java | 16 ++- .../org/telegram/ui/IdenticonActivity.java | 6 +- .../java/org/telegram/ui/IntroActivity.java | 5 +- .../org/telegram/ui/LocationActivity.java | 77 ++---------- .../java/org/telegram/ui/LoginActivity.java | 4 +- .../telegram/ui/LoginActivityPhoneView.java | 3 + .../java/org/telegram/ui/MediaActivity.java | 8 +- .../org/telegram/ui/MessagesActivity.java | 10 +- .../ui/SettingsChangeNameActivity.java | 2 +- .../ui/SettingsWallpapersActivity.java | 12 +- .../org/telegram/ui/UserProfileActivity.java | 4 +- .../ui/Views/MessageActionLayout.java | 4 +- .../org/telegram/ui/Views/MessageLayout.java | 7 +- .../telegram/ui/Views/NotificationView.java | 18 +-- .../src/main/res/drawable-hdpi/map_dot.png | Bin 2065 -> 0 bytes .../src/main/res/drawable-ldpi/map_dot.png | Bin 1478 -> 0 bytes .../src/main/res/drawable-mdpi/map_dot.png | Bin 1658 -> 0 bytes .../src/main/res/drawable-xhdpi/map_dot.png | Bin 2449 -> 0 bytes .../src/main/res/drawable-xxhdpi/map_dot.png | Bin 3466 -> 0 bytes 32 files changed, 168 insertions(+), 213 deletions(-) delete mode 100644 TMessagesProj/src/main/res/drawable-hdpi/map_dot.png delete mode 100644 TMessagesProj/src/main/res/drawable-ldpi/map_dot.png delete mode 100644 TMessagesProj/src/main/res/drawable-mdpi/map_dot.png delete mode 100644 TMessagesProj/src/main/res/drawable-xhdpi/map_dot.png delete mode 100644 TMessagesProj/src/main/res/drawable-xxhdpi/map_dot.png diff --git a/TMessagesProj/src/main/AndroidManifest.xml b/TMessagesProj/src/main/AndroidManifest.xml index 4a4be47de..3b163ccc0 100644 --- a/TMessagesProj/src/main/AndroidManifest.xml +++ b/TMessagesProj/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="131" + android:versionName="1.3.7"> fileProgresses = new ConcurrentHashMap(); private long lastProgressUpdateTime = 0; - public float density = 1; private HashMap BitmapUseCounts = new HashMap(); int lastImageNum; @@ -254,7 +253,6 @@ public class FileLoader { public FileLoader() { int cacheSize = Math.min(15, ((ActivityManager) ApplicationLoader.applicationContext.getSystemService(Context.ACTIVITY_SERVICE)).getMemoryClass() / 7) * 1024 * 1024; - density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (Build.VERSION.SDK_INT < 11) { runtimeHack = new VMRuntimeHack(); cacheSize = 1024 * 1024 * 3; diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java index e39e47315..2d8445efd 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java @@ -3364,6 +3364,20 @@ public class MessagesController implements NotificationCenter.NotificationCenter req.system_version = "SDK " + Build.VERSION.SDK_INT; req.app_version = "App version unknown"; } + + if (req.lang_code == null || req.lang_code.length() == 0) { + req.lang_code = "en"; + } + if (req.device_model == null || req.device_model.length() == 0) { + req.device_model = "Android unknown"; + } + if (req.app_version == null || req.app_version.length() == 0) { + req.app_version = "App version unknown"; + } + if (req.system_version == null || req.system_version.length() == 0) { + req.system_version = "SDK Unknown"; + } + if (req.app_version != null) { ConnectionsManager.Instance.performRpc(req, new RPCRequest.RPCRequestDelegate() { @Override diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java index 081ae7a32..996edea6c 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java @@ -48,6 +48,7 @@ public class MessagesStorage { public void openDatabase() { cacheFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "cache4.db"); + boolean createTable = false; //cacheFile.delete(); if (!cacheFile.exists()) { diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java b/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java index 311d7ff22..a31bd7075 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java @@ -56,6 +56,7 @@ import javax.crypto.Cipher; public class Utilities { public static Handler applicationHandler; public static int statusBarHeight = 0; + public static float density = 1; private final static Integer lock = 1; public static ArrayList goodPrimes = new ArrayList(); @@ -74,6 +75,7 @@ public class Utilities { public native static byte[] aesIgeEncryption(byte[] _what, byte[] _key, byte[] _iv, boolean encrypt, boolean changeIv); static { + density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("primes", Context.MODE_PRIVATE); String primes = preferences.getString("primes", null); if (primes == null) { @@ -121,6 +123,10 @@ public class Utilities { return new String(hexChars); } + public static int dp(int value) { + return (int)(density * value); + } + public static boolean isGoodPrime(byte[] prime, int g) { if (!(g >= 2 && g <= 7)) { return false; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ApplicationActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ApplicationActivity.java index 1353c3207..57dd7b5d6 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ApplicationActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ApplicationActivity.java @@ -393,21 +393,20 @@ public class ApplicationActivity extends ActionBarActivity implements Notificati public void onGlobalLayout() { WindowManager manager = (WindowManager) getSystemService(WINDOW_SERVICE); int rotation = manager.getDefaultDisplay().getRotation(); - float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; int height; int currentActionBarHeight = getSupportActionBar().getHeight(); - if (currentActionBarHeight != 48 * density && currentActionBarHeight != 40 * density) { + if (currentActionBarHeight != Utilities.dp(48) && currentActionBarHeight != Utilities.dp(40)) { height = currentActionBarHeight; } else { - height = (int) (48.0f * density); + height = Utilities.dp(48); if (rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90) { - height = (int) (40.0f * density); + height = Utilities.dp(40); } } if (notificationView != null) { - notificationView.applyOrientationPaddings(rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90, density, height); + notificationView.applyOrientationPaddings(rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90, height); } if (Build.VERSION.SDK_INT < 16) { @@ -579,17 +578,16 @@ public class ApplicationActivity extends ActionBarActivity implements Notificati actionBar.setCustomView(statusView); } - float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; try { if (statusView.getLayoutParams() instanceof android.support.v7.app.ActionBar.LayoutParams) { android.support.v7.app.ActionBar.LayoutParams statusParams = (android.support.v7.app.ActionBar.LayoutParams)statusView.getLayoutParams(); statusText.measure(View.MeasureSpec.makeMeasureSpec(800, View.MeasureSpec.AT_MOST), 100); - statusParams.width = (int)(statusText.getMeasuredWidth() + 54 * density); + statusParams.width = (int)(statusText.getMeasuredWidth() + Utilities.dp(54)); statusView.setLayoutParams(statusParams); } else if (statusView.getLayoutParams() instanceof android.app.ActionBar.LayoutParams) { android.app.ActionBar.LayoutParams statusParams = (android.app.ActionBar.LayoutParams)statusView.getLayoutParams(); statusText.measure(View.MeasureSpec.makeMeasureSpec(800, View.MeasureSpec.AT_MOST), 100); - statusParams.width = (int)(statusText.getMeasuredWidth() + 54 * density); + statusParams.width = (int)(statusText.getMeasuredWidth() + Utilities.dp(54)); statusView.setLayoutParams(statusParams); } } catch (Exception e) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index 96fc843fd..98af2ca08 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -117,7 +117,6 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa private View progressView; private boolean ignoreTextChange = false; private TextView emptyView; - private float displayDensity; private View bottomOverlay; private TextView bottomOverlayText; private MessageObject selectedObject; @@ -350,7 +349,6 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } else { display.getSize(displaySize); } - displayDensity = getResources().getDisplayMetrics().density; } @Override @@ -415,7 +413,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa secretChatPlaceholder.setBackgroundResource(R.drawable.system_blue); } secretViewStatusTextView = (TextView)contentView.findViewById(R.id.invite_text); - secretChatPlaceholder.setPadding((int)(16 * displayDensity), (int)(12 * displayDensity), (int)(16 * displayDensity), (int)(12 * displayDensity)); + secretChatPlaceholder.setPadding(Utilities.dp(16), Utilities.dp(12), Utilities.dp(16), Utilities.dp(12)); View v = contentView.findViewById(R.id.secret_placeholder); v.setVisibility(View.VISIBLE); @@ -444,7 +442,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa progressViewInner.setBackgroundResource(R.drawable.system_loader1); emptyView.setBackgroundResource(R.drawable.system_blue); } - emptyView.setPadding((int)(7 * displayDensity), (int)(1 * displayDensity), (int)(7 * displayDensity), (int)(1 * displayDensity)); + emptyView.setPadding(Utilities.dp(7), Utilities.dp(1), Utilities.dp(7), Utilities.dp(1)); if (currentUser != null && currentUser.id == 333000) { emptyView.setText(R.string.GotAQuestion); @@ -952,7 +950,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa if (title != null) { if (currentEncryptedChat != null) { title.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_white, 0, 0, 0); - title.setCompoundDrawablePadding((int)(4 * displayDensity)); + title.setCompoundDrawablePadding(Utilities.dp(4)); } else { title.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); title.setCompoundDrawablePadding(0); @@ -1367,18 +1365,18 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa chatAdapter.notifyDataSetChanged(); if (positionToUnread && unreadMessageObject != null) { if (messages.get(messages.size() - 1) == unreadMessageObject) { - chatListView.setSelectionFromTop(0, -(int)(11 * displayDensity)); + chatListView.setSelectionFromTop(0, Utilities.dp(-11)); } else { - chatListView.setSelectionFromTop(messages.size() - messages.indexOf(unreadMessageObject), -(int)(11 * displayDensity)); + chatListView.setSelectionFromTop(messages.size() - messages.indexOf(unreadMessageObject), Utilities.dp(-11)); } ViewTreeObserver obs = chatListView.getViewTreeObserver(); obs.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { @Override public boolean onPreDraw() { if (messages.get(messages.size() - 1) == unreadMessageObject) { - chatListView.setSelectionFromTop(0, -(int)(11 * displayDensity)); + chatListView.setSelectionFromTop(0, Utilities.dp(-11)); } else { - chatListView.setSelectionFromTop(messages.size() - messages.indexOf(unreadMessageObject), -(int)(11 * displayDensity)); + chatListView.setSelectionFromTop(messages.size() - messages.indexOf(unreadMessageObject), Utilities.dp(-11)); } chatListView.getViewTreeObserver().removeOnPreDrawListener(this); return false; @@ -1826,7 +1824,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa topPanel.setVisibility(View.GONE); } else { topPanel.setVisibility(View.VISIBLE); - topPanelText.setShadowLayer(1, 0, 1 * displayDensity, 0xff8797a3); + topPanelText.setShadowLayer(1, 0, Utilities.dp(1), 0xff8797a3); if (isCustomTheme) { topPlaneClose.setImageResource(R.drawable.ic_msg_btn_cross_custom); topPanel.setBackgroundResource(R.drawable.top_pane_custom); @@ -1989,7 +1987,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa if (scrollToTopOnResume) { if (scrollToTopUnReadOnResume && unreadMessageObject != null) { if (chatListView != null) { - chatListView.setSelectionFromTop(messages.size() - messages.indexOf(unreadMessageObject), -chatListView.getPaddingTop() - (int)(7 * displayDensity)); + chatListView.setSelectionFromTop(messages.size() - messages.indexOf(unreadMessageObject), -chatListView.getPaddingTop() - Utilities.dp(7)); } } else { if (chatListView != null) { @@ -2051,7 +2049,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } else { subtitle.setCompoundDrawablesWithIntrinsicBounds(R.drawable.typing_dots, 0, 0, 0); } - subtitle.setCompoundDrawablePadding((int)(4 * displayDensity)); + subtitle.setCompoundDrawablePadding(Utilities.dp(4)); AnimationDrawable mAnim = (AnimationDrawable)subtitle.getCompoundDrawables()[0]; mAnim.setAlpha(200); mAnim.start(); @@ -2101,13 +2099,13 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa int rotation = display.getRotation(); int height; int currentActionBarHeight = parentActivity.getSupportActionBar().getHeight(); - float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; - if (currentActionBarHeight != 48 * density && currentActionBarHeight != 40 * density) { + + if (currentActionBarHeight != Utilities.dp(48) && currentActionBarHeight != Utilities.dp(40)) { height = currentActionBarHeight; } else { - height = (int) (48.0f * density); + height = Utilities.dp(48); if (rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90) { - height = (int) (40.0f * density); + height = Utilities.dp(40); } } @@ -2128,7 +2126,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } if (title != null) { title.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_white, 0, 0, 0); - title.setCompoundDrawablePadding((int) (4 * displayDensity)); + title.setCompoundDrawablePadding(Utilities.dp(4)); } } @@ -2691,22 +2689,22 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa holder.chatBubbleView.setBackgroundResource(R.drawable.chat_incoming_photo_states); } else if (messageType == 0 || messageType == 8) { holder.messageLayout.setBackgroundResource(R.drawable.chat_outgoing_text_states); - holder.messageLayout.setPadding((int)(11 * displayDensity), (int)(7 * displayDensity), (int)(18 * displayDensity), 0); + holder.messageLayout.setPadding(Utilities.dp(11), Utilities.dp(7), Utilities.dp(18), 0); } else if (messageType == 1 || messageType == 9) { holder.messageLayout.setBackgroundResource(R.drawable.chat_incoming_text_states); - holder.messageLayout.setPadding((int)(19 * displayDensity), (int)(7 * displayDensity), (int)(9 * displayDensity), 0); + holder.messageLayout.setPadding(Utilities.dp(19), Utilities.dp(7), Utilities.dp(9), 0); } else if (messageType == 12) { holder.chatBubbleView.setBackgroundResource(R.drawable.chat_outgoing_text_states); - holder.chatBubbleView.setPadding((int)(6 * displayDensity), (int)(6 * displayDensity), (int)(18 * displayDensity), 0); + holder.chatBubbleView.setPadding(Utilities.dp(6), Utilities.dp(6), Utilities.dp(18), 0); } else if (messageType == 13) { holder.chatBubbleView.setBackgroundResource(R.drawable.chat_incoming_text_states); - holder.chatBubbleView.setPadding((int)(15 * displayDensity), (int)(6 * displayDensity), (int)(9 * displayDensity), 0); + holder.chatBubbleView.setPadding(Utilities.dp(15), Utilities.dp(6), Utilities.dp(9), 0); } else if (messageType == 16) { holder.chatBubbleView.setBackgroundResource(R.drawable.chat_outgoing_text_states); - holder.chatBubbleView.setPadding((int)(9 * displayDensity), (int)(9 * displayDensity), (int)(18 * displayDensity), 0); + holder.chatBubbleView.setPadding(Utilities.dp(9), Utilities.dp(9), Utilities.dp(18), 0); } else if (messageType == 17) { holder.chatBubbleView.setBackgroundResource(R.drawable.chat_incoming_text_states); - holder.chatBubbleView.setPadding((int)(18 * displayDensity), (int)(9 * displayDensity), (int)(9 * displayDensity), 0); + holder.chatBubbleView.setPadding(Utilities.dp(18), Utilities.dp(9), Utilities.dp(9), 0); } } else { if (messageType == 2 || messageType == 4 || messageType == 6) { @@ -2727,42 +2725,42 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } else { holder.messageLayout.setBackgroundResource(R.drawable.msg_out); } - holder.messageLayout.setPadding((int)(11 * displayDensity), (int)(7 * displayDensity), (int)(18 * displayDensity), 0); + holder.messageLayout.setPadding(Utilities.dp(11), Utilities.dp(7), Utilities.dp(18), 0); } else if (messageType == 1 || messageType == 9) { if (selected) { holder.messageLayout.setBackgroundResource(R.drawable.msg_in_selected); } else { holder.messageLayout.setBackgroundResource(R.drawable.msg_in); } - holder.messageLayout.setPadding((int)(19 * displayDensity), (int)(7 * displayDensity), (int)(9 * displayDensity), 0); + holder.messageLayout.setPadding(Utilities.dp(19), Utilities.dp(7), Utilities.dp(9), 0); } else if (messageType == 12) { if (selected) { holder.chatBubbleView.setBackgroundResource(R.drawable.msg_out_selected); } else { holder.chatBubbleView.setBackgroundResource(R.drawable.msg_out); } - holder.chatBubbleView.setPadding((int)(6 * displayDensity), (int)(6 * displayDensity), (int)(18 * displayDensity), 0); + holder.chatBubbleView.setPadding(Utilities.dp(6), Utilities.dp(6), Utilities.dp(18), 0); } else if (messageType == 13) { if (selected) { holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in_selected); } else { holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in); } - holder.chatBubbleView.setPadding((int)(15 * displayDensity), (int)(6 * displayDensity), (int)(9 * displayDensity), 0); + holder.chatBubbleView.setPadding(Utilities.dp(15), Utilities.dp(6), Utilities.dp(9), 0); } else if (messageType == 16) { if (selected) { holder.chatBubbleView.setBackgroundResource(R.drawable.msg_out_selected); } else { holder.chatBubbleView.setBackgroundResource(R.drawable.msg_out); } - holder.chatBubbleView.setPadding((int)(9 * displayDensity), (int)(9 * displayDensity), (int)(18 * displayDensity), 0); + holder.chatBubbleView.setPadding(Utilities.dp(9), Utilities.dp(9), Utilities.dp(18), 0); } else if (messageType == 17) { if (selected) { holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in_selected); } else { holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in); } - holder.chatBubbleView.setPadding((int)(18 * displayDensity), (int)(9 * displayDensity), (int)(9 * displayDensity), 0); + holder.chatBubbleView.setPadding(Utilities.dp(18), Utilities.dp(9), Utilities.dp(9), 0); } } } @@ -2934,22 +2932,22 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa holder.chatBubbleView.setBackgroundResource(R.drawable.chat_incoming_photo_states); } else if (messageType == 0 || messageType == 8) { holder.messageLayout.setBackgroundResource(R.drawable.chat_outgoing_text_states); - holder.messageLayout.setPadding((int)(11 * displayDensity), (int)(7 * displayDensity), (int)(18 * displayDensity), 0); + holder.messageLayout.setPadding(Utilities.dp(11), Utilities.dp(7), Utilities.dp(18), 0); } else if (messageType == 1 || messageType == 9) { holder.messageLayout.setBackgroundResource(R.drawable.chat_incoming_text_states); - holder.messageLayout.setPadding((int)(19 * displayDensity), (int)(7 * displayDensity), (int)(9 * displayDensity), 0); + holder.messageLayout.setPadding(Utilities.dp(19), Utilities.dp(7), Utilities.dp(9), 0); } else if (messageType == 12) { holder.chatBubbleView.setBackgroundResource(R.drawable.chat_outgoing_text_states); - holder.chatBubbleView.setPadding((int)(6 * displayDensity), (int)(6 * displayDensity), (int)(18 * displayDensity), 0); + holder.chatBubbleView.setPadding(Utilities.dp(6), Utilities.dp(6), Utilities.dp(18), 0); } else if (messageType == 13) { holder.chatBubbleView.setBackgroundResource(R.drawable.chat_incoming_text_states); - holder.chatBubbleView.setPadding((int)(15 * displayDensity), (int)(6 * displayDensity), (int)(9 * displayDensity), 0); + holder.chatBubbleView.setPadding(Utilities.dp(15), Utilities.dp(6), Utilities.dp(9), 0); } else if (messageType == 16) { holder.chatBubbleView.setBackgroundResource(R.drawable.chat_outgoing_text_states); - holder.chatBubbleView.setPadding((int)(9 * displayDensity), (int)(9 * displayDensity), (int)(18 * displayDensity), 0); + holder.chatBubbleView.setPadding(Utilities.dp(9), Utilities.dp(9), Utilities.dp(18), 0); } else if (messageType == 17) { holder.chatBubbleView.setBackgroundResource(R.drawable.chat_incoming_text_states); - holder.chatBubbleView.setPadding((int)(18 * displayDensity), (int)(9 * displayDensity), (int)(9 * displayDensity), 0); + holder.chatBubbleView.setPadding(Utilities.dp(18), Utilities.dp(9), Utilities.dp(9), 0); } } else { if (messageType == 2 || messageType == 4 || messageType == 6) { @@ -2970,42 +2968,42 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } else { holder.messageLayout.setBackgroundResource(R.drawable.msg_out); } - holder.messageLayout.setPadding((int)(11 * displayDensity), (int)(7 * displayDensity), (int)(18 * displayDensity), 0); + holder.messageLayout.setPadding(Utilities.dp(11), Utilities.dp(7), Utilities.dp(18), 0); } else if (messageType == 1 || messageType == 9) { if (selected) { holder.messageLayout.setBackgroundResource(R.drawable.msg_in_selected); } else { holder.messageLayout.setBackgroundResource(R.drawable.msg_in); } - holder.messageLayout.setPadding((int)(19 * displayDensity), (int)(7 * displayDensity), (int)(9 * displayDensity), 0); + holder.messageLayout.setPadding(Utilities.dp(19), Utilities.dp(7), Utilities.dp(9), 0); } else if (messageType == 12) { if (selected) { holder.chatBubbleView.setBackgroundResource(R.drawable.msg_out_selected); } else { holder.chatBubbleView.setBackgroundResource(R.drawable.msg_out); } - holder.chatBubbleView.setPadding((int)(6 * displayDensity), (int)(6 * displayDensity), (int)(18 * displayDensity), 0); + holder.chatBubbleView.setPadding(Utilities.dp(6), Utilities.dp(6), Utilities.dp(18), 0); } else if (messageType == 13) { if (selected) { holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in_selected); } else { holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in); } - holder.chatBubbleView.setPadding((int)(15 * displayDensity), (int)(6 * displayDensity), (int)(9 * displayDensity), 0); + holder.chatBubbleView.setPadding(Utilities.dp(15), Utilities.dp(6), Utilities.dp(9), 0); } else if (messageType == 16) { if (selected) { holder.chatBubbleView.setBackgroundResource(R.drawable.msg_out_selected); } else { holder.chatBubbleView.setBackgroundResource(R.drawable.msg_out); } - holder.chatBubbleView.setPadding((int)(9 * displayDensity), (int)(9 * displayDensity), (int)(18 * displayDensity), 0); + holder.chatBubbleView.setPadding(Utilities.dp(9), Utilities.dp(9), Utilities.dp(18), 0); } else if (messageType == 17) { if (selected) { holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in_selected); } else { holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in); } - holder.chatBubbleView.setPadding((int)(18 * displayDensity), (int)(9 * displayDensity), (int)(9 * displayDensity), 0); + holder.chatBubbleView.setPadding(Utilities.dp(18), Utilities.dp(9), Utilities.dp(9), 0); } } @@ -3084,11 +3082,10 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa if (type == 0 || type == 1 || type == 8 || type == 9) { int width; if (currentChat != null && (type == 1 || type == 9)) { - width = displaySize.x - (int)(122 * displayDensity); + width = displaySize.x - Utilities.dp(122); } else { - width = displaySize.x - (int)(80 * displayDensity); + width = displaySize.x - Utilities.dp(80); } - messageLayout.density = displayDensity; messageLayout.maxWidth = width; messageLayout.messageTextView.setText(message.messageText); messageLayout.messageTextView.setMaxWidth(width); @@ -3124,18 +3121,18 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa if (photo != null) { float scale = (float)photo.photoOwner.w / (float)width; - if (scale < 1 && photo.photoOwner.w * scale < 100 * displayDensity) { - scale = photo.photoOwner.w / (100 * displayDensity); + if (scale < 1 && photo.photoOwner.w * scale < Utilities.dp(100)) { + scale = photo.photoOwner.w / Utilities.dp(100); } int w = (int)(photo.photoOwner.w / scale); int h = (int)(photo.photoOwner.h / scale); - if (h > 160 * displayDensity) { + if (h > Utilities.dp(160)) { float scale2 = h; - h = (int)(160 * displayDensity); + h = Utilities.dp(160); scale2 /= h; w = (int)(w / scale2); - } else if (h < 90 * displayDensity) { - h = (int)(90 * displayDensity); + } else if (h < Utilities.dp(90)) { + h = Utilities.dp(90); float hScale = (float)photo.photoOwner.h / h; if (photo.photoOwner.w / hScale < width) { w = (int)(photo.photoOwner.w / hScale); @@ -3151,9 +3148,9 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa photoImage.setImageBitmap(photo.image); } else { if (message.imagePreview != null) { - photoImage.setImage(photo.photoOwner.location, String.format(Locale.US, "%d_%d", (int)(w / displayDensity), (int)(h / displayDensity)), message.imagePreview); + photoImage.setImage(photo.photoOwner.location, String.format(Locale.US, "%d_%d", (int)(w / Utilities.density), (int)(h / Utilities.density)), message.imagePreview); } else { - photoImage.setImage(photo.photoOwner.location, String.format(Locale.US, "%d_%d", (int)(w / displayDensity), (int)(h / displayDensity)), message.messageOwner.out ? R.drawable.photo_placeholder_out : R.drawable.photo_placeholder_in); + photoImage.setImage(photo.photoOwner.location, String.format(Locale.US, "%d_%d", (int)(w / Utilities.density), (int)(h / Utilities.density)), message.messageOwner.out ? R.drawable.photo_placeholder_out : R.drawable.photo_placeholder_in); } } } @@ -3167,11 +3164,10 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } else if (type == 4 || type == 5) { double lat = message.messageOwner.media.geo.lat; double lon = message.messageOwner.media.geo._long; - String url = String.format(Locale.US, "https://maps.googleapis.com/maps/api/staticmap?center=%f,%f&zoom=13&size=100x100&maptype=roadmap&scale=%d&markers=color:red|size:big|%f,%f&sensor=false", lat, lon, Math.min(2, (int)Math.ceil(displayDensity)), lat, lon); + String url = String.format(Locale.US, "https://maps.googleapis.com/maps/api/staticmap?center=%f,%f&zoom=13&size=100x100&maptype=roadmap&scale=%d&markers=color:red|size:big|%f,%f&sensor=false", lat, lon, Math.min(2, (int)Math.ceil(Utilities.density)), lat, lon); photoImage.setImage(url, null, message.messageOwner.out ? R.drawable.photo_placeholder_out : R.drawable.photo_placeholder_in); } else if (type == 11 || type == 10) { - int width = (int)(displaySize.x - (30 * displayDensity)); - messageLayoutAction.density = displayDensity; + int width = displaySize.x - Utilities.dp(30); messageTextView.setText(message.messageText); messageTextView.setMaxWidth(width); @@ -3179,7 +3175,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa if (message.messageOwner.action instanceof TLRPC.TL_messageActionUserUpdatedPhoto) { photoImage.setImage(message.messageOwner.action.newUserPhoto.photo_small, "50_50", Utilities.getUserAvatarForId(currentUser.id)); } else { - PhotoObject photo = PhotoObject.getClosestImageWithSize(message.photoThumbs, (int)(64 * displayDensity), (int)(64 * displayDensity)); + PhotoObject photo = PhotoObject.getClosestImageWithSize(message.photoThumbs, Utilities.dp(64), Utilities.dp(64)); if (photo.image != null) { photoImage.setImageBitmap(photo.image); } else { @@ -3413,15 +3409,15 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa int width; if (currentChat != null && type != 16) { if (actionView.getVisibility() == View.VISIBLE) { - width = displaySize.x - (int)(290 * displayDensity); + width = displaySize.x - Utilities.dp(290); } else { - width = displaySize.x - (int)(270 * displayDensity); + width = displaySize.x - Utilities.dp(270); } } else { if (actionView.getVisibility() == View.VISIBLE) { - width = displaySize.x - (int)(240 * displayDensity); + width = displaySize.x - Utilities.dp(240); } else { - width = displaySize.x - (int)(220 * displayDensity); + width = displaySize.x - Utilities.dp(220); } } nameTextView.setMaxWidth(width); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java index 36f8e127e..be815a202 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java @@ -502,8 +502,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter if (s.length() != 0) { searchWas = true; if (listView != null) { - float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; - listView.setPadding((int)(density * 16), listView.getPaddingTop(), (int)(density * 16), listView.getPaddingBottom()); + listView.setPadding(Utilities.dp(16), listView.getPaddingTop(), Utilities.dp(16), listView.getPaddingBottom()); listView.setAdapter(searchListViewAdapter); if(android.os.Build.VERSION.SDK_INT >= 11) { listView.setFastScrollAlwaysVisible(false); @@ -538,11 +537,10 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter searchWas = false; ViewGroup group = (ViewGroup) listView.getParent(); listView.setAdapter(listViewAdapter); - float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (!isRTL) { - listView.setPadding((int) (density * 16), listView.getPaddingTop(), (int) (density * 30), listView.getPaddingBottom()); + listView.setPadding(Utilities.dp(16), listView.getPaddingTop(), Utilities.dp(30), listView.getPaddingBottom()); } else { - listView.setPadding((int) (density * 30), listView.getPaddingTop(), (int) (density * 16), listView.getPaddingBottom()); + listView.setPadding(Utilities.dp(30), listView.getPaddingTop(), Utilities.dp(16), listView.getPaddingBottom()); } if (android.os.Build.VERSION.SDK_INT >= 11) { listView.setFastScrollAlwaysVisible(true); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/CountrySelectActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/CountrySelectActivity.java index 847c13cb2..2229a75c3 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/CountrySelectActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/CountrySelectActivity.java @@ -228,8 +228,7 @@ public class CountrySelectActivity extends ActionBarActivity { if (s.length() != 0) { searchWas = true; if (listView != null) { - float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; - listView.setPadding((int)(density * 16), listView.getPaddingTop(), (int)(density * 16), listView.getPaddingBottom()); + listView.setPadding(Utilities.dp(16), listView.getPaddingTop(), Utilities.dp(16), listView.getPaddingBottom()); listView.setAdapter(searchListViewAdapter); if(android.os.Build.VERSION.SDK_INT >= 11) { listView.setFastScrollAlwaysVisible(false); @@ -261,11 +260,10 @@ public class CountrySelectActivity extends ActionBarActivity { searchWas = false; ViewGroup group = (ViewGroup) listView.getParent(); listView.setAdapter(listViewAdapter); - float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (!isRTL) { - listView.setPadding((int) (density * 16), listView.getPaddingTop(), (int) (density * 30), listView.getPaddingBottom()); + listView.setPadding(Utilities.dp(16), listView.getPaddingTop(), Utilities.dp(30), listView.getPaddingBottom()); } else { - listView.setPadding((int) (density * 30), listView.getPaddingTop(), (int) (density * 16), listView.getPaddingBottom()); + listView.setPadding(Utilities.dp(30), listView.getPaddingTop(), Utilities.dp(16), listView.getPaddingBottom()); } if (android.os.Build.VERSION.SDK_INT >= 11) { listView.setFastScrollAlwaysVisible(true); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/GalleryImageViewer.java b/TMessagesProj/src/main/java/org/telegram/ui/GalleryImageViewer.java index cc30936b3..06c55e940 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/GalleryImageViewer.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/GalleryImageViewer.java @@ -182,9 +182,7 @@ public class GalleryImageViewer extends AbstractGalleryActivity implements Notif } } - float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; - - mViewPager.setPageMargin((int)(20 * density)); + mViewPager.setPageMargin(Utilities.dp(20)); mViewPager.setOffscreenPageLimit(1); mViewPager.setAdapter(localPagerAdapter); @@ -357,8 +355,8 @@ public class GalleryImageViewer extends AbstractGalleryActivity implements Notif if (title != null) { fakeTitleView.setText(String.format("%d %s %d", pos, getString(R.string.Of), totalCount)); fakeTitleView.measure(View.MeasureSpec.makeMeasureSpec(400, View.MeasureSpec.AT_MOST), 40); - title.setWidth(fakeTitleView.getMeasuredWidth() + (int)(8 * getResources().getDisplayMetrics().density)); - title.setMaxWidth(fakeTitleView.getMeasuredWidth() + (int)(8 * getResources().getDisplayMetrics().density)); + title.setWidth(fakeTitleView.getMeasuredWidth() + Utilities.dp(8)); + title.setMaxWidth(fakeTitleView.getMeasuredWidth() + Utilities.dp(8)); } } }); @@ -778,8 +776,8 @@ public class GalleryImageViewer extends AbstractGalleryActivity implements Notif if (title != null) { fakeTitleView.setText(String.format("%d %s %d", (totalCount - imagesArr.size()) + position + 1, getString(R.string.Of), totalCount)); fakeTitleView.measure(View.MeasureSpec.makeMeasureSpec(400, View.MeasureSpec.AT_MOST), 40); - title.setWidth(fakeTitleView.getMeasuredWidth() + (int)(8 * getResources().getDisplayMetrics().density)); - title.setMaxWidth(fakeTitleView.getMeasuredWidth() + (int)(8 * getResources().getDisplayMetrics().density)); + title.setWidth(fakeTitleView.getMeasuredWidth() + Utilities.dp(8)); + title.setMaxWidth(fakeTitleView.getMeasuredWidth() + Utilities.dp(8)); } } }); @@ -797,8 +795,8 @@ public class GalleryImageViewer extends AbstractGalleryActivity implements Notif if (title != null) { fakeTitleView.setText(String.format("%d %s %d", position + 1, getString(R.string.Of), imagesArrLocations.size())); fakeTitleView.measure(View.MeasureSpec.makeMeasureSpec(400, View.MeasureSpec.AT_MOST), 40); - title.setWidth(fakeTitleView.getMeasuredWidth() + (int)(8 * getResources().getDisplayMetrics().density)); - title.setMaxWidth(fakeTitleView.getMeasuredWidth() + (int)(8 * getResources().getDisplayMetrics().density)); + title.setWidth(fakeTitleView.getMeasuredWidth() + Utilities.dp(8)); + title.setMaxWidth(fakeTitleView.getMeasuredWidth() + Utilities.dp(8)); } } }); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java index 4452dd310..fe4d6c9ce 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java @@ -25,6 +25,7 @@ import android.widget.TextView; import org.telegram.TL.TLRPC; import org.telegram.messenger.MessagesController; import org.telegram.messenger.R; +import org.telegram.messenger.Utilities; import org.telegram.ui.Views.BaseFragment; import org.telegram.ui.Views.IdenticonView; @@ -91,7 +92,7 @@ public class IdenticonActivity extends BaseFragment { } if (title != null) { title.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_white, 0, 0, 0); - title.setCompoundDrawablePadding((int)(4 * getResources().getDisplayMetrics().density)); + title.setCompoundDrawablePadding(Utilities.dp(4)); } } @@ -125,7 +126,6 @@ public class IdenticonActivity extends BaseFragment { LinearLayout layout = (LinearLayout)fragmentView; WindowManager manager = (WindowManager)parentActivity.getSystemService(Context.WINDOW_SERVICE); int rotation = manager.getDefaultDisplay().getRotation(); - float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90) { layout.setOrientation(LinearLayout.HORIZONTAL); @@ -143,7 +143,7 @@ public class IdenticonActivity extends BaseFragment { } if (title != null) { title.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_white, 0, 0, 0); - title.setCompoundDrawablePadding((int)(4 * density)); + title.setCompoundDrawablePadding(Utilities.dp(4)); } return false; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/IntroActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/IntroActivity.java index 98d2a2e22..75a49ff9b 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/IntroActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/IntroActivity.java @@ -30,10 +30,8 @@ public class IntroActivity extends ActionBarActivity { private ViewPager viewPager; private ImageView topImage1; private ImageView topImage2; - private TextView startMessagingButton; private ViewGroup bottomPages; private int lastPage = 0; - private float density = 1; private boolean isRTL = false; private boolean justCreated = false; private boolean startPressed = false; @@ -107,9 +105,8 @@ public class IntroActivity extends ActionBarActivity { R.string.Page7Message }; } - density = getResources().getDisplayMetrics().density; viewPager = (ViewPager)findViewById(R.id.intro_view_pager); - startMessagingButton = (TextView)findViewById(R.id.start_messaging_button); + TextView startMessagingButton = (TextView) findViewById(R.id.start_messaging_button); topImage1 = (ImageView)findViewById(R.id.icon_image1); topImage2 = (ImageView)findViewById(R.id.icon_image2); bottomPages = (ViewGroup)findViewById(R.id.bottom_pages); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java index ab3e6fdf6..9bcf3fa41 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java @@ -8,10 +8,7 @@ package org.telegram.ui; -import android.app.Activity; import android.location.Location; -import android.location.LocationListener; -import android.location.LocationManager; import android.os.Bundle; import android.support.v7.app.ActionBar; import android.view.LayoutInflater; @@ -32,7 +29,6 @@ import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.MarkerOptions; import org.telegram.TL.TLRPC; -import org.telegram.messenger.FileLog; import org.telegram.objects.MessageObject; import org.telegram.messenger.MessagesController; import org.telegram.messenger.NotificationCenter; @@ -41,10 +37,9 @@ import org.telegram.messenger.Utilities; import org.telegram.ui.Views.BackupImageView; import org.telegram.ui.Views.BaseFragment; -public class LocationActivity extends BaseFragment implements LocationListener, NotificationCenter.NotificationCenterDelegate { +public class LocationActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate { private GoogleMap googleMap; private TextView distanceTextView; - private Marker myLocationMarker; private Marker userMarker; private Location myLocation; private Location userLocation; @@ -60,16 +55,22 @@ public class LocationActivity extends BaseFragment implements LocationListener, @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - setupLocationListener(); googleMap = getMap(); if (googleMap == null) { return; } - googleMap.setMyLocationEnabled(false); + googleMap.setMyLocationEnabled(true); googleMap.getUiSettings().setMyLocationButtonEnabled(false); googleMap.getUiSettings().setZoomControlsEnabled(false); googleMap.getUiSettings().setCompassEnabled(false); + googleMap.setOnMyLocationChangeListener(new GoogleMap.OnMyLocationChangeListener() { + @Override + public void onMyLocationChange(Location location) { + positionMarker(location); + } + }); + myLocation = googleMap.getMyLocation(); if (sendButton != null) { userLocation = new Location("network"); @@ -160,8 +161,6 @@ public class LocationActivity extends BaseFragment implements LocationListener, @Override public void onFragmentDestroy() { super.onFragmentDestroy(); - LocationManager locationManager = (LocationManager)parentActivity.getSystemService(Activity.LOCATION_SERVICE); - locationManager.removeUpdates(this); NotificationCenter.Instance.removeObserver(this, MessagesController.updateInterfaces); NotificationCenter.Instance.removeObserver(this, MessagesController.closeChats); } @@ -295,47 +294,11 @@ public class LocationActivity extends BaseFragment implements LocationListener, return true; } - private void setupLocationListener() { - try { - LocationManager locationManager = (LocationManager)parentActivity.getSystemService(Activity.LOCATION_SERVICE); - boolean isGPSEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); - boolean isNetworkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); - - Location location = null; - - if (isGPSEnabled || isNetworkEnabled) { - if (isGPSEnabled) { - locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000 * 3 * 1, 1, this); - if (locationManager != null) { - location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); - } - } - if (location == null && isNetworkEnabled) { - locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1000 * 3 * 1, 1, this); - if (locationManager != null) { - location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); - } - } - } - positionMarker(location); - } catch (Exception e) { - FileLog.e("tmessages", e); - } - } - private void positionMarker(Location location) { if (location == null) { return; } myLocation = location; - if (myLocationMarker == null) { - if (googleMap != null) { - myLocationMarker = googleMap.addMarker(new MarkerOptions().position(new LatLng(location.getLatitude(), location.getLongitude())). - icon(BitmapDescriptorFactory.fromResource(R.drawable.map_dot)).anchor(0.5f, 0.5f)); - } - } else { - myLocationMarker.setPosition(new LatLng(location.getLatitude(), location.getLongitude())); - } if (messageObject != null) { if (userLocation != null && distanceTextView != null) { float distance = location.distanceTo(userLocation); @@ -363,28 +326,6 @@ public class LocationActivity extends BaseFragment implements LocationListener, } - @Override - public void onLocationChanged(final Location location) { - Utilities.RunOnUIThread(new Runnable() { - @Override - public void run() { - positionMarker(location); - } - }); - } - - @Override - public void onProviderDisabled(String provider) { - } - - @Override - public void onProviderEnabled(String provider) { - } - - @Override - public void onStatusChanged(String provider, int status, Bundle extras) { - } - @Override public void didReceivedNotification(int id, Object... args) { if (id == MessagesController.updateInterfaces) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java index ef93b8edf..06b095823 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java @@ -82,13 +82,13 @@ public class LoginActivity extends ActionBarActivity implements SlideView.SlideV getSupportActionBar().setLogo(R.drawable.ab_icon_fixed2); getSupportActionBar().show(); - float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; + ImageView view = (ImageView)findViewById(16908332); if (view == null) { view = (ImageView)findViewById(R.id.home); } if (view != null) { - view.setPadding((int)(density * 6), 0, (int)(density * 6), 0); + view.setPadding(Utilities.dp(6), 0, Utilities.dp(6), 0); } views[0] = (SlideView)findViewById(R.id.login_page1); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivityPhoneView.java b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivityPhoneView.java index 6cffca0e9..f6d4ac4ac 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivityPhoneView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivityPhoneView.java @@ -306,6 +306,9 @@ public class LoginActivityPhoneView extends SlideView implements AdapterView.OnI req.sms_type = 0; req.phone_number = phone; req.lang_code = Locale.getDefault().getCountry(); + if (req.lang_code == null || req.lang_code.length() == 0) { + req.lang_code = "en"; + } final Bundle params = new Bundle(); params.putString("phone", "+" + codeField.getText() + phoneField.getText()); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java index 44debb60f..53a812f29 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java @@ -28,6 +28,7 @@ import android.widget.GridView; import android.widget.TextView; import org.telegram.TL.TLRPC; +import org.telegram.messenger.Utilities; import org.telegram.objects.MessageObject; import org.telegram.messenger.MessagesController; import org.telegram.messenger.NotificationCenter; @@ -289,20 +290,19 @@ public class MediaActivity extends BaseFragment implements NotificationCenter.No public boolean onPreDraw() { WindowManager manager = (WindowManager)parentActivity.getSystemService(Activity.WINDOW_SERVICE); int rotation = manager.getDefaultDisplay().getRotation(); - float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90) { orientation = 1; listView.setNumColumns(6); - itemWidth = getResources().getDisplayMetrics().widthPixels / 6 - (int)(2 * density) * 5; + itemWidth = getResources().getDisplayMetrics().widthPixels / 6 - Utilities.dp(2) * 5; listView.setColumnWidth(itemWidth); } else { orientation = 0; listView.setNumColumns(4); - itemWidth = getResources().getDisplayMetrics().widthPixels / 4 - (int)(2 * density) * 3; + itemWidth = getResources().getDisplayMetrics().widthPixels / 4 - Utilities.dp(2) * 3; listView.setColumnWidth(itemWidth); } - listView.setPadding(listView.getPaddingLeft(), (int)(4 * density), listView.getPaddingRight(), listView.getPaddingBottom()); + listView.setPadding(listView.getPaddingLeft(), Utilities.dp(4), listView.getPaddingRight(), listView.getPaddingBottom()); listAdapter.notifyDataSetChanged(); listView.getViewTreeObserver().removeOnPreDrawListener(this); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java index 8788afbef..8a49103be 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java @@ -70,7 +70,6 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter private static boolean dialogsLoaded = false; private boolean searching = false; private boolean searchWas = false; - private float density = 1; private boolean onlySelect = false; private int activityToken = (int)(MessagesController.random.nextDouble() * Integer.MAX_VALUE); private long selectedDialog; @@ -88,7 +87,6 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter @Override public boolean onFragmentCreate() { super.onFragmentCreate(); - density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; NotificationCenter.Instance.addObserver(this, MessagesController.dialogsNeedReload); NotificationCenter.Instance.addObserver(this, 999); NotificationCenter.Instance.addObserver(this, MessagesController.updateInterfaces); @@ -324,7 +322,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter view = (ImageView)parentActivity.findViewById(R.id.home); } if (view != null) { - view.setPadding((int)(density * 6), 0, (int)(density * 6), 0); + view.setPadding(Utilities.dp(6), 0, Utilities.dp(6), 0); } actionBar.setHomeButtonEnabled(false); actionBar.setDisplayShowTitleEnabled(true); @@ -752,7 +750,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter } View v = view.findViewById(R.id.settings_row_divider); v.setVisibility(View.VISIBLE); - view.setPadding((int)(11 * density), 0, (int)(11 * density), 0); + view.setPadding(Utilities.dp(11), 0, Utilities.dp(11), 0); } MessagesListSearchRowHolder holder = (MessagesListSearchRowHolder)view.getTag(); if (holder == null) { @@ -781,7 +779,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter } else { holder.nameTextView.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_lock_green, 0); } - holder.nameTextView.setCompoundDrawablePadding((int)(4 * density)); + holder.nameTextView.setCompoundDrawablePadding(Utilities.dp(4)); } else { holder.nameTextView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); holder.nameTextView.setCompoundDrawablePadding(0); @@ -972,7 +970,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter } else { nameTextView.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_lock_green, 0); } - nameTextView.setCompoundDrawablePadding((int)(4 * density)); + nameTextView.setCompoundDrawablePadding(Utilities.dp(4)); } else { Log.e("test", "tda"); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsChangeNameActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsChangeNameActivity.java index e603c122d..590cdfeef 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsChangeNameActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsChangeNameActivity.java @@ -75,7 +75,7 @@ public class SettingsChangeNameActivity extends BaseFragment { doneButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - if (firstNameField.getText().length() != 0 && lastNameField.getText().length() != 0) { + if (firstNameField.getText().length() != 0) { saveName(); finishFragment(); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java index d719b5739..9e34e3a53 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java @@ -52,7 +52,6 @@ import java.util.HashMap; public class SettingsWallpapersActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate { private HorizontalListView listView; private ListAdapter listAdapter; - private float density; private ImageView backgroundImage; private ProgressBar progressBar; private int selectedBackground; @@ -95,7 +94,6 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica if (fragmentView == null) { fragmentView = inflater.inflate(R.layout.settings_wallpapers_layout, container, false); listAdapter = new ListAdapter(parentActivity); - density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; progressBar = (ProgressBar)fragmentView.findViewById(R.id.action_progress); backgroundImage = (ImageView)fragmentView.findViewById(R.id.background_image); @@ -152,7 +150,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica boolean done; TLRPC.WallPaper wallPaper = wallpappersByIds.get(selectedBackground); if (wallPaper != null && wallPaper.id != 1000001 && wallPaper instanceof TLRPC.TL_wallPaper) { - TLRPC.PhotoSize size = PhotoObject.getClosestPhotoSizeWithSize(wallPaper.sizes, (int) (320 * density), (int) (480 * density)); + TLRPC.PhotoSize size = PhotoObject.getClosestPhotoSizeWithSize(wallPaper.sizes, Utilities.dp(320), Utilities.dp(480)); String fileName = size.location.volume_id + "_" + size.location.local_id + ".jpg"; File f = new File(Utilities.getCacheDir(), fileName); File toFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "wallpaper.jpg"); @@ -195,7 +193,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica if (requestCode == 0) { Utilities.addMediaToGallery(currentPicturePath); try { - Bitmap bitmap = FileLoader.loadBitmap(currentPicturePath, (int)(320 * density), (int)(480 * density)); + Bitmap bitmap = FileLoader.loadBitmap(currentPicturePath, Utilities.dp(320), Utilities.dp(480)); File toFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "wallpaper.jpg"); FileOutputStream stream = new FileOutputStream(toFile); bitmap.compress(Bitmap.CompressFormat.JPEG, 87, stream); @@ -220,7 +218,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica } cursor.close(); - Bitmap bitmap = FileLoader.loadBitmap(imageFilePath, (int)(320 * density), (int)(480 * density)); + Bitmap bitmap = FileLoader.loadBitmap(imageFilePath, Utilities.dp(320), Utilities.dp(480)); File toFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "wallpaper.jpg"); FileOutputStream stream = new FileOutputStream(toFile); bitmap.compress(Bitmap.CompressFormat.JPEG, 87, stream); @@ -237,7 +235,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica private void processSelectedBackground() { TLRPC.WallPaper wallPaper = wallpappersByIds.get(selectedBackground); if (selectedBackground != -1 && selectedBackground != 1000001 && wallPaper != null && wallPaper instanceof TLRPC.TL_wallPaper) { - TLRPC.PhotoSize size = PhotoObject.getClosestPhotoSizeWithSize(wallPaper.sizes, (int)(320 * density), (int)(480 * density)); + TLRPC.PhotoSize size = PhotoObject.getClosestPhotoSizeWithSize(wallPaper.sizes, Utilities.dp(320), Utilities.dp(480)); String fileName = size.location.volume_id + "_" + size.location.local_id + ".jpg"; File f = new File(Utilities.getCacheDir(), fileName); if (!f.exists()) { @@ -509,7 +507,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica BackupImageView image = (BackupImageView)view.findViewById(R.id.image); View selection = view.findViewById(R.id.selection); TLRPC.WallPaper wallPaper = wallPapers.get(i - 1); - TLRPC.PhotoSize size = PhotoObject.getClosestPhotoSizeWithSize(wallPaper.sizes, (int)(100 * density), (int)(100 * density)); + TLRPC.PhotoSize size = PhotoObject.getClosestPhotoSizeWithSize(wallPaper.sizes, Utilities.dp(100), Utilities.dp(100)); image.setImage(size.location, "100_100", 0); if (wallPaper.id == selectedBackground) { selection.setVisibility(View.VISIBLE); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java index 45c0266f4..84ad77958 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java @@ -345,7 +345,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen if (title != null) { if (dialog_id != 0) { title.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_white, 0, 0, 0); - title.setCompoundDrawablePadding((int)(4 * getResources().getDisplayMetrics().density)); + title.setCompoundDrawablePadding(Utilities.dp(4)); } else { title.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); title.setCompoundDrawablePadding(0); @@ -392,7 +392,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen } if (title != null) { title.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_lock_white, 0, 0, 0); - title.setCompoundDrawablePadding((int)(4 * ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density)); + title.setCompoundDrawablePadding(Utilities.dp(4)); } } return false; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/MessageActionLayout.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/MessageActionLayout.java index 17b5324af..d0e2e1367 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/MessageActionLayout.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/MessageActionLayout.java @@ -11,10 +11,10 @@ package org.telegram.ui.Views; import android.widget.FrameLayout; import org.telegram.messenger.R; +import org.telegram.messenger.Utilities; public class MessageActionLayout extends FrameLayout { public TightTextView messageTextView; - public float density = 1; public MessageActionLayout(android.content.Context context) { super(context); @@ -31,7 +31,7 @@ public class MessageActionLayout extends FrameLayout { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); - setMeasuredDimension(messageTextView.linesMaxWidth + (int)(14 * density), getMeasuredHeight()); + setMeasuredDimension(messageTextView.linesMaxWidth + Utilities.dp(14), getMeasuredHeight()); } @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/MessageLayout.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/MessageLayout.java index 9b2269dc6..c2764d099 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/MessageLayout.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/MessageLayout.java @@ -12,12 +12,12 @@ import android.view.View; import android.widget.TextView; import org.telegram.messenger.R; +import org.telegram.messenger.Utilities; public class MessageLayout extends FrameLayoutFixed { public TextView timeTextView; public View timeLayout; public TightTextView messageTextView; - public float density = 1; public int maxWidth; public MessageLayout(android.content.Context context) { @@ -38,18 +38,17 @@ public class MessageLayout extends FrameLayoutFixed { int timeWidth = timeLayout != null ? timeLayout.getMeasuredWidth() : timeTextView.getMeasuredWidth(); int totalWidth = getMeasuredWidth(); - int maxChildWidth = getChildAt(0).getMeasuredWidth(); int count = getChildCount(); for (int a = 1; a < count - 1; a++) { maxChildWidth = Math.max(maxChildWidth, getChildAt(a).getMeasuredWidth()); } - int timeMore = (int)(timeWidth + 6 * density); + int timeMore = timeWidth + Utilities.dp(6); int fields = totalWidth - Math.max(maxChildWidth, timeWidth); int height = getMeasuredHeight(); if (maxWidth - messageTextView.lastLineWidth < timeMore) { - setMeasuredDimension(Math.max(maxChildWidth, messageTextView.lastLineWidth) + fields, (int)(height + 14 * density)); + setMeasuredDimension(Math.max(maxChildWidth, messageTextView.lastLineWidth) + fields, height + Utilities.dp(14)); } else { int diff = maxChildWidth - messageTextView.lastLineWidth; if (diff >= 0 && diff <= timeMore) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/NotificationView.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/NotificationView.java index 27bf81e24..a73eb234a 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/NotificationView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/NotificationView.java @@ -289,7 +289,7 @@ public class NotificationView extends LinearLayout { } } - public void applyOrientationPaddings(boolean isLandscape, float density, int height) { + public void applyOrientationPaddings(boolean isLandscape, int height) { FrameLayout.LayoutParams params = (FrameLayout.LayoutParams)avatarImage.getLayoutParams(); params.width = height; params.height = height; @@ -298,22 +298,22 @@ public class NotificationView extends LinearLayout { if (isLandscape) { nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14); messageTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14); - nameTextView.setPadding(0, (int)(2 * density), 0, 0); - messageTextView.setPadding(0, (int)(18 * density), 0, 0); + nameTextView.setPadding(0, Utilities.dp(2), 0, 0); + messageTextView.setPadding(0, Utilities.dp(18), 0, 0); if (isRTL) { - params1.setMargins((int)(40 * density), 0, (int)(height + 6 * density), 0); + params1.setMargins(Utilities.dp(40), 0, height + Utilities.dp(6), 0); } else { - params1.setMargins((int)(height + 6 * density), 0, (int)(40 * density), 0); + params1.setMargins(height + Utilities.dp(6), 0, Utilities.dp(40), 0); } } else { nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15); messageTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15); - nameTextView.setPadding(0, (int)(4 * density), 0, 0); - messageTextView.setPadding(0, (int) (24 * density), 0, 0); + nameTextView.setPadding(0, Utilities.dp(4), 0, 0); + messageTextView.setPadding(0, Utilities.dp(24), 0, 0); if (isRTL) { - params1.setMargins((int)(40 * density), 0, (int)(height + 8 * density), 0); + params1.setMargins(Utilities.dp(40), 0, height + Utilities.dp(8), 0); } else { - params1.setMargins((int)(height + 8 * density), 0, (int)(40 * density), 0); + params1.setMargins(height + Utilities.dp(8), 0, Utilities.dp(40), 0); } } textLayout.setLayoutParams(params1); diff --git a/TMessagesProj/src/main/res/drawable-hdpi/map_dot.png b/TMessagesProj/src/main/res/drawable-hdpi/map_dot.png deleted file mode 100644 index ebd51f62fc1caad9fe7c38e6d742295cce2350c8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2065 zcmbVNdsGu=77ve#z@jLeRdAObf><%;F?m5Ekw*d;B;hGUR?(0QBtkMF8OTEskctJ} z0)--!?NafvAeOd(f&xMcTa+RQ6>xb;;ZUGh@Np=c4b`2fxci5vf9!Y8%=g`I?(g2; zeVxe-;|JN7zWLM4Rp6T|Tkz?BIT zp$JGQ)~4KryfGLHl{89#2zVh(5iBDJO*#aPOo5^?7;hhqLMTdt5Fj2(l*(DyrRFv) zAQiK)F*F{Dr(i=8={}tjiq!F=M7ksqLyYy=3wUdor~w&-2my^OS*~JgSlCx~ndsSc zO~eAPRFEVV_BAO1FAQMAN(i74Xm}9`qynA{0!Ra?Uf^zkOaduH5`_p-@F1B2(U7d2r?K9B8f~SlkunqUZs^ILJeN7 za$B>&fm9-;RDnogIbgCVjE7SZ78YgtIs}=5$9rp7u6mOwG-X7MP(cIyhBL21axD+m1|%C>v&|Qi>Kun9PAisWM28a5*e2 z`h_5tikTF2L3BDDPZCjScxr-}g7*@VMR<{r=0zui;&?HIv1aF8coN0Si_D-=1IZvA z1Ov!^WIwt;C(xfxCxNICxQ6A*Rfte7g4TRXQQvQ{l;6ZM*-A)=z{)5XPG0MRFbRyn zDhaFr*lb`YPbiYgO|plnMz2HWKuT#EBo0)E`nbLO->)ifHPT|LL5yE3_R=$G3BU3U4O~lB46JMCXJ{ ze>{P~SW>whzbMT}=lMQ(TYzKNqu#}Y*7DA{=9EA5TOKI5Z<8gNf6w3kl;Xk}8~dqm zoUC&lu6|(u(r=K>xbHG|^ZnrJs7c>HyDnQzor&1+g+zKb%JE}*-7467GAr(F-TJ$!pH3Qf?*o6MaJwf!OaL1n{ZWa-%wr7sEf5(#) z*PPGu%s8>MRC6T8{jWbM(pBzZHHyi>o`?E>!d5|bl+HfiGUu=kj9m{fNxslPKY#4$ z!4Iti)|qeG)Wr#X$Tn;l8Jvm{8eA7=zqVP_b<2)Edt%kqS~zwgnrSyv>Q{6&s6joO zSy%oq`wyG0SKITl&YtUP{idk7Tx0JpudET{1dBZVyV;Kd3@zdM2Dd=Z6wU|C z5{Iw6Z*Otdzxd&4_0s;v3~kkyw1J@;7JS3SpmT-S!aHzrb@=V;K>F12&%4=~%DvB? zIaJv2s>fM5`!+s*_`F^#9{qCgkBx5aF0MHDC$|>NhINM}!K4BGc$l%sD$a74#=d<8 z+2#>`0!RPs{?w=6+ceom<`+PhTReL5?Gi@&y8PLalzZH=Yqz{v53o2dOH5kkXg`3< zug+MG@t4i#W{2lFjo#e#puckaP~~X-x1ZtULyP5Gmkt@GWBnsD+H4NBXl1?f#ykA1 z(1z43*CC~#lnzBTlDxZ!HFeFV}%P9 zXYFd|)cRv)TP&uGTS8wt)2_}AEYAexh6)#*fOqWqvinXqiklWJ z;vNSd(u5g_VO^vK_>TIpdb9asHy!UiVrY%uO$TX9Yc^lijUE^sGSnVB2~pd37pz!@44JPWKwU9IX?}OS zB&XP+@bQqqd}P4iy;HET*O*ooocHti&zp})KgsESD#!{7))=pxtl8+;&{2De_eFP= zgM0Va`tIi2hkuN9p?LIA^Fz?fN{-WhV`@pcY_4cyl-38e$w0kKBw0I=&AnzX3kO` diff --git a/TMessagesProj/src/main/res/drawable-ldpi/map_dot.png b/TMessagesProj/src/main/res/drawable-ldpi/map_dot.png deleted file mode 100644 index 3985b865e4dc0af9fa3a595d4acb5ea0a310ac58..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal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AzUH#3we#n`uLepx mPpERJ$A#8>4{Z1=p1@GcwcED7bHNi($?ECq=d#Wzp$Py!fFHB~ diff --git a/TMessagesProj/src/main/res/drawable-mdpi/map_dot.png b/TMessagesProj/src/main/res/drawable-mdpi/map_dot.png deleted file mode 100644 index 5de26ec547dcf30d1e9a04f0ba1f42f8af893fa1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1658 zcmbVLc~BEq7>`orm{OEdi5K08B2h?oH^~NeON@}C1PDe*6}4J6n++t8Y}hPKNMXcd z7`b#hR$E0{rnQQQXgjsm@c_jsf>;%)gIGXm z5?#vsfdSJ3I2=x(CPA6X?jhdKZzB7zD47|^Zc`amI+I437$;7XoH!$8AOVdP&m>bx z+?b!+LdJ49J`S@!ok`awV+3Ut;$DoW$C*0WtYUIi11F*j^3J^iC7=*+iEEd2b3_>v&0bVQ~YmGLV zuvDe`g)LT+@v<1kj)9=l=@dG}LW<4=VH8C{NCb*R0u~`~mB+|a|=Yh_4~d$8ulid(;~S}`>2#?*5)?P;C{T{*w7 zb7)+3qr_YnbYpFP`;+J!<7$Dz{!?397+WuC`XYi)91@;+D0j`wJT!Q7_{?x~(sbx# zc+Ak2)>*#LZ;jj0gZ9?M4ZYl{3oE!K{PO;8%~iTjx_rm6rPi1OXOiySUD@EGW-LA?RGz(AgfCLOtMLj78S%5h4x^7{|s+e1X_-tF8gV*h@TdAqGNAo?&VVE=-?ZV zi6*q8dhx-pn?o|V!JW7C7ieuQ<$r7Snkg4=Z`s(Q5Axw(HTZ4IS+TdM^64EeS=)HM zpn{$+nRMV-b6Gz(jo0nG)0McRJ8ateWj(d>MNP$XZ=P&u_;6`?v_-q;_owd^PwTK9 zaWTs${ET#U(k=RfOuG&sh_wL2cj1B8bfzO*deAfOEJ}~srnP(nlmC8Uu+E}evE7=knzo{Eri0|8Pjsqbi3ykIo+)k%481 zC}0e4#Rf4LvLPUpy&;ZG=Ab-1kZw`{R=@`#CQ{0e7f1l9JL;=m0A8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N&Lj zLduG$kjRweE5{oL8J&%l3n}d%1^S*qxJVeo8zoZQy{G z$k+Q|5Y{C#^3%t(SJY!7@AmuctNiJ%1B9|qCaJz^lLbAo z5y#PmZHLybk1?~nXuPPuc?0&`^j%!3KmXLQZpXdu4#P~%&M^;rqiqo@QhTfqPh4jt zz4`E}Ix^X1tTrkE{(z{RD_5jzWT9OtwI&4J`sWL>7mgOqH@_VX9B@apE|{CE%PpSF zR~xsj&cirv1(qrPf%RqA}cdR2~_dIR@aT4!-*MUKzhtLe*3E1H5eYfhIwniEmMY1>m;nqC=0 z1tMK&38vQvH)qt}7S{PjR5S=I`~r~QRb>pvt}!ZX_VJrrbHhyZ>wl)- wRQhH$z93x-I#cwAovn_55Z-mE?~A$t!U8jIMcm%&DXO0&x^DpWq)$}p-^lF+9{>OV diff --git a/TMessagesProj/src/main/res/drawable-xxhdpi/map_dot.png b/TMessagesProj/src/main/res/drawable-xxhdpi/map_dot.png deleted file mode 100644 index 1e64ada1dd88452c88666ad9fe3f76c97f3e1dec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3466 zcmbVPc{r5&9=FS0PS#XooTM^lGt5kleHY1|En^ll#w=z=h6p)0k|leF z3Pr`(W$9+gy|xY^5qH$--22CQ?jQGkp7;IzzQ6bT`F!{HdEP4y_Lee|s*(Z%0y5TC zW{&*z)b71UjQ>P$4Kw+R3ftVB?L;TCL$FMOfH9u#M*vt;vHk={0u~<{^n$=g2(!q} z?re9v(`X!>s)OCt(cw@Td^DfTki)>@C>zdwQv!)> z6~-huh1omf!YDWt9%yI)IK@Hp38(}%7Qmqf(pYE?2KbE^&EM}HgMol=Dr^b{_}wXY zI|qO%ok;*7bPymM1gZJzCZ33P zG_&~A7GJ^uNo+O)4F-pVgy@98b?8igFcgJCfgvz33SOT@!LNGuEo!eJ3eJs1@4hlitn@cbPf0!JcYCh%SZpi}NBCiz%(wj=t84K;v1n5!0n4T{o$2(zA6?); zqO<8N5}g4sH3ewdVR2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