New documents design, bug fixes

This commit is contained in:
DrKLO 2014-08-30 00:06:04 +03:00
parent 8bad655966
commit 16150fe751
58 changed files with 439 additions and 1306 deletions

View File

@ -80,7 +80,7 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 8 minSdkVersion 8
targetSdkVersion 19 targetSdkVersion 19
versionCode 312 versionCode 315
versionName "1.8.0" versionName "1.8.0"
} }
} }

View File

@ -278,10 +278,7 @@ public class ImageLoader {
} }
} }
} catch (Exception e) { } catch (Exception e) {
if (canDeleteFile && cacheFileFinal != null && cacheFileFinal.length() == 0) { //don't promt
cacheFileFinal.delete();
}
FileLog.e("tmessages", e);
} }
return image != null ? new BitmapDrawable(image) : null; return image != null ? new BitmapDrawable(image) : null;
} }
@ -641,7 +638,8 @@ public class ImageLoader {
if (filter != null) { if (filter != null) {
key += "@" + filter; key += "@" + filter;
} }
if (imageReceiver != null) { BitmapDrawable bitmapDrawable = memCache.get(key);
if (bitmapDrawable != null && imageReceiver != null) {
Integer TAG = imageReceiver.getTag(); Integer TAG = imageReceiver.getTag();
if (TAG != null) { if (TAG != null) {
CacheImage alreadyLoadingImage = imageLoadingByTag.get(TAG); CacheImage alreadyLoadingImage = imageLoadingByTag.get(TAG);
@ -650,7 +648,7 @@ public class ImageLoader {
} }
} }
} }
return memCache.get(key); return bitmapDrawable;
} }
public void replaceImageInCache(final String oldKey, final String newKey) { public void replaceImageInCache(final String oldKey, final String newKey) {
@ -744,7 +742,8 @@ public class ImageLoader {
} }
img.addImageView(imageView); img.addImageView(imageView);
imageLoadingByKeys.put(key, img); imageLoadingByKeys.put(key, img);
cacheOutTasks.add(new CacheOutTask(img)); img.cacheTask = new CacheOutTask(img);
cacheOutTasks.add(img.cacheTask);
runCacheTasks(false); runCacheTasks(false);
} else { } else {
img.url = url; img.url = url;

View File

@ -33,7 +33,6 @@ public class ImageReceiver {
private int imageX = 0, imageY = 0, imageW = 0, imageH = 0; private int imageX = 0, imageY = 0, imageW = 0, imageH = 0;
private Rect drawRegion = new Rect(); private Rect drawRegion = new Rect();
private boolean isVisible = true; private boolean isVisible = true;
private boolean selfSetting = false;
private boolean isAspectFit = false; private boolean isAspectFit = false;
public ImageReceiver() { public ImageReceiver() {
@ -106,12 +105,7 @@ public class ImageReceiver {
isPlaceholder = true; isPlaceholder = true;
ImageLoader.getInstance().loadImage(fileLocation, httpUrl, this, size); ImageLoader.getInstance().loadImage(fileLocation, httpUrl, this, size);
} else { } else {
selfSetting = true;
setImageBitmap(img, currentPath); setImageBitmap(img, currentPath);
selfSetting = false;
}
if (parentView != null) {
parentView.invalidate();
} }
} }
@ -122,7 +116,7 @@ public class ImageReceiver {
isPlaceholder = false; isPlaceholder = false;
ImageLoader.getInstance().incrementUseCount(currentPath); ImageLoader.getInstance().incrementUseCount(currentPath);
currentImage = bitmap; currentImage = bitmap;
if (!selfSetting && parentView != null) { if (parentView != null) {
parentView.invalidate(); parentView.invalidate();
} }
} }
@ -193,7 +187,7 @@ public class ImageReceiver {
} }
} }
public void draw(Canvas canvas, int x, int y, int w, int h) { public boolean draw(Canvas canvas, int x, int y, int w, int h) {
try { try {
Drawable bitmapDrawable = currentImage; Drawable bitmapDrawable = currentImage;
if (bitmapDrawable == null && last_placeholder != null && last_placeholder instanceof BitmapDrawable) { if (bitmapDrawable == null && last_placeholder != null && last_placeholder instanceof BitmapDrawable) {
@ -240,12 +234,14 @@ public class ImageReceiver {
} }
} }
} }
return true;
} else if (last_placeholder != null) { } else if (last_placeholder != null) {
drawRegion.set(x, y, x + w, y + h); drawRegion.set(x, y, x + w, y + h);
last_placeholder.setBounds(drawRegion); last_placeholder.setBounds(drawRegion);
if (isVisible) { if (isVisible) {
last_placeholder.draw(canvas); last_placeholder.draw(canvas);
} }
return true;
} }
} catch (Exception e) { } catch (Exception e) {
if (currentPath != null) { if (currentPath != null) {
@ -255,6 +251,7 @@ public class ImageReceiver {
setImage(last_path, last_httpUrl, last_filter, last_placeholder, last_size); setImage(last_path, last_httpUrl, last_filter, last_placeholder, last_size);
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
} }
return false;
} }
public Bitmap getBitmap() { public Bitmap getBitmap() {

View File

@ -279,24 +279,20 @@ public class MessageObject {
type = 3; type = 3;
} else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaContact) { } else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaContact) {
if (isFromMe()) { if (isFromMe()) {
contentType = 4; contentType = 3;
type = 12; type = 12;
} else { } else {
contentType = 5; contentType = 4;
type = 13; type = 13;
} }
} else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaUnsupported) { } else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaUnsupported) {
contentType = type = 0; contentType = type = 0;
} else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaDocument) { } else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaDocument) {
if (message.media.document.thumb != null && !(message.media.document.thumb instanceof TLRPC.TL_photoSizeEmpty) && message.media.document.mime_type != null && message.media.document.mime_type.equals("image/gif")) {
contentType = 1; contentType = 1;
if (message.media.document.thumb != null && !(message.media.document.thumb instanceof TLRPC.TL_photoSizeEmpty) && message.media.document.mime_type != null && message.media.document.mime_type.equals("image/gif")) {
type = 8; type = 8;
} else { } else {
if (isFromMe()) { type = 9;
contentType = type = 8;
} else {
contentType = type = 9;
}
} }
} else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaAudio) { } else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaAudio) {
contentType = type = 2; contentType = type = 2;
@ -305,9 +301,11 @@ public class MessageObject {
if (message.action instanceof TLRPC.TL_messageActionLoginUnknownLocation) { if (message.action instanceof TLRPC.TL_messageActionLoginUnknownLocation) {
contentType = type = 0; contentType = type = 0;
} else if (message.action instanceof TLRPC.TL_messageActionChatEditPhoto || message.action instanceof TLRPC.TL_messageActionUserUpdatedPhoto) { } else if (message.action instanceof TLRPC.TL_messageActionChatEditPhoto || message.action instanceof TLRPC.TL_messageActionUserUpdatedPhoto) {
contentType = type = 11; contentType = 8;
type = 11;
} else { } else {
contentType = type = 10; contentType = 7;
type = 10;
} }
} else if (message instanceof TLRPC.TL_messageForwarded) { } else if (message instanceof TLRPC.TL_messageForwarded) {
contentType = type = 0; contentType = type = 0;
@ -417,7 +415,7 @@ public class MessageObject {
} }
private void generateLayout() { private void generateLayout() {
if (type != 0 && type != 1 && type != 8 && type != 9 || messageOwner.to_id == null || messageText == null || messageText.length() == 0) { if (type != 0 || messageOwner.to_id == null || messageText == null || messageText.length() == 0) {
return; return;
} }

View File

@ -170,6 +170,15 @@ public class MessagesController implements NotificationCenter.NotificationCenter
user.status = null; user.status = null;
user.photo = new TLRPC.TL_userProfilePhotoEmpty(); user.photo = new TLRPC.TL_userProfilePhotoEmpty();
putUser(user, true); putUser(user, true);
user = new TLRPC.TL_userForeign();
user.phone = "42777";
user.id = 777000;
user.first_name = "Telegram";
user.last_name = "Notifications";
user.status = null;
user.photo = new TLRPC.TL_userProfilePhotoEmpty();
putUser(user, true);
} }
public static TLRPC.InputUser getInputUser(TLRPC.User user) { public static TLRPC.InputUser getInputUser(TLRPC.User user) {
@ -2991,11 +3000,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter
UserConfig.saveConfig(false); UserConfig.saveConfig(false);
newMessage.unread = true; newMessage.unread = true;
newMessage.date = update.date; newMessage.date = update.date;
newMessage.from_id = 333000; newMessage.from_id = 777000;
newMessage.to_id = new TLRPC.TL_peerUser(); newMessage.to_id = new TLRPC.TL_peerUser();
newMessage.to_id.user_id = UserConfig.getClientUserId(); newMessage.to_id.user_id = UserConfig.getClientUserId();
newMessage.out = false; newMessage.out = false;
newMessage.dialog_id = 333000; newMessage.dialog_id = 777000;
messagesArr.add(newMessage); messagesArr.add(newMessage);
MessageObject obj = new MessageObject(newMessage, usersDict); MessageObject obj = new MessageObject(newMessage, usersDict);

View File

@ -31,6 +31,7 @@ import org.telegram.ui.ApplicationLoader;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
@ -170,7 +171,7 @@ public class MessagesStorage {
} catch (Exception e) { } catch (Exception e) {
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
} }
loadUnreadMessages(false); loadUnreadMessages();
} }
public void updateDbToVersion3() { public void updateDbToVersion3() {
@ -352,7 +353,7 @@ public class MessagesStorage {
}); });
} }
public void loadUnreadMessages(final boolean onlyCount) { public void loadUnreadMessages() {
storageQueue.postRunnable(new Runnable() { storageQueue.postRunnable(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -364,20 +365,18 @@ public class MessagesStorage {
long did = cursor.longValue(0); long did = cursor.longValue(0);
int count = cursor.intValue(1); int count = cursor.intValue(1);
pushDialogs.put(did, count); pushDialogs.put(did, count);
if (!onlyCount) {
if (ids.length() != 0) { if (ids.length() != 0) {
ids += ","; ids += ",";
} }
ids += did; ids += did;
} }
}
cursor.dispose(); cursor.dispose();
final ArrayList<TLRPC.Message> messages = onlyCount ? null : new ArrayList<TLRPC.Message>(); final ArrayList<TLRPC.Message> messages = new ArrayList<TLRPC.Message>();
final ArrayList<TLRPC.User> users = onlyCount ? null : new ArrayList<TLRPC.User>(); final ArrayList<TLRPC.User> users = new ArrayList<TLRPC.User>();
final ArrayList<TLRPC.Chat> chats = onlyCount ? null : new ArrayList<TLRPC.Chat>(); final ArrayList<TLRPC.Chat> chats = new ArrayList<TLRPC.Chat>();
final ArrayList<TLRPC.EncryptedChat> encryptedChats = onlyCount ? null : new ArrayList<TLRPC.EncryptedChat>(); final ArrayList<TLRPC.EncryptedChat> encryptedChats = new ArrayList<TLRPC.EncryptedChat>();
if (messages != null && ids.length() > 0) { if (ids.length() > 0) {
ArrayList<Integer> userIds = new ArrayList<Integer>(); ArrayList<Integer> userIds = new ArrayList<Integer>();
ArrayList<Integer> chatIds = new ArrayList<Integer>(); ArrayList<Integer> chatIds = new ArrayList<Integer>();
ArrayList<Integer> encryptedChatIds = new ArrayList<Integer>(); ArrayList<Integer> encryptedChatIds = new ArrayList<Integer>();
@ -510,7 +509,7 @@ public class MessagesStorage {
cursor.dispose(); cursor.dispose();
} }
} }
Collections.reverse(messages);
AndroidUtilities.RunOnUIThread(new Runnable() { AndroidUtilities.RunOnUIThread(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -3595,7 +3594,7 @@ public class MessagesStorage {
database.commitTransaction(); database.commitTransaction();
loadUnreadMessages(true); loadUnreadMessages();
} catch (Exception e) { } catch (Exception e) {
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
} }

View File

@ -373,6 +373,7 @@ public class NotificationsController {
.setContentTitle(name) .setContentTitle(name)
.setSmallIcon(R.drawable.notification) .setSmallIcon(R.drawable.notification)
.setAutoCancel(true) .setAutoCancel(true)
.setNumber(total_unread_count)
.setContentIntent(contentIntent); .setContentIntent(contentIntent);
String lastMessage = null; String lastMessage = null;
@ -577,6 +578,7 @@ public class NotificationsController {
} }
pushMessagesDict.put(messageObject.messageOwner.id, messageObject); pushMessagesDict.put(messageObject.messageOwner.id, messageObject);
pushMessages.add(0, messageObject); pushMessages.add(0, messageObject);
FileLog.e("tmessages", "processNewMessages add dialog = " + dialog_id);
} }
} }
@ -607,6 +609,7 @@ public class NotificationsController {
Integer currentCount = pushDialogs.get(dialog_id); Integer currentCount = pushDialogs.get(dialog_id);
Integer newCount = entry.getValue(); Integer newCount = entry.getValue();
FileLog.e("tmessages", "processDialogsUpdateRead dialog = " + dialog_id + " newCount = " + newCount + " oldCount = " + currentCount);
if (newCount < 0) { if (newCount < 0) {
if (currentCount == null) { if (currentCount == null) {
continue; continue;
@ -646,6 +649,17 @@ public class NotificationsController {
MessagesController.getInstance().putChats(chats, true); MessagesController.getInstance().putChats(chats, true);
MessagesController.getInstance().putEncryptedChats(encryptedChats, true); MessagesController.getInstance().putEncryptedChats(encryptedChats, true);
pushDialogs.clear();
pushMessages.clear();
pushMessagesDict.clear();
total_unread_count = 0;
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Context.MODE_PRIVATE);
for (HashMap.Entry<Long, Integer> entry : dialogs.entrySet()) {
pushDialogs.put(entry.getKey(), entry.getValue());
total_unread_count += entry.getValue();
FileLog.e("tmessages", "processLoadedUnreadMessages dialog = " + entry.getKey() + " count = " + entry.getValue());
}
FileLog.e("tmessages", "processLoadedUnreadMessages total = " + total_unread_count + " messages = " + messages.size());
if (messages != null) { if (messages != null) {
for (TLRPC.Message message : messages) { for (TLRPC.Message message : messages) {
if (pushMessagesDict.containsKey(message.id)) { if (pushMessagesDict.containsKey(message.id)) {
@ -660,21 +674,12 @@ public class NotificationsController {
pushMessages.add(0, messageObject); pushMessages.add(0, messageObject);
} }
} }
pushDialogs.clear();
total_unread_count = 0;
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Context.MODE_PRIVATE);
for (HashMap.Entry<Long, Integer> entry : dialogs.entrySet()) {
pushDialogs.put(entry.getKey(), entry.getValue());
total_unread_count += entry.getValue();
}
if (total_unread_count == 0) { if (total_unread_count == 0) {
pushMessages.clear();
pushMessagesDict.clear();
popupMessages.clear(); popupMessages.clear();
showOrUpdateNotification(false); showOrUpdateNotification(false);
NotificationCenter.getInstance().postNotificationName(NotificationCenter.pushMessagesUpdated); NotificationCenter.getInstance().postNotificationName(NotificationCenter.pushMessagesUpdated);
} }
if (preferences.getBoolean("badgeNumber", true)) { if (preferences.getBoolean("badgeNumber", true)) {
setBadge(ApplicationLoader.applicationContext, total_unread_count); setBadge(ApplicationLoader.applicationContext, total_unread_count);
} }

View File

@ -547,7 +547,7 @@ public class Utilities {
} }
public static int getUserAvatarForId(int id) { public static int getUserAvatarForId(int id) {
if (id / 1000 == 333) { if (id / 1000 == 333 || id / 1000 == 777) {
return R.drawable.telegram_avatar; return R.drawable.telegram_avatar;
} }
return arrUsersAvatars[getColorIndex(id)]; return arrUsersAvatars[getColorIndex(id)];

View File

@ -60,7 +60,7 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega
private String currentNameString; private String currentNameString;
public ChatAudioCell(Context context) { public ChatAudioCell(Context context) {
super(context, false); super(context);
TAG = MediaController.getInstance().generateObserverTag(); TAG = MediaController.getInstance().generateObserverTag();
avatarImage = new ImageReceiver(this); avatarImage = new ImageReceiver(this);

View File

@ -146,10 +146,9 @@ public class ChatBaseCell extends BaseCell {
} }
} }
public ChatBaseCell(Context context, boolean isMedia) { public ChatBaseCell(Context context) {
super(context); super(context);
init(); init();
media = isMedia;
avatarImage = new ImageReceiver(this); avatarImage = new ImageReceiver(this);
} }

View File

@ -16,11 +16,13 @@ import android.graphics.drawable.Drawable;
import android.text.Layout; import android.text.Layout;
import android.text.StaticLayout; import android.text.StaticLayout;
import android.text.TextPaint; import android.text.TextPaint;
import android.text.TextUtils;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.SoundEffectConstants; import android.view.SoundEffectConstants;
import org.telegram.android.AndroidUtilities; import org.telegram.android.AndroidUtilities;
import org.telegram.android.ImageLoader; import org.telegram.android.ImageLoader;
import org.telegram.android.LocaleController;
import org.telegram.messenger.FileLoader; import org.telegram.messenger.FileLoader;
import org.telegram.android.MediaController; import org.telegram.android.MediaController;
import org.telegram.messenger.R; import org.telegram.messenger.R;
@ -43,10 +45,15 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD
private static Drawable placeholderInDrawable; private static Drawable placeholderInDrawable;
private static Drawable placeholderOutDrawable; private static Drawable placeholderOutDrawable;
private static Drawable placeholderDocInDrawable;
private static Drawable placeholderDocOutDrawable;
private static Drawable videoIconDrawable; private static Drawable videoIconDrawable;
private static Drawable[] buttonStatesDrawables = new Drawable[4]; private static Drawable[] buttonStatesDrawables = new Drawable[4];
private static Drawable[][] buttonStatesDrawablesDoc = new Drawable[2][2];
private static TextPaint infoPaint; private static TextPaint infoPaint;
private static MessageObject lastDownloadedGifMessage = null; private static MessageObject lastDownloadedGifMessage = null;
private static TextPaint namePaint;
private static Paint docBackPaint;
private GifDrawable gifDrawable = null; private GifDrawable gifDrawable = null;
@ -74,23 +81,38 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD
private int infoOffset = 0; private int infoOffset = 0;
private String currentInfoString; private String currentInfoString;
private StaticLayout nameLayout;
private int nameWidth = 0;
private String currentNameString;
public ChatMediaCellDelegate mediaDelegate = null; public ChatMediaCellDelegate mediaDelegate = null;
public ChatMediaCell(Context context) { public ChatMediaCell(Context context) {
super(context, true); super(context);
if (placeholderInDrawable == null) { if (placeholderInDrawable == null) {
placeholderInDrawable = getResources().getDrawable(R.drawable.photo_placeholder_in); placeholderInDrawable = getResources().getDrawable(R.drawable.photo_placeholder_in);
placeholderOutDrawable = getResources().getDrawable(R.drawable.photo_placeholder_out); placeholderOutDrawable = getResources().getDrawable(R.drawable.photo_placeholder_out);
placeholderDocInDrawable = getResources().getDrawable(R.drawable.doc_blue);
placeholderDocOutDrawable = getResources().getDrawable(R.drawable.doc_green);
buttonStatesDrawables[0] = getResources().getDrawable(R.drawable.photoload); buttonStatesDrawables[0] = getResources().getDrawable(R.drawable.photoload);
buttonStatesDrawables[1] = getResources().getDrawable(R.drawable.photocancel); buttonStatesDrawables[1] = getResources().getDrawable(R.drawable.photocancel);
buttonStatesDrawables[2] = getResources().getDrawable(R.drawable.photogif); buttonStatesDrawables[2] = getResources().getDrawable(R.drawable.photogif);
buttonStatesDrawables[3] = getResources().getDrawable(R.drawable.playvideo); buttonStatesDrawables[3] = getResources().getDrawable(R.drawable.playvideo);
buttonStatesDrawablesDoc[0][0] = getResources().getDrawable(R.drawable.docload_b);
buttonStatesDrawablesDoc[1][0] = getResources().getDrawable(R.drawable.doccancel_b);
buttonStatesDrawablesDoc[0][1] = getResources().getDrawable(R.drawable.docload_g);
buttonStatesDrawablesDoc[1][1] = getResources().getDrawable(R.drawable.doccancel_g);
videoIconDrawable = getResources().getDrawable(R.drawable.ic_video); videoIconDrawable = getResources().getDrawable(R.drawable.ic_video);
infoPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); infoPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
infoPaint.setColor(0xffffffff);
infoPaint.setTextSize(AndroidUtilities.dp(12)); infoPaint.setTextSize(AndroidUtilities.dp(12));
namePaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
namePaint.setColor(0xff000000);
namePaint.setTextSize(AndroidUtilities.dp(16));
docBackPaint = new Paint();
} }
TAG = MediaController.getInstance().generateObserverTag(); TAG = MediaController.getInstance().generateObserverTag();
@ -135,7 +157,7 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD
buttonPressed = 1; buttonPressed = 1;
invalidate(); invalidate();
result = true; result = true;
} else if (photoImage.isInsideImage(x, y)) { } else if (x >= photoImage.getImageX() && x <= photoImage.getImageX() + backgroundWidth && y >= photoImage.getImageY() && y <= photoImage.getImageY() + photoImage.getImageHeight()) {
imagePressed = true; imagePressed = true;
result = true; result = true;
} }
@ -213,6 +235,12 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD
if (mediaDelegate != null) { if (mediaDelegate != null) {
mediaDelegate.didPressedImage(this); mediaDelegate.didPressedImage(this);
} }
} else if (currentMessageObject.type == 9) {
if (buttonState == -1) {
if (mediaDelegate != null) {
mediaDelegate.didPressedImage(this);
}
}
} }
} }
@ -225,7 +253,7 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD
} else { } else {
photoImage.setImage(currentPhotoObject.photoOwner.location, currentPhotoFilter, currentMessageObject.isOut() ? placeholderOutDrawable : placeholderInDrawable, currentPhotoObject.photoOwner.size); photoImage.setImage(currentPhotoObject.photoOwner.location, currentPhotoFilter, currentMessageObject.isOut() ? placeholderOutDrawable : placeholderInDrawable, currentPhotoObject.photoOwner.size);
} }
} else if (currentMessageObject.type == 8) { } else if (currentMessageObject.type == 8 || currentMessageObject.type == 9) {
FileLoader.getInstance().loadFile(currentMessageObject.messageOwner.media.document); FileLoader.getInstance().loadFile(currentMessageObject.messageOwner.media.document);
lastDownloadedGifMessage = currentMessageObject; lastDownloadedGifMessage = currentMessageObject;
} else if (currentMessageObject.type == 3) { } else if (currentMessageObject.type == 3) {
@ -243,7 +271,7 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD
cancelLoading = true; cancelLoading = true;
if (currentMessageObject.type == 1) { if (currentMessageObject.type == 1) {
ImageLoader.getInstance().cancelLoadingForImageView(photoImage); ImageLoader.getInstance().cancelLoadingForImageView(photoImage);
} else if (currentMessageObject.type == 8) { } else if (currentMessageObject.type == 8 || currentMessageObject.type == 9) {
FileLoader.getInstance().cancelLoadFile(currentMessageObject.messageOwner.media.document); FileLoader.getInstance().cancelLoadFile(currentMessageObject.messageOwner.media.document);
if (lastDownloadedGifMessage != null && lastDownloadedGifMessage.messageOwner.id == currentMessageObject.messageOwner.id) { if (lastDownloadedGifMessage != null && lastDownloadedGifMessage.messageOwner.id == currentMessageObject.messageOwner.id) {
lastDownloadedGifMessage = null; lastDownloadedGifMessage = null;
@ -297,6 +325,7 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD
@Override @Override
public void setMessageObject(MessageObject messageObject) { public void setMessageObject(MessageObject messageObject) {
media = messageObject.type != 9;
if (currentMessageObject != messageObject || isPhotoDataChanged(messageObject) || isUserDataChanged()) { if (currentMessageObject != messageObject || isPhotoDataChanged(messageObject) || isUserDataChanged()) {
super.setMessageObject(messageObject); super.setMessageObject(messageObject);
cancelLoading = false; cancelLoading = false;
@ -308,7 +337,41 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD
currentUrl = null; currentUrl = null;
photoNotSet = false; photoNotSet = false;
if (messageObject.type == 8) { if (messageObject.type == 9) {
String name = messageObject.messageOwner.media.document.file_name;
if (name == null || name.length() == 0) {
name = LocaleController.getString("AttachDocument", R.string.AttachDocument);
}
int maxWidth = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) - AndroidUtilities.dp(122 + 86 + 24);
if (currentNameString == null || !currentNameString.equals(name)) {
currentNameString = name;
nameWidth = (int) Math.ceil(namePaint.measureText(currentNameString));
nameWidth = Math.min(maxWidth, (int) Math.ceil(namePaint.measureText(currentNameString)));
CharSequence str = TextUtils.ellipsize(currentNameString, namePaint, nameWidth, TextUtils.TruncateAt.END);
nameLayout = new StaticLayout(str, namePaint, nameWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
}
String fileName = messageObject.getFileName();
int idx = fileName.lastIndexOf(".");
String ext = null;
if (idx != -1) {
ext = fileName.substring(idx + 1);
}
if (ext == null || ext.length() == 0) {
ext = messageObject.messageOwner.media.document.mime_type;
}
ext = ext.toUpperCase();
String str = Utilities.formatFileSize(messageObject.messageOwner.media.document.size) + " " + ext;
if (currentInfoString == null || !currentInfoString.equals(str)) {
currentInfoString = str;
infoOffset = 0;
infoWidth = Math.min(maxWidth, (int) Math.ceil(infoPaint.measureText(currentInfoString)));
CharSequence str2 = TextUtils.ellipsize(currentInfoString, infoPaint, infoWidth, TextUtils.TruncateAt.END);
infoLayout = new StaticLayout(str2, infoPaint, infoWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
}
} else if (messageObject.type == 8) {
gifDrawable = MediaController.getInstance().getGifDrawable(this, false); gifDrawable = MediaController.getInstance().getGifDrawable(this, false);
String str = Utilities.formatFileSize(messageObject.messageOwner.media.document.size); String str = Utilities.formatFileSize(messageObject.messageOwner.media.document.size);
@ -318,6 +381,8 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD
infoWidth = (int) Math.ceil(infoPaint.measureText(currentInfoString)); infoWidth = (int) Math.ceil(infoPaint.measureText(currentInfoString));
infoLayout = new StaticLayout(currentInfoString, infoPaint, infoWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); infoLayout = new StaticLayout(currentInfoString, infoPaint, infoWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
} }
nameLayout = null;
currentNameString = null;
} else if (messageObject.type == 3) { } else if (messageObject.type == 3) {
int duration = messageObject.messageOwner.media.video.duration; int duration = messageObject.messageOwner.media.video.duration;
int minutes = duration / 60; int minutes = duration / 60;
@ -329,12 +394,31 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD
infoWidth = (int) Math.ceil(infoPaint.measureText(currentInfoString)); infoWidth = (int) Math.ceil(infoPaint.measureText(currentInfoString));
infoLayout = new StaticLayout(currentInfoString, infoPaint, infoWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); infoLayout = new StaticLayout(currentInfoString, infoPaint, infoWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
} }
nameLayout = null;
currentNameString = null;
} else { } else {
currentInfoString = null; currentInfoString = null;
currentNameString = null;
infoLayout = null; infoLayout = null;
nameLayout = null;
} }
if (messageObject.type == 4) { if (messageObject.type == 9) {
photoWidth = AndroidUtilities.dp(86);
photoHeight = AndroidUtilities.dp(86);
backgroundWidth = photoWidth + Math.max(nameWidth, infoWidth) + AndroidUtilities.dp(40);
currentPhotoObject = PhotoObject.getClosestImageWithSize(messageObject.photoThumbs, 800, 800);
if (currentPhotoObject != null) {
if (currentPhotoObject.image != null) {
photoImage.setImageBitmap(currentPhotoObject.image);
} else {
currentPhotoFilter = String.format(Locale.US, "%d_%d_b", photoWidth, photoHeight);
photoImage.setImage(currentPhotoObject.photoOwner.location, currentPhotoFilter, null, currentPhotoObject.photoOwner.size);
}
} else {
photoImage.setImageBitmap((BitmapDrawable)null);
}
} else if (messageObject.type == 4) {
photoWidth = AndroidUtilities.dp(100); photoWidth = AndroidUtilities.dp(100);
photoHeight = AndroidUtilities.dp(100); photoHeight = AndroidUtilities.dp(100);
backgroundWidth = photoWidth + AndroidUtilities.dp(12); backgroundWidth = photoWidth + AndroidUtilities.dp(12);
@ -446,7 +530,7 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD
} }
fileName = FileLoader.getAttachFileName(currentPhotoObject.photoOwner); fileName = FileLoader.getAttachFileName(currentPhotoObject.photoOwner);
cacheFile = new File(AndroidUtilities.getCacheDir(), fileName); cacheFile = new File(AndroidUtilities.getCacheDir(), fileName);
} else if (currentMessageObject.type == 8 || currentMessageObject.type == 3) { } else if (currentMessageObject.type == 8 || currentMessageObject.type == 3 || currentMessageObject.type == 9) {
if (currentMessageObject.messageOwner.attachPath != null && currentMessageObject.messageOwner.attachPath.length() != 0) { if (currentMessageObject.messageOwner.attachPath != null && currentMessageObject.messageOwner.attachPath.length() != 0) {
File f = new File(currentMessageObject.messageOwner.attachPath); File f = new File(currentMessageObject.messageOwner.attachPath);
if (f.exists()) { if (f.exists()) {
@ -530,7 +614,11 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD
int x; int x;
if (currentMessageObject.isOut()) { if (currentMessageObject.isOut()) {
if (media) {
x = layoutWidth - backgroundWidth - AndroidUtilities.dp(3); x = layoutWidth - backgroundWidth - AndroidUtilities.dp(3);
} else {
x = layoutWidth - backgroundWidth + AndroidUtilities.dp(6);
}
} else { } else {
if (isChat) { if (isChat) {
x = AndroidUtilities.dp(67); x = AndroidUtilities.dp(67);
@ -542,11 +630,12 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD
int size = AndroidUtilities.dp(44); int size = AndroidUtilities.dp(44);
buttonX = (int)(x + (photoWidth - size) / 2.0f); buttonX = (int)(x + (photoWidth - size) / 2.0f);
buttonY = (int)(AndroidUtilities.dp(7) + (photoHeight - size) / 2.0f); buttonY = (int)(AndroidUtilities.dp(7) + (photoHeight - size) / 2.0f);
progressView.rect.set(buttonX + AndroidUtilities.dp(2), buttonY + AndroidUtilities.dp(2), buttonX + AndroidUtilities.dp(42), buttonY + AndroidUtilities.dp(42)); progressView.rect.set(buttonX + AndroidUtilities.dp(1), buttonY + AndroidUtilities.dp(1), buttonX + AndroidUtilities.dp(43), buttonY + AndroidUtilities.dp(43));
} }
@Override @Override
protected void onAfterBackgroundDraw(Canvas canvas) { protected void onAfterBackgroundDraw(Canvas canvas) {
boolean imageDrawn = false;
if (gifDrawable != null) { if (gifDrawable != null) {
canvas.save(); canvas.save();
gifDrawable.setBounds(photoImage.getImageX(), photoImage.getImageY(), photoImage.getImageX() + photoWidth, photoImage.getImageY() + photoHeight); gifDrawable.setBounds(photoImage.getImageX(), photoImage.getImageY(), photoImage.getImageX() + photoWidth, photoImage.getImageY() + photoHeight);
@ -554,12 +643,46 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD
canvas.restore(); canvas.restore();
} else { } else {
photoImage.setVisible(!PhotoViewer.getInstance().isShowingImage(currentMessageObject), false); photoImage.setVisible(!PhotoViewer.getInstance().isShowingImage(currentMessageObject), false);
photoImage.draw(canvas, photoImage.getImageX(), photoImage.getImageY(), photoWidth, photoHeight); imageDrawn = photoImage.draw(canvas, photoImage.getImageX(), photoImage.getImageY(), photoWidth, photoHeight);
drawTime = photoImage.getVisible(); drawTime = photoImage.getVisible();
} }
if (currentMessageObject.type == 9) {
if (currentMessageObject.isOut()) {
infoPaint.setColor(0xff75b166);
docBackPaint.setColor(0xffd0f3b3);
} else {
infoPaint.setColor(0xffa1adbb);
docBackPaint.setColor(0xffebf0f5);
}
if (!imageDrawn) {
canvas.drawRect(photoImage.getImageX(), photoImage.getImageY(), photoImage.getImageX() + photoImage.getImageWidth(), photoImage.getImageY() + photoImage.getImageHeight(), docBackPaint);
if (buttonState == -1) {
Drawable drawable = currentMessageObject.isOut() ? placeholderDocOutDrawable : placeholderDocInDrawable;
setDrawableBounds(drawable, photoImage.getImageX() + AndroidUtilities.dp(27), photoImage.getImageY() + AndroidUtilities.dp(27));
drawable.draw(canvas);
}
if (currentMessageObject.isOut()) {
progressView.setColor(0xff81bd72);
} else {
progressView.setColor(0xffadbdcc);
}
} else {
progressView.setColor(0xffffffff);
}
} else {
progressView.setColor(0xffffffff);
}
if (buttonState >= 0 && buttonState < 4) { if (buttonState >= 0 && buttonState < 4) {
Drawable currentButtonDrawable = buttonStatesDrawables[buttonState]; Drawable currentButtonDrawable = null;
if (currentMessageObject.type == 9 && !imageDrawn) {
currentButtonDrawable = buttonStatesDrawablesDoc[buttonState][currentMessageObject.isOut() ? 1 : 0];
} else {
currentButtonDrawable = buttonStatesDrawables[buttonState];
}
setDrawableBounds(currentButtonDrawable, buttonX, buttonY); setDrawableBounds(currentButtonDrawable, buttonX, buttonY);
currentButtonDrawable.draw(canvas); currentButtonDrawable.draw(canvas);
} }
@ -568,7 +691,20 @@ public class ChatMediaCell extends ChatBaseCell implements MediaController.FileD
progressView.draw(canvas); progressView.draw(canvas);
} }
if (infoLayout != null && (buttonState == 1 || buttonState == 0 || buttonState == 3)) { if (nameLayout != null) {
canvas.save();
canvas.translate(photoImage.getImageX() + photoImage.getImageWidth() + AndroidUtilities.dp(10), photoImage.getImageY() + AndroidUtilities.dp(8));
nameLayout.draw(canvas);
canvas.restore();
if (infoLayout != null) {
canvas.save();
canvas.translate(photoImage.getImageX() + photoImage.getImageWidth() + AndroidUtilities.dp(10), photoImage.getImageY() + AndroidUtilities.dp(30));
infoLayout.draw(canvas);
canvas.restore();
}
} else if (infoLayout != null && (buttonState == 1 || buttonState == 0 || buttonState == 3)) {
infoPaint.setColor(0xffffffff);
setDrawableBounds(mediaBackgroundDrawable, photoImage.getImageX() + AndroidUtilities.dp(4), photoImage.getImageY() + AndroidUtilities.dp(4), infoWidth + AndroidUtilities.dp(8) + infoOffset, AndroidUtilities.dpf(16.5f)); setDrawableBounds(mediaBackgroundDrawable, photoImage.getImageX() + AndroidUtilities.dp(4), photoImage.getImageY() + AndroidUtilities.dp(4), infoWidth + AndroidUtilities.dp(8) + infoOffset, AndroidUtilities.dpf(16.5f));
mediaBackgroundDrawable.draw(canvas); mediaBackgroundDrawable.draw(canvas);

View File

@ -29,7 +29,7 @@ public class ChatMessageCell extends ChatBaseCell {
private int totalVisibleBlocksCount = 0; private int totalVisibleBlocksCount = 0;
public ChatMessageCell(Context context) { public ChatMessageCell(Context context) {
super(context, false); super(context);
drawForwardedName = true; drawForwardedName = true;
} }

View File

@ -405,6 +405,7 @@ public class ChatOrUserCell extends BaseCell {
} }
avatarImage.setImageCoords(avatarLeft, avatarTop, AndroidUtilities.dp(50), AndroidUtilities.dp(50)); avatarImage.setImageCoords(avatarLeft, avatarTop, AndroidUtilities.dp(50), AndroidUtilities.dp(50));
double widthpx = 0; double widthpx = 0;
float left = 0; float left = 0;
if (LocaleController.isRTL) { if (LocaleController.isRTL) {

View File

@ -43,7 +43,6 @@ import android.widget.AdapterView;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@ -62,7 +61,6 @@ import org.telegram.messenger.FileLog;
import org.telegram.android.MessageObject; import org.telegram.android.MessageObject;
import org.telegram.android.PhotoObject; import org.telegram.android.PhotoObject;
import org.telegram.messenger.ConnectionsManager; import org.telegram.messenger.ConnectionsManager;
import org.telegram.messenger.FileLoader;
import org.telegram.android.MessagesController; import org.telegram.android.MessagesController;
import org.telegram.android.NotificationCenter; import org.telegram.android.NotificationCenter;
import org.telegram.messenger.R; import org.telegram.messenger.R;
@ -149,7 +147,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
private boolean firstLoading = true; private boolean firstLoading = true;
private int minDate = 0; private int minDate = 0;
private int progressTag = 0;
private boolean first = true; private boolean first = true;
private int unread_to_load = 0; private int unread_to_load = 0;
private int first_unread_id = 0; private int first_unread_id = 0;
@ -163,10 +160,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
private TLRPC.ChatParticipants info = null; private TLRPC.ChatParticipants info = null;
private int onlineCount = -1; private int onlineCount = -1;
private HashMap<String, ProgressBar> progressBarMap = new HashMap<String, ProgressBar>();
private HashMap<String, ArrayList<ProgressBar>> loadingFile = new HashMap<String, ArrayList<ProgressBar>>();
private HashMap<Integer, String> progressByTag = new HashMap<Integer, String>();
private CharSequence lastPrintString; private CharSequence lastPrintString;
private long chatEnterTime = 0; private long chatEnterTime = 0;
@ -341,10 +334,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
NotificationCenter.getInstance().addObserver(this, NotificationCenter.encryptedChatUpdated); NotificationCenter.getInstance().addObserver(this, NotificationCenter.encryptedChatUpdated);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.messagesReadedEncrypted); NotificationCenter.getInstance().addObserver(this, NotificationCenter.messagesReadedEncrypted);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.removeAllMessagesFromDialog); NotificationCenter.getInstance().addObserver(this, NotificationCenter.removeAllMessagesFromDialog);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileUploadProgressChanged);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidFailedLoad);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidLoaded);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileLoadProgressChanged);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.audioProgressDidChanged); NotificationCenter.getInstance().addObserver(this, NotificationCenter.audioProgressDidChanged);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.audioDidReset); NotificationCenter.getInstance().addObserver(this, NotificationCenter.audioDidReset);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.screenshotTook); NotificationCenter.getInstance().addObserver(this, NotificationCenter.screenshotTook);
@ -381,10 +370,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.encryptedChatUpdated); NotificationCenter.getInstance().removeObserver(this, NotificationCenter.encryptedChatUpdated);
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.messagesReadedEncrypted); NotificationCenter.getInstance().removeObserver(this, NotificationCenter.messagesReadedEncrypted);
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.removeAllMessagesFromDialog); NotificationCenter.getInstance().removeObserver(this, NotificationCenter.removeAllMessagesFromDialog);
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.FileUploadProgressChanged);
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.FileDidFailedLoad);
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.FileDidLoaded);
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.FileLoadProgressChanged);
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.contactsDidLoaded); NotificationCenter.getInstance().removeObserver(this, NotificationCenter.contactsDidLoaded);
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.audioProgressDidChanged); NotificationCenter.getInstance().removeObserver(this, NotificationCenter.audioProgressDidChanged);
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.audioDidReset); NotificationCenter.getInstance().removeObserver(this, NotificationCenter.audioDidReset);
@ -715,7 +700,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
} }
emptyView.setPadding(AndroidUtilities.dp(7), AndroidUtilities.dp(1), AndroidUtilities.dp(7), AndroidUtilities.dp(1)); emptyView.setPadding(AndroidUtilities.dp(7), AndroidUtilities.dp(1), AndroidUtilities.dp(7), AndroidUtilities.dp(1));
if (currentUser != null && currentUser.id / 1000 == 333) { if (currentUser != null && (currentUser.id / 1000 == 333 || currentUser.id % 1000 == 0)) {
emptyView.setText(LocaleController.getString("GotAQuestion", R.string.GotAQuestion)); emptyView.setText(LocaleController.getString("GotAQuestion", R.string.GotAQuestion));
} }
@ -1048,22 +1033,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
} }
} }
private void addToLoadingFile(String path, ProgressBar bar) {
ArrayList<ProgressBar> arr = loadingFile.get(path);
if (arr == null) {
arr = new ArrayList<ProgressBar>();
loadingFile.put(path, arr);
}
arr.add(bar);
}
private void removeFromloadingFile(String path, ProgressBar bar) {
ArrayList<ProgressBar> arr = loadingFile.get(path);
if (arr != null) {
arr.remove(bar);
}
}
private void updateOnlineCount() { private void updateOnlineCount() {
if (info == null) { if (info == null) {
return; return;
@ -1094,7 +1063,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
return -1; return -1;
} }
} else { } else {
if (messageObject.type == 7) { if (messageObject.type == 6) {
return -1; return -1;
} else if (messageObject.type == 10 || messageObject.type == 11) { } else if (messageObject.type == 10 || messageObject.type == 11) {
if (messageObject.messageOwner.id == 0) { if (messageObject.messageOwner.id == 0) {
@ -1136,7 +1105,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
} }
} }
} else { } else {
if (messageObject.type == 7) { if (messageObject.type == 6) {
return -1; return -1;
} else if (messageObject.messageOwner.send_state == MessageObject.MESSAGE_SEND_STATE_SEND_ERROR) { } else if (messageObject.messageOwner.send_state == MessageObject.MESSAGE_SEND_STATE_SEND_ERROR) {
if (!(messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaEmpty)) { if (!(messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaEmpty)) {
@ -1775,7 +1744,8 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
dateMsg.message = LocaleController.formatDateChat(obj.messageOwner.date); dateMsg.message = LocaleController.formatDateChat(obj.messageOwner.date);
dateMsg.id = 0; dateMsg.id = 0;
MessageObject dateObj = new MessageObject(dateMsg, null); MessageObject dateObj = new MessageObject(dateMsg, null);
dateObj.contentType = dateObj.type = 10; dateObj.type = 10;
dateObj.contentType = 7;
if (forwardLoad) { if (forwardLoad) {
messages.add(0, dateObj); messages.add(0, dateObj);
} else { } else {
@ -1798,7 +1768,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
dateMsg.message = ""; dateMsg.message = "";
dateMsg.id = 0; dateMsg.id = 0;
MessageObject dateObj = new MessageObject(dateMsg, null); MessageObject dateObj = new MessageObject(dateMsg, null);
dateObj.contentType = dateObj.type = 7; dateObj.contentType = dateObj.type = 6;
boolean dateAdded = true; boolean dateAdded = true;
if (a != messArr.size() - 1) { if (a != messArr.size() - 1) {
MessageObject next = messArr.get(a + 1); MessageObject next = messArr.get(a + 1);
@ -2012,9 +1982,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if (minDate == 0 || obj.messageOwner.date < minDate) { if (minDate == 0 || obj.messageOwner.date < minDate) {
minDate = obj.messageOwner.date; minDate = obj.messageOwner.date;
} }
if (obj.messageOwner.attachPath != null && obj.messageOwner.attachPath.length() != 0) {
progressBarMap.put(obj.messageOwner.attachPath, null);
}
if (obj.isOut()) { if (obj.isOut()) {
removeUnreadPlane(false); removeUnreadPlane(false);
@ -2042,7 +2009,8 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
dateMsg.message = LocaleController.formatDateChat(obj.messageOwner.date); dateMsg.message = LocaleController.formatDateChat(obj.messageOwner.date);
dateMsg.id = 0; dateMsg.id = 0;
MessageObject dateObj = new MessageObject(dateMsg, null); MessageObject dateObj = new MessageObject(dateMsg, null);
dateObj.contentType = dateObj.type = 10; dateObj.type = 10;
dateObj.contentType = 7;
messages.add(0, dateObj); messages.add(0, dateObj);
} }
if (!obj.isOut() && obj.messageOwner.unread) { if (!obj.isOut() && obj.messageOwner.unread) {
@ -2177,17 +2145,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
obj.messageOwner.id = newMsgId; obj.messageOwner.id = newMsgId;
obj.messageOwner.send_state = MessageObject.MESSAGE_SEND_STATE_SENT; obj.messageOwner.send_state = MessageObject.MESSAGE_SEND_STATE_SENT;
updateVisibleRows(); updateVisibleRows();
if (obj.messageOwner.attachPath != null && obj.messageOwner.attachPath.length() != 0) {
progressBarMap.remove(obj.messageOwner.attachPath);
}
} }
} else if (id == NotificationCenter.messageReceivedByAck) { } else if (id == NotificationCenter.messageReceivedByAck) {
Integer msgId = (Integer)args[0]; Integer msgId = (Integer)args[0];
MessageObject obj = messagesDict.get(msgId); MessageObject obj = messagesDict.get(msgId);
if (obj != null) { if (obj != null) {
if (obj.messageOwner.attachPath != null && obj.messageOwner.attachPath.length() != 0) {
progressBarMap.remove(obj.messageOwner.attachPath);
}
obj.messageOwner.send_state = MessageObject.MESSAGE_SEND_STATE_SENT; obj.messageOwner.send_state = MessageObject.MESSAGE_SEND_STATE_SENT;
updateVisibleRows(); updateVisibleRows();
} }
@ -2197,9 +2159,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if (obj != null) { if (obj != null) {
obj.messageOwner.send_state = MessageObject.MESSAGE_SEND_STATE_SEND_ERROR; obj.messageOwner.send_state = MessageObject.MESSAGE_SEND_STATE_SEND_ERROR;
updateVisibleRows(); updateVisibleRows();
if (obj.messageOwner.attachPath != null && obj.messageOwner.attachPath.length() != 0) {
progressBarMap.remove(obj.messageOwner.attachPath);
}
} }
} else if (id == NotificationCenter.chatInfoDidLoaded) { } else if (id == NotificationCenter.chatInfoDidLoaded) {
int chatId = (Integer)args[0]; int chatId = (Integer)args[0];
@ -2210,40 +2169,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
SendMessagesHelper.getInstance().setCurrentChatInfo(info); SendMessagesHelper.getInstance().setCurrentChatInfo(info);
} }
} }
} else if (id == NotificationCenter.FileUploadProgressChanged) {
String location = (String)args[0];
boolean enc = (Boolean)args[2];
if (enc && currentEncryptedChat == null) {
return;
} else if (!enc && currentEncryptedChat != null) {
return;
}
ProgressBar bar;
if ((bar = progressBarMap.get(location)) != null) {
Float progress = (Float)args[1];
bar.setProgress((int) (progress * 100));
}
} else if (id == NotificationCenter.FileDidFailedLoad) {
String location = (String)args[0];
if (loadingFile.containsKey(location)) {
loadingFile.remove(location);
updateVisibleRows();
}
} else if (id == NotificationCenter.FileDidLoaded) {
String location = (String)args[0];
if (loadingFile.containsKey(location)) {
loadingFile.remove(location);
updateVisibleRows();
}
} else if (id == NotificationCenter.FileLoadProgressChanged) {
String location = (String)args[0];
ArrayList<ProgressBar> arr = loadingFile.get(location);
if (arr != null) {
Float progress = (Float)args[1];
for (ProgressBar bar : arr) {
bar.setProgress((int)(progress * 100));
}
}
} else if (id == NotificationCenter.contactsDidLoaded) { } else if (id == NotificationCenter.contactsDidLoaded) {
updateContactStatus(); updateContactStatus();
updateSubtitle(); updateSubtitle();
@ -2368,12 +2293,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
currentUser = user; currentUser = user;
} }
if (currentEncryptedChat != null && !(currentEncryptedChat instanceof TLRPC.TL_encryptedChat) if (currentEncryptedChat != null && !(currentEncryptedChat instanceof TLRPC.TL_encryptedChat)
|| currentUser.id / 1000 == 333 || currentUser.id / 1000 == 333 || currentUser.id / 1000 == 777
|| currentUser.id / 1000 == 777
|| currentUser instanceof TLRPC.TL_userEmpty || currentUser instanceof TLRPC.TL_userDeleted || currentUser instanceof TLRPC.TL_userEmpty || currentUser instanceof TLRPC.TL_userDeleted
|| (currentUser.phone != null && currentUser.phone.length() != 0 && || ContactsController.getInstance().isLoadingContacts()
ContactsController.getInstance().contactsDict.get(currentUser.id) != null && || (currentUser.phone != null && currentUser.phone.length() != 0 && ContactsController.getInstance().contactsDict.get(currentUser.id) != null && (ContactsController.getInstance().contactsDict.size() != 0 || !ContactsController.getInstance().isLoadingContacts()))) {
(ContactsController.getInstance().contactsDict.size() != 0 || !ContactsController.getInstance().isLoadingContacts()))) {
topPanel.setVisibility(View.GONE); topPanel.setVisibility(View.GONE);
} else { } else {
topPanel.setVisibility(View.VISIBLE); topPanel.setVisibility(View.VISIBLE);
@ -2868,7 +2791,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
MediaController.saveFile(fileName, selectedObject.messageOwner.attachPath, getParentActivity(), 1, null); MediaController.saveFile(fileName, selectedObject.messageOwner.attachPath, getParentActivity(), 1, null);
} else if (selectedObject.type == 1) { } else if (selectedObject.type == 1) {
MediaController.saveFile(fileName, selectedObject.messageOwner.attachPath, getParentActivity(), 0, null); MediaController.saveFile(fileName, selectedObject.messageOwner.attachPath, getParentActivity(), 0, null);
} else if (selectedObject.type == 8 || selectedObject.type == 9) { } else if (selectedObject.type == 8) {
MediaController.saveFile(fileName, selectedObject.messageOwner.attachPath, getParentActivity(), 2, selectedObject.messageOwner.media.document.file_name); MediaController.saveFile(fileName, selectedObject.messageOwner.attachPath, getParentActivity(), 2, selectedObject.messageOwner.media.document.file_name);
} }
} else if (option == 5) { } else if (option == 5) {
@ -3080,12 +3003,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
} else if (messageType == 13) { } else if (messageType == 13) {
holder.chatBubbleView.setBackgroundResource(R.drawable.chat_incoming_text_states); holder.chatBubbleView.setBackgroundResource(R.drawable.chat_incoming_text_states);
holder.chatBubbleView.setPadding(AndroidUtilities.dp(15), AndroidUtilities.dp(6), AndroidUtilities.dp(9), 0); holder.chatBubbleView.setPadding(AndroidUtilities.dp(15), AndroidUtilities.dp(6), AndroidUtilities.dp(9), 0);
} else if (messageType == 8) {
holder.chatBubbleView.setBackgroundResource(R.drawable.chat_outgoing_text_states);
holder.chatBubbleView.setPadding(AndroidUtilities.dp(9), AndroidUtilities.dp(9), AndroidUtilities.dp(18), 0);
} else if (messageType == 9) {
holder.chatBubbleView.setBackgroundResource(R.drawable.chat_incoming_text_states);
holder.chatBubbleView.setPadding(AndroidUtilities.dp(18), AndroidUtilities.dp(9), AndroidUtilities.dp(9), 0);
} }
} else { } else {
if (messageType == 12) { if (messageType == 12) {
@ -3102,20 +3019,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in); holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in);
} }
holder.chatBubbleView.setPadding(AndroidUtilities.dp(15), AndroidUtilities.dp(6), AndroidUtilities.dp(9), 0); holder.chatBubbleView.setPadding(AndroidUtilities.dp(15), AndroidUtilities.dp(6), AndroidUtilities.dp(9), 0);
} else if (messageType == 8) {
if (selected) {
holder.chatBubbleView.setBackgroundResource(R.drawable.msg_out_selected);
} else {
holder.chatBubbleView.setBackgroundResource(R.drawable.msg_out);
}
holder.chatBubbleView.setPadding(AndroidUtilities.dp(9), AndroidUtilities.dp(9), AndroidUtilities.dp(18), 0);
} else if (messageType == 9) {
if (selected) {
holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in_selected);
} else {
holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in);
}
holder.chatBubbleView.setPadding(AndroidUtilities.dp(18), AndroidUtilities.dp(9), AndroidUtilities.dp(9), 0);
} }
} }
} }
@ -3277,28 +3180,20 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
view = new ChatMessageCell(mContext); view = new ChatMessageCell(mContext);
} if (type == 1) { } if (type == 1) {
view = new ChatMediaCell(mContext); view = new ChatMediaCell(mContext);
} else if (type == 10) { } else if (type == 7) {
view = li.inflate(R.layout.chat_action_message_layout, viewGroup, false); view = li.inflate(R.layout.chat_action_message_layout, viewGroup, false);
} else if (type == 11) { } else if (type == 8) {
view = li.inflate(R.layout.chat_action_change_photo_layout, viewGroup, false); view = li.inflate(R.layout.chat_action_change_photo_layout, viewGroup, false);
} else if (type == 4) { } else if (type == 3) {
view = li.inflate(R.layout.chat_outgoing_contact_layout, viewGroup, false); view = li.inflate(R.layout.chat_outgoing_contact_layout, viewGroup, false);
} else if (type == 5) { } else if (type == 4) {
if (currentChat != null) { if (currentChat != null) {
view = li.inflate(R.layout.chat_group_incoming_contact_layout, viewGroup, false); view = li.inflate(R.layout.chat_group_incoming_contact_layout, viewGroup, false);
} else { } else {
view = li.inflate(R.layout.chat_incoming_contact_layout, viewGroup, false); view = li.inflate(R.layout.chat_incoming_contact_layout, viewGroup, false);
} }
} else if (type == 7) { } else if (type == 6) {
view = li.inflate(R.layout.chat_unread_layout, viewGroup, false); view = li.inflate(R.layout.chat_unread_layout, viewGroup, false);
} else if (type == 8) {
view = li.inflate(R.layout.chat_outgoing_document_layout, viewGroup, false);
} else if (type == 9) {
if (currentChat != null) {
view = li.inflate(R.layout.chat_group_incoming_document_layout, viewGroup, false);
} else {
view = li.inflate(R.layout.chat_incoming_document_layout, viewGroup, false);
}
} else if (type == 2) { } else if (type == 2) {
view = new ChatAudioCell(mContext); view = new ChatAudioCell(mContext);
} }
@ -3383,6 +3278,48 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
LocationActivity fragment = new LocationActivity(); LocationActivity fragment = new LocationActivity();
fragment.setMessageObject(message); fragment.setMessageObject(message);
presentFragment(fragment); presentFragment(fragment);
} else if (message.type == 9) {
File f = null;
String fileName = message.getFileName();
if (message.messageOwner.attachPath != null && message.messageOwner.attachPath.length() != 0) {
f = new File(message.messageOwner.attachPath);
}
if (f == null || f != null && !f.exists()) {
f = new File(AndroidUtilities.getCacheDir(), fileName);
}
if (f != null && f.exists()) {
String realMimeType = null;
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
if (message.type == 8 || message.type == 9) {
MimeTypeMap myMime = MimeTypeMap.getSingleton();
int idx = fileName.lastIndexOf(".");
if (idx != -1) {
String ext = fileName.substring(idx + 1);
realMimeType = myMime.getMimeTypeFromExtension(ext.toLowerCase());
if (realMimeType != null) {
intent.setDataAndType(Uri.fromFile(f), realMimeType);
} else {
intent.setDataAndType(Uri.fromFile(f), "text/plain");
}
} else {
intent.setDataAndType(Uri.fromFile(f), "text/plain");
}
}
if (realMimeType != null) {
try {
getParentActivity().startActivity(intent);
} catch (Exception e) {
intent.setDataAndType(Uri.fromFile(f), "text/plain");
getParentActivity().startActivity(intent);
}
} else {
getParentActivity().startActivity(intent);
}
} catch (Exception e) {
alertUserOpenError(message);
}
}
} }
} }
}; };
@ -3414,11 +3351,11 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if (!endReached && messages.size() != 0) { if (!endReached && messages.size() != 0) {
offset = 0; offset = 0;
if (i == 0) { if (i == 0) {
return 6; return 5;
} }
} }
if (!unread_end_reached && i == (messages.size() + 1 - offset)) { if (!unread_end_reached && i == (messages.size() + 1 - offset)) {
return 6; return 5;
} }
MessageObject message = messages.get(messages.size() - i - offset); MessageObject message = messages.get(messages.size() - i - offset);
return message.contentType; return message.contentType;
@ -3426,7 +3363,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
@Override @Override
public int getViewTypeCount() { public int getViewTypeCount() {
return 12; return 9;
} }
@Override @Override
@ -3453,8 +3390,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
public BackupImageView photoImage; public BackupImageView photoImage;
public ImageView halfCheckImage; public ImageView halfCheckImage;
public ImageView checkImage; public ImageView checkImage;
public TextView actionAttachButton;
public TextView videoTimeText;
public MessageObject message; public MessageObject message;
public TextView phoneTextView; public TextView phoneTextView;
public BackupImageView contactAvatar; public BackupImageView contactAvatar;
@ -3463,14 +3398,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
public View addContactView; public View addContactView;
public View chatBubbleView; public View chatBubbleView;
public ProgressBar actionProgress;
public View actionView;
public ImageView actionCancelButton;
private PhotoObject photoObjectToSet = null;
private File photoFile = null;
private String photoFilter = null;
public void update() { public void update() {
TLRPC.User fromUser = MessagesController.getInstance().getUser(message.messageOwner.from_id); TLRPC.User fromUser = MessagesController.getInstance().getUser(message.messageOwner.from_id);
@ -3556,51 +3483,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
contactAvatar.setImageResource(Utilities.getUserAvatarForId(message.messageOwner.media.user_id)); contactAvatar.setImageResource(Utilities.getUserAvatarForId(message.messageOwner.media.user_id));
addContactView.setVisibility(View.GONE); addContactView.setVisibility(View.GONE);
} }
} else if (type == 7) { } else if (type == 6) {
messageTextView.setTextSize(16); messageTextView.setTextSize(16);
messageTextView.setText(LocaleController.formatPluralString("NewMessages", unread_to_load)); messageTextView.setText(LocaleController.formatPluralString("NewMessages", unread_to_load));
} else if (type == 8 || type == 9) {
TLRPC.Document document = message.messageOwner.media.document;
if (document instanceof TLRPC.TL_document || document instanceof TLRPC.TL_documentEncrypted) {
nameTextView.setText(message.messageOwner.media.document.file_name);
String fileName = message.getFileName();
int idx = fileName.lastIndexOf(".");
String ext = null;
if (idx != -1) {
ext = fileName.substring(idx + 1);
}
if (ext == null || ext.length() == 0) {
ext = message.messageOwner.media.document.mime_type;
}
ext = ext.toUpperCase();
if (document.size < 1024) {
phoneTextView.setText(String.format("%d B %s", document.size, ext));
} else if (document.size < 1024 * 1024) {
phoneTextView.setText(String.format("%.1f KB %s", document.size / 1024.0f, ext));
} else {
phoneTextView.setText(String.format("%.1f MB %s", document.size / 1024.0f / 1024.0f, ext));
}
if (document.thumb instanceof TLRPC.TL_photoSize) {
contactAvatar.setImage(document.thumb.location, "50_50", type == 8 ? R.drawable.doc_green : R.drawable.doc_blue);
} else if (document.thumb instanceof TLRPC.TL_photoCachedSize) {
contactAvatar.setImage(document.thumb.location, "50_50", type == 8 ? R.drawable.doc_green : R.drawable.doc_blue);
} else {
if (type == 8) {
contactAvatar.setImageResource(R.drawable.doc_green);
} else {
contactAvatar.setImageResource(R.drawable.doc_blue);
}
}
} else {
nameTextView.setText("Error");
phoneTextView.setText("Error");
if (type == 8) {
contactAvatar.setImageResource(R.drawable.doc_green);
} else {
contactAvatar.setImageResource(R.drawable.doc_blue);
}
}
} }
if (message.isFromMe()) { if (message.isFromMe()) {
@ -3609,37 +3494,12 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
checkImage.setVisibility(View.INVISIBLE); checkImage.setVisibility(View.INVISIBLE);
halfCheckImage.setImageResource(R.drawable.msg_clock); halfCheckImage.setImageResource(R.drawable.msg_clock);
halfCheckImage.setVisibility(View.VISIBLE); halfCheckImage.setVisibility(View.VISIBLE);
if (actionView != null) {
if (actionView != null) {
actionView.setVisibility(View.VISIBLE);
}
Float progress = null;
if (message.messageOwner.attachPath != null && message.messageOwner.attachPath.length() != 0) {
progress = FileLoader.getInstance().getFileProgress(message.messageOwner.attachPath);
progressByTag.put((Integer)actionProgress.getTag(), message.messageOwner.attachPath);
progressBarMap.put(message.messageOwner.attachPath, actionProgress);
}
if (progress != null) {
actionProgress.setProgress((int)(progress * 100));
} else {
actionProgress.setProgress(0);
}
}
if (actionAttachButton != null) {
actionAttachButton.setVisibility(View.GONE);
}
} else if (message.messageOwner.send_state == MessageObject.MESSAGE_SEND_STATE_SEND_ERROR) { } else if (message.messageOwner.send_state == MessageObject.MESSAGE_SEND_STATE_SEND_ERROR) {
halfCheckImage.setVisibility(View.VISIBLE); halfCheckImage.setVisibility(View.VISIBLE);
halfCheckImage.setImageResource(R.drawable.msg_warning); halfCheckImage.setImageResource(R.drawable.msg_warning);
if (checkImage != null) { if (checkImage != null) {
checkImage.setVisibility(View.INVISIBLE); checkImage.setVisibility(View.INVISIBLE);
} }
if (actionView != null) {
actionView.setVisibility(View.GONE);
}
if (actionAttachButton != null) {
actionAttachButton.setVisibility(View.GONE);
}
} else if (message.messageOwner.send_state == MessageObject.MESSAGE_SEND_STATE_SENT) { } else if (message.messageOwner.send_state == MessageObject.MESSAGE_SEND_STATE_SENT) {
if (!message.messageOwner.unread) { if (!message.messageOwner.unread) {
halfCheckImage.setVisibility(View.VISIBLE); halfCheckImage.setVisibility(View.VISIBLE);
@ -3650,106 +3510,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
checkImage.setVisibility(View.INVISIBLE); checkImage.setVisibility(View.INVISIBLE);
halfCheckImage.setImageResource(R.drawable.msg_check); halfCheckImage.setImageResource(R.drawable.msg_check);
} }
if (actionView != null) {
actionView.setVisibility(View.GONE);
} }
if (actionAttachButton != null) {
actionAttachButton.setVisibility(View.VISIBLE);
}
}
}
}
if (message.type == 8 || message.type == 9) {
Integer tag = (Integer)actionProgress.getTag();
String file = progressByTag.get(tag);
if (file != null) {
removeFromloadingFile(file, actionProgress);
}
if (message.messageOwner.send_state != MessageObject.MESSAGE_SEND_STATE_SENDING && message.messageOwner.send_state != MessageObject.MESSAGE_SEND_STATE_SEND_ERROR) {
if (file != null) {
progressBarMap.remove(file);
}
String fileName = message.getFileName();
boolean load = false;
if (message.type != 2 && message.type != 3 && message.messageOwner.attachPath != null && message.messageOwner.attachPath.length() != 0) {
File f = new File(message.messageOwner.attachPath);
if (f.exists()) {
if (actionAttachButton != null) {
actionAttachButton.setVisibility(View.VISIBLE);
if (message.type == 8 || message.type == 9) {
actionAttachButton.setText(LocaleController.getString("Open", R.string.Open));
}
}
if (actionView != null) {
actionView.setVisibility(View.GONE);
}
} else {
load = true;
}
}
if (load && message.messageOwner.attachPath != null && message.messageOwner.attachPath.length() != 0 || !load && (message.messageOwner.attachPath == null || message.messageOwner.attachPath.length() == 0)) {
File cacheFile = null;
if ((cacheFile = new File(AndroidUtilities.getCacheDir(), fileName)).exists()) {
if (actionAttachButton != null) {
actionAttachButton.setVisibility(View.VISIBLE);
if (message.type == 8 || message.type == 9) {
actionAttachButton.setText(LocaleController.getString("Open", R.string.Open));
}
}
if (actionView != null) {
actionView.setVisibility(View.GONE);
}
load = false;
} else {
load = true;
}
}
if (load) {
Float progress = FileLoader.getInstance().getFileProgress(fileName);
if (loadingFile.containsKey(fileName) || progress != null) {
if (progress != null) {
actionProgress.setProgress((int)(progress * 100));
} else {
actionProgress.setProgress(0);
}
progressByTag.put((Integer)actionProgress.getTag(), fileName);
addToLoadingFile(fileName, actionProgress);
if (actionView != null) {
actionView.setVisibility(View.VISIBLE);
}
if (actionAttachButton != null) {
actionAttachButton.setVisibility(View.GONE);
}
} else {
if (actionView != null) {
actionView.setVisibility(View.GONE);
}
if (actionAttachButton != null) {
actionAttachButton.setVisibility(View.VISIBLE);
if (message.type == 8 || message.type == 9) {
actionAttachButton.setText(LocaleController.getString("DOWNLOAD", R.string.DOWNLOAD));
}
}
}
}
}
if (message.type == 8 || message.type == 9) {
int width;
if (currentChat != null && type != 8) {
if (actionView.getVisibility() == View.VISIBLE) {
width = AndroidUtilities.displaySize.x - AndroidUtilities.dp(290);
} else {
width = AndroidUtilities.displaySize.x - AndroidUtilities.dp(270);
}
} else {
if (actionView.getVisibility() == View.VISIBLE) {
width = AndroidUtilities.displaySize.x - AndroidUtilities.dp(240);
} else {
width = AndroidUtilities.displaySize.x - AndroidUtilities.dp(220);
}
}
nameTextView.setMaxWidth(width);
phoneTextView.setMaxWidth(width);
} }
} }
} }
@ -3762,12 +3523,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
photoImage = (BackupImageView)view.findViewById(R.id.chat_photo_image); photoImage = (BackupImageView)view.findViewById(R.id.chat_photo_image);
halfCheckImage = (ImageView)view.findViewById(R.id.chat_row_halfcheck); halfCheckImage = (ImageView)view.findViewById(R.id.chat_row_halfcheck);
checkImage = (ImageView)view.findViewById(R.id.chat_row_check); checkImage = (ImageView)view.findViewById(R.id.chat_row_check);
actionAttachButton = (TextView)view.findViewById(R.id.chat_view_action_button);
messageTextView = (TextView)view.findViewById(R.id.chat_message_text); messageTextView = (TextView)view.findViewById(R.id.chat_message_text);
videoTimeText = (TextView)view.findViewById(R.id.chat_video_time);
actionView = view.findViewById(R.id.chat_view_action_layout);
actionProgress = (ProgressBar)view.findViewById(R.id.chat_view_action_progress);
actionCancelButton = (ImageView)view.findViewById(R.id.chat_view_action_cancel_button);
phoneTextView = (TextView)view.findViewById(R.id.phone_text_view); phoneTextView = (TextView)view.findViewById(R.id.phone_text_view);
contactAvatar = (BackupImageView)view.findViewById(R.id.contact_avatar); contactAvatar = (BackupImageView)view.findViewById(R.id.contact_avatar);
contactView = view.findViewById(R.id.shared_layout); contactView = view.findViewById(R.id.shared_layout);
@ -3778,21 +3534,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
messageTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, MessagesController.getInstance().fontSize); messageTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, MessagesController.getInstance().fontSize);
} }
if (actionProgress != null) {
actionProgress.setTag(progressTag);
progressTag++;
}
if (type != 2 && type != 3) {
if (actionView != null) {
if (isCustomTheme) {
actionView.setBackgroundResource(R.drawable.system_black);
} else {
actionView.setBackgroundResource(R.drawable.system_blue);
}
}
}
if (messageLayoutAction != null) { if (messageLayoutAction != null) {
if (isCustomTheme) { if (isCustomTheme) {
messageLayoutAction.setBackgroundResource(R.drawable.system_black); messageLayoutAction.setBackgroundResource(R.drawable.system_black);
@ -3829,9 +3570,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
contactView.setOnClickListener(new View.OnClickListener() { contactView.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
if (message.type == 8 || message.type == 9) { if (message.type == 12 || message.type == 13) {
processOnClick(view);
} else if (message.type == 12 || message.type == 13) {
if (actionBarLayer.isActionModeShowed()) { if (actionBarLayer.isActionModeShowed()) {
processRowSelect(view); processRowSelect(view);
return; return;
@ -3903,15 +3642,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}); });
} }
if (actionAttachButton != null) {
actionAttachButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
processOnClick(view);
}
});
}
if (avatarImageView != null) { if (avatarImageView != null) {
avatarImageView.setOnClickListener(new View.OnClickListener() { avatarImageView.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -3929,33 +3659,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}); });
} }
if (actionCancelButton != null) {
actionCancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (message != null) {
Integer tag = (Integer)actionProgress.getTag();
if (message.messageOwner.send_state != 0) {
SendMessagesHelper.getInstance().cancelSendingMessage(message);
String file = progressByTag.get(tag);
if (file != null) {
progressBarMap.remove(file);
}
} else if (message.type == 8 || message.type == 9) {
String file = progressByTag.get(tag);
if (file != null) {
loadingFile.remove(file);
if (message.type == 8 || message.type == 9) {
FileLoader.getInstance().cancelLoadFile(message.messageOwner.media.document);
}
updateVisibleRows();
}
}
}
}
});
}
if (photoImage != null) { if (photoImage != null) {
photoImage.setOnClickListener(new View.OnClickListener() { photoImage.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -3983,63 +3686,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if (message.type == 11) { if (message.type == 11) {
PhotoViewer.getInstance().setParentActivity(getParentActivity()); PhotoViewer.getInstance().setParentActivity(getParentActivity());
PhotoViewer.getInstance().openPhoto(message, ChatActivity.this); PhotoViewer.getInstance().openPhoto(message, ChatActivity.this);
} else if (message.type == 8 || message.type == 9) {
File f = null;
String fileName = message.getFileName();
if (message.messageOwner.attachPath != null && message.messageOwner.attachPath.length() != 0) {
f = new File(message.messageOwner.attachPath);
}
if (f == null || f != null && !f.exists()) {
f = new File(AndroidUtilities.getCacheDir(), fileName);
}
if (f != null && f.exists()) {
String realMimeType = null;
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
if (message.type == 8 || message.type == 9) {
MimeTypeMap myMime = MimeTypeMap.getSingleton();
int idx = fileName.lastIndexOf(".");
if (idx != -1) {
String ext = fileName.substring(idx + 1);
realMimeType = myMime.getMimeTypeFromExtension(ext.toLowerCase());
if (realMimeType != null) {
intent.setDataAndType(Uri.fromFile(f), realMimeType);
} else {
intent.setDataAndType(Uri.fromFile(f), "text/plain");
}
} else {
intent.setDataAndType(Uri.fromFile(f), "text/plain");
}
}
if (realMimeType != null) {
try {
getParentActivity().startActivity(intent);
} catch (Exception e) {
intent.setDataAndType(Uri.fromFile(f), "text/plain");
getParentActivity().startActivity(intent);
}
} else {
getParentActivity().startActivity(intent);
}
} catch (Exception e) {
alertUserOpenError(message);
}
} else {
if (message.messageOwner.send_state != MessageObject.MESSAGE_SEND_STATE_SEND_ERROR && message.messageOwner.send_state != MessageObject.MESSAGE_SEND_STATE_SENDING || !message.isOut()) {
if (!loadingFile.containsKey(fileName)) {
progressByTag.put((Integer)actionProgress.getTag(), fileName);
addToLoadingFile(fileName, actionProgress);
if (message.type == 8 || message.type == 9) {
FileLoader.getInstance().loadFile(message.messageOwner.media.document);
}
updateVisibleRows();
}
} else {
if (message.messageOwner.send_state == MessageObject.MESSAGE_SEND_STATE_SEND_ERROR) {
createMenu(view, false);
}
}
}
} }
} }
} }

View File

@ -26,7 +26,6 @@ import org.telegram.android.SendMessagesHelper;
import org.telegram.messenger.ConnectionsManager; import org.telegram.messenger.ConnectionsManager;
import org.telegram.messenger.FileLog; import org.telegram.messenger.FileLog;
import org.telegram.android.LocaleController; import org.telegram.android.LocaleController;
import org.telegram.android.MessagesController;
import org.telegram.android.NotificationCenter; import org.telegram.android.NotificationCenter;
import org.telegram.messenger.R; import org.telegram.messenger.R;
import org.telegram.messenger.TLRPC; import org.telegram.messenger.TLRPC;
@ -362,23 +361,14 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
int userId = intent.getIntExtra("userId", 0); int userId = intent.getIntExtra("userId", 0);
int encId = intent.getIntExtra("encId", 0); int encId = intent.getIntExtra("encId", 0);
if (chatId != 0) { if (chatId != 0) {
TLRPC.Chat chat = MessagesController.getInstance().getChat(chatId);
if (chat != null) {
NotificationCenter.getInstance().postNotificationName(NotificationCenter.closeChats); NotificationCenter.getInstance().postNotificationName(NotificationCenter.closeChats);
push_chat_id = chatId; push_chat_id = chatId;
}
} else if (userId != 0) { } else if (userId != 0) {
TLRPC.User user = MessagesController.getInstance().getUser(userId);
if (user != null) {
NotificationCenter.getInstance().postNotificationName(NotificationCenter.closeChats); NotificationCenter.getInstance().postNotificationName(NotificationCenter.closeChats);
push_user_id = userId; push_user_id = userId;
}
} else if (encId != 0) { } else if (encId != 0) {
TLRPC.EncryptedChat chat = MessagesController.getInstance().getEncryptedChat(encId);
if (chat != null) {
NotificationCenter.getInstance().postNotificationName(NotificationCenter.closeChats); NotificationCenter.getInstance().postNotificationName(NotificationCenter.closeChats);
push_enc_id = encId; push_enc_id = encId;
}
} else { } else {
showDialogsList = true; showDialogsList = true;
} }
@ -425,6 +415,9 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
fragment.setDelegate(this); fragment.setDelegate(this);
presentFragment(fragment, false, true); presentFragment(fragment, false, true);
pushOpened = true; pushOpened = true;
if (PhotoViewer.getInstance().isVisible()) {
PhotoViewer.getInstance().closePhoto(true);
}
} }
if (open_settings != 0) { if (open_settings != 0) {
presentFragment(new SettingsActivity(), false, true); presentFragment(new SettingsActivity(), false, true);

View File

@ -489,7 +489,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
windowLayoutParams.format = PixelFormat.TRANSLUCENT; windowLayoutParams.format = PixelFormat.TRANSLUCENT;
windowLayoutParams.width = WindowManager.LayoutParams.MATCH_PARENT; windowLayoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
windowLayoutParams.gravity = Gravity.TOP; windowLayoutParams.gravity = Gravity.TOP;
windowLayoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION; windowLayoutParams.type = WindowManager.LayoutParams.LAST_APPLICATION_WINDOW;
windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
actionBar = new ActionBar(activity); actionBar = new ActionBar(activity);
@ -1212,6 +1212,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
int prevIndex = currentIndex; int prevIndex = currentIndex;
currentIndex = index; currentIndex = index;
currentFileName = getFileName(index, null); currentFileName = getFileName(index, null);
boolean sameImage = false;
if (!imagesArr.isEmpty()) { if (!imagesArr.isEmpty()) {
deleteButton.setVisibility(View.VISIBLE); deleteButton.setVisibility(View.VISIBLE);
@ -1240,7 +1241,11 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
} else { } else {
deleteButton.setVisibility(View.GONE); deleteButton.setVisibility(View.GONE);
} }
TLRPC.FileLocation old = currentFileLocation;
currentFileLocation = imagesArrLocations.get(index); currentFileLocation = imagesArrLocations.get(index);
if (old != null && currentFileLocation != null && old.local_id == currentFileLocation.local_id && old.volume_id == currentFileLocation.volume_id) {
sameImage = true;
}
actionBarLayer.setTitle(LocaleController.formatString("Of", R.string.Of, currentIndex + 1, imagesArrLocations.size())); actionBarLayer.setTitle(LocaleController.formatString("Of", R.string.Of, currentIndex + 1, imagesArrLocations.size()));
} else if (!imagesArrLocals.isEmpty()) { } else if (!imagesArrLocals.isEmpty()) {
currentPathObject = imagesArrLocals.get(index).path; currentPathObject = imagesArrLocals.get(index).path;
@ -1270,6 +1275,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
} }
} }
if (!sameImage) {
draggingDown = false; draggingDown = false;
translationX = 0; translationX = 0;
translationY = 0; translationY = 0;
@ -1297,6 +1303,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
switchImageAfterAnimation = 0; switchImageAfterAnimation = 0;
canZoom = currentFileName == null || !currentFileName.endsWith("mp4"); canZoom = currentFileName == null || !currentFileName.endsWith("mp4");
updateMinMax(scale); updateMinMax(scale);
}
if (prevIndex == -1) { if (prevIndex == -1) {
setIndexToImage(centerImage, currentIndex); setIndexToImage(centerImage, currentIndex);
@ -1915,7 +1922,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
draggingDown = true; draggingDown = true;
moving = false; moving = false;
dragY = ev.getY(); dragY = ev.getY();
if (isActionBarVisible) { if (isActionBarVisible && canShowBottom) {
toggleActionBar(false, true); toggleActionBar(false, true);
} }
return true; return true;
@ -2334,7 +2341,11 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
@Override @Override
public boolean onSingleTapConfirmed(MotionEvent e) { public boolean onSingleTapConfirmed(MotionEvent e) {
if (canShowBottom) {
toggleActionBar(!isActionBarVisible, true); toggleActionBar(!isActionBarVisible, true);
} else {
checkImageView.callOnClick();
}
return true; return true;
} }

View File

@ -177,6 +177,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
builder.setItems(items, new DialogInterface.OnClickListener() { builder.setItems(items, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialogInterface, int i) { public void onClick(DialogInterface dialogInterface, int i) {
try {
if (i == 0) { if (i == 0) {
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File image = Utilities.generatePicturePath(); File image = Utilities.generatePicturePath();
@ -190,6 +191,9 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
photoPickerIntent.setType("image/*"); photoPickerIntent.setType("image/*");
getParentActivity().startActivityForResult(photoPickerIntent, 11); getParentActivity().startActivityForResult(photoPickerIntent, 11);
} }
} catch (Exception e) {
FileLog.e("tmessages", e);
}
} }
}); });
showAlertDialog(builder); showAlertDialog(builder);
@ -521,7 +525,6 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
selection.setVisibility(View.INVISIBLE); selection.setVisibility(View.INVISIBLE);
} }
} }
} else if (type == 1) { } else if (type == 1) {
if (view == null) { if (view == null) {
LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

View File

@ -744,19 +744,11 @@ public class ActionBarActivity extends Activity {
} }
containerView.invalidate(); containerView.invalidate();
if (intent != null) { if (intent != null) {
try { super.startActivityForResult(intent, requestCode);
ActionBarActivity.super.startActivityForResult(intent, requestCode);
} catch (Exception e) {
FileLog.e("tmessages", e);
}
} }
} else { } else {
if (intent != null) { if (intent != null) {
try {
super.startActivityForResult(intent, requestCode); super.startActivityForResult(intent, requestCode);
} catch (Exception e) {
FileLog.e("tmessages", e);
}
} }
} }
} }

View File

@ -43,7 +43,6 @@ public class HorizontalListView extends AdapterView<ListAdapter> {
private OnItemLongClickListener mOnItemLongClicked; private OnItemLongClickListener mOnItemLongClicked;
private boolean mDataChanged = false; private boolean mDataChanged = false;
public HorizontalListView(Context context, AttributeSet attrs) { public HorizontalListView(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
initView(); initView();
@ -66,7 +65,7 @@ public class HorizontalListView extends AdapterView<ListAdapter> {
} }
@Override @Override
public void setOnItemClickListener(AdapterView.OnItemClickListener listener){ public void setOnItemClickListener(AdapterView.OnItemClickListener listener) {
mOnItemClicked = listener; mOnItemClicked = listener;
} }
@ -76,10 +75,9 @@ public class HorizontalListView extends AdapterView<ListAdapter> {
} }
private DataSetObserver mDataObserver = new DataSetObserver() { private DataSetObserver mDataObserver = new DataSetObserver() {
@Override @Override
public void onChanged() { public void onChanged() {
synchronized(HorizontalListView.this){ synchronized (HorizontalListView.this) {
mDataChanged = true; mDataChanged = true;
} }
invalidate(); invalidate();
@ -92,7 +90,6 @@ public class HorizontalListView extends AdapterView<ListAdapter> {
invalidate(); invalidate();
requestLayout(); requestLayout();
} }
}; };
@Override @Override
@ -113,7 +110,7 @@ public class HorizontalListView extends AdapterView<ListAdapter> {
@Override @Override
public void setAdapter(ListAdapter adapter) { public void setAdapter(ListAdapter adapter) {
if(mAdapter != null && mDataObserver != null) { if (mAdapter != null && mDataObserver != null) {
mAdapter.unregisterDataSetObserver(mDataObserver); mAdapter.unregisterDataSetObserver(mDataObserver);
} }
mAdapter = adapter; mAdapter = adapter;
@ -121,35 +118,33 @@ public class HorizontalListView extends AdapterView<ListAdapter> {
reset(); reset();
} }
private synchronized void reset(){ private synchronized void reset() {
initView(); initView();
mRemovedViewQueue.clear();
removeAllViewsInLayout(); removeAllViewsInLayout();
requestLayout(); requestLayout();
} }
private void addAndMeasureChild(final View child, int viewPos) { private void addAndMeasureChild(final View child, int viewPos) {
LayoutParams params = child.getLayoutParams(); LayoutParams params = child.getLayoutParams();
if(params == null) { if (params == null) {
params = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); params = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
} }
addViewInLayout(child, viewPos, params, true); addViewInLayout(child, viewPos, params, true);
child.measure(MeasureSpec.makeMeasureSpec(getWidth(), MeasureSpec.AT_MOST), child.measure(MeasureSpec.makeMeasureSpec(getWidth(), MeasureSpec.AT_MOST), MeasureSpec.makeMeasureSpec(getHeight(), MeasureSpec.AT_MOST));
MeasureSpec.makeMeasureSpec(getHeight(), MeasureSpec.AT_MOST));
} }
@SuppressLint("DrawAllocation") @SuppressLint("DrawAllocation")
@Override @Override
protected synchronized void onLayout(boolean changed, int left, int top, int right, int bottom) { protected synchronized void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom); super.onLayout(changed, left, top, right, bottom);
if(mAdapter == null){ if (mAdapter == null) {
return; return;
} }
if(mDataChanged){ if (mDataChanged) {
int oldCurrentX = mCurrentX; int oldCurrentX = mCurrentX;
initView(); initView();
removeAllViewsInLayout(); removeAllViewsInLayout();
@ -157,15 +152,15 @@ public class HorizontalListView extends AdapterView<ListAdapter> {
mDataChanged = false; mDataChanged = false;
} }
if(mScroller.computeScrollOffset()){ if (mScroller.computeScrollOffset()) {
mNextX = mScroller.getCurrX(); mNextX = mScroller.getCurrX();
} }
if(mNextX <= 0){ if (mNextX <= 0) {
mNextX = 0; mNextX = 0;
mScroller.forceFinished(true); mScroller.forceFinished(true);
} }
if(mNextX >= mMaxX) { if (mNextX >= mMaxX) {
mNextX = mMaxX; mNextX = mMaxX;
mScroller.forceFinished(true); mScroller.forceFinished(true);
} }
@ -178,35 +173,34 @@ public class HorizontalListView extends AdapterView<ListAdapter> {
mCurrentX = mNextX; mCurrentX = mNextX;
if(!mScroller.isFinished()){ if (!mScroller.isFinished()) {
post(new Runnable(){ post(new Runnable() {
@Override @Override
public void run() { public void run() {
requestLayout(); requestLayout();
} }
}); });
} }
} }
private void fillList(final int dx) { private void fillList(final int dx) {
int edge = 0; int edge = 0;
View child = getChildAt(getChildCount()-1); View child = getChildAt(getChildCount() - 1);
if(child != null) { if (child != null) {
edge = child.getRight(); edge = child.getRight();
} }
fillListRight(edge, dx); fillListRight(edge, dx);
edge = 0; edge = 0;
child = getChildAt(0); child = getChildAt(0);
if(child != null) { if (child != null) {
edge = child.getLeft(); edge = child.getLeft();
} }
fillListLeft(edge, dx); fillListLeft(edge, dx);
} }
private void fillListRight(int rightEdge, final int dx) { private void fillListRight(int rightEdge, final int dx) {
while(rightEdge + dx < getWidth() && mRightViewIndex < mAdapter.getCount()) { while (rightEdge + dx < getWidth() && mRightViewIndex < mAdapter.getCount()) {
View v = null; View v = null;
int type = mAdapter.getItemViewType(mRightViewIndex); int type = mAdapter.getItemViewType(mRightViewIndex);
@ -219,8 +213,9 @@ public class HorizontalListView extends AdapterView<ListAdapter> {
addAndMeasureChild(child, -1); addAndMeasureChild(child, -1);
rightEdge += child.getMeasuredWidth(); rightEdge += child.getMeasuredWidth();
child.invalidate();
if(mRightViewIndex == mAdapter.getCount() - 1) { if (mRightViewIndex == mAdapter.getCount() - 1) {
mMaxX = mCurrentX + rightEdge - getWidth() + getPaddingLeft(); mMaxX = mCurrentX + rightEdge - getWidth() + getPaddingLeft();
} }
@ -233,7 +228,7 @@ public class HorizontalListView extends AdapterView<ListAdapter> {
} }
private void fillListLeft(int leftEdge, final int dx) { private void fillListLeft(int leftEdge, final int dx) {
while(leftEdge + dx > 0 && mLeftViewIndex >= 0) { while (leftEdge + dx > 0 && mLeftViewIndex >= 0) {
View v = null; View v = null;
int type = mAdapter.getItemViewType(mLeftViewIndex); int type = mAdapter.getItemViewType(mLeftViewIndex);
LinkedList<View> list = mRemovedViewQueue.get(type); LinkedList<View> list = mRemovedViewQueue.get(type);
@ -252,44 +247,43 @@ public class HorizontalListView extends AdapterView<ListAdapter> {
private void removeNonVisibleItems(final int dx) { private void removeNonVisibleItems(final int dx) {
View child = getChildAt(0); View child = getChildAt(0);
while(child != null && child.getRight() + dx <= 0) { while (child != null && child.getRight() + dx <= 0) {
mDisplayOffset += child.getMeasuredWidth(); mDisplayOffset += child.getMeasuredWidth();
int type = (Integer)child.getTag(R.string.CacheTag); int type = (Integer) child.getTag(R.string.CacheTag);
LinkedList<View> list = mRemovedViewQueue.get(type); LinkedList<View> list = mRemovedViewQueue.get(type);
if (list == null) { if (list == null) {
list = new LinkedList<View>(); list = new LinkedList<View>();
mRemovedViewQueue.put(type, list); mRemovedViewQueue.put(type, list);
} }
list.offer(child); list.add(child);
removeViewInLayout(child); removeViewInLayout(child);
mLeftViewIndex++; mLeftViewIndex++;
child = getChildAt(0); child = getChildAt(0);
} }
child = getChildAt(getChildCount() - 1); child = getChildAt(getChildCount() - 1);
while(child != null && child.getLeft() + dx >= getWidth()) { while (child != null && child.getLeft() + dx >= getWidth()) {
int type = (Integer)child.getTag(R.string.CacheTag); int type = (Integer) child.getTag(R.string.CacheTag);
LinkedList<View> list = mRemovedViewQueue.get(type); LinkedList<View> list = mRemovedViewQueue.get(type);
if (list == null) { if (list == null) {
list = new LinkedList<View>(); list = new LinkedList<View>();
mRemovedViewQueue.put(type, list); mRemovedViewQueue.put(type, list);
} }
list.offer(child); list.add(child);
removeViewInLayout(child); removeViewInLayout(child);
mRightViewIndex--; mRightViewIndex--;
child = getChildAt(getChildCount()-1); child = getChildAt(getChildCount() - 1);
} }
} }
private void positionItems(final int dx) { private void positionItems(final int dx) {
if(getChildCount() > 0){ if (getChildCount() > 0) {
mDisplayOffset += dx; mDisplayOffset += dx;
int left = mDisplayOffset; int left = mDisplayOffset;
for(int i=0;i<getChildCount();i++){ for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i); View child = getChildAt(i);
int childWidth = child.getMeasuredWidth(); int childWidth = child.getMeasuredWidth();
child.layout(left + getPaddingLeft(), 0, left + childWidth + getPaddingLeft(), child.getMeasuredHeight()); child.layout(left + getPaddingLeft(), 0, left + childWidth + getPaddingLeft(), child.getMeasuredHeight());
@ -316,10 +310,9 @@ public class HorizontalListView extends AdapterView<ListAdapter> {
return super.onInterceptTouchEvent(ev); return super.onInterceptTouchEvent(ev);
} }
protected boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, protected boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
float velocityY) { synchronized (HorizontalListView.this) {
synchronized(HorizontalListView.this){ mScroller.fling(mNextX, 0, (int) -velocityX, 0, 0, mMaxX, 0, 0);
mScroller.fling(mNextX, 0, (int)-velocityX, 0, 0, mMaxX, 0, 0);
} }
requestLayout(); requestLayout();
@ -339,37 +332,32 @@ public class HorizontalListView extends AdapterView<ListAdapter> {
} }
@Override @Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
float velocityY) {
return HorizontalListView.this.onFling(e1, e2, velocityX, velocityY); return HorizontalListView.this.onFling(e1, e2, velocityX, velocityY);
} }
@Override @Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
float distanceX, float distanceY) { synchronized (HorizontalListView.this) {
mNextX += (int) distanceX;
synchronized(HorizontalListView.this){
mNextX += (int)distanceX;
} }
requestLayout(); requestLayout();
return true; return true;
} }
@Override @Override
public boolean onSingleTapUp(MotionEvent e) { public boolean onSingleTapUp(MotionEvent e) {
for(int i=0;i<getChildCount();i++){ for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i); View child = getChildAt(i);
if (isEventWithinView(e, child)) { if (isEventWithinView(e, child)) {
if(mOnItemClicked != null){ if (mOnItemClicked != null) {
mOnItemClicked.onItemClick(HorizontalListView.this, child, mLeftViewIndex + 1 + i, mAdapter.getItemId( mLeftViewIndex + 1 + i )); mOnItemClicked.onItemClick(HorizontalListView.this, child, mLeftViewIndex + 1 + i, mAdapter.getItemId(mLeftViewIndex + 1 + i));
} }
if(mOnItemSelected != null){ if (mOnItemSelected != null) {
mOnItemSelected.onItemSelected(HorizontalListView.this, child, mLeftViewIndex + 1 + i, mAdapter.getItemId( mLeftViewIndex + 1 + i )); mOnItemSelected.onItemSelected(HorizontalListView.this, child, mLeftViewIndex + 1 + i, mAdapter.getItemId(mLeftViewIndex + 1 + i));
} }
break; break;
} }
} }
return true; return true;
} }
@ -385,7 +373,6 @@ public class HorizontalListView extends AdapterView<ListAdapter> {
} }
break; break;
} }
} }
} }

View File

@ -24,10 +24,14 @@ public class RoundProgressView {
paint = new Paint(); paint = new Paint();
paint.setColor(0xffffffff); paint.setColor(0xffffffff);
paint.setStyle(Paint.Style.STROKE); paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(AndroidUtilities.dp(1)); paint.setStrokeWidth(AndroidUtilities.dp(2));
paint.setAntiAlias(true); paint.setAntiAlias(true);
} }
public void setColor(int color) {
paint.setColor(color);
}
public void setProgress(float progress) { public void setProgress(float progress) {
currentProgress = progress; currentProgress = progress;
if (currentProgress < 0) { if (currentProgress < 0) {

BIN
TMessagesProj/src/main/res/drawable-hdpi/doc_blue.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 869 B

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
TMessagesProj/src/main/res/drawable-hdpi/doc_green.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 875 B

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
TMessagesProj/src/main/res/drawable-ldpi/doc_blue.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
TMessagesProj/src/main/res/drawable-ldpi/doc_green.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 490 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
TMessagesProj/src/main/res/drawable-mdpi/doc_blue.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 B

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
TMessagesProj/src/main/res/drawable-mdpi/doc_green.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 587 B

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
TMessagesProj/src/main/res/drawable-xhdpi/doc_blue.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
TMessagesProj/src/main/res/drawable-xhdpi/doc_green.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
TMessagesProj/src/main/res/drawable-xxhdpi/doc_blue.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
TMessagesProj/src/main/res/drawable-xxhdpi/doc_green.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -1,134 +0,0 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="1dp"
android:paddingTop="1dp"
android:layout_gravity="top"
android:gravity="left">
<org.telegram.ui.Views.BackupImageView
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_marginLeft="6dp"
android:id="@+id/chat_group_avatar_image"
android:layout_marginBottom="2dp"
android:layout_marginRight="4dp"
android:layout_gravity="bottom"/>
<org.telegram.ui.Views.FrameLayoutFixed
android:orientation="horizontal"
android:layout_height="78dp"
android:layout_width="wrap_content"
android:paddingTop="9dp"
android:paddingLeft="18dp"
android:paddingRight="9dp"
android:layout_gravity="top|left"
android:id="@+id/chat_bubble_layout">
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_height="69dp"
android:layout_width="wrap_content"
android:layout_gravity="top|right"
android:id="@+id/shared_layout">
<org.telegram.ui.Views.BackupImageView
android:layout_width="42dp"
android:layout_height="42dp"
android:background="#40b7c9d7"
android:id="@+id/contact_avatar"/>
<org.telegram.ui.Views.TightTextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginTop="3dp"
android:textSize="14dp"
android:lines="1"
android:singleLine="true"
android:layout_gravity="top"
android:ellipsize="end"
android:maxLines="1"
android:textColor="#000000"
android:layout_marginRight="2dp"
android:id="@+id/chat_user_group_name"
android:layout_marginLeft="50dp"/>
<org.telegram.ui.Views.TightTextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="50dp"
android:singleLine="true"
android:layout_marginTop="22dp"
android:layout_gravity="top"
android:layout_marginRight="2dp"
android:textSize="11dp"
android:maxLines="1"
android:textColor="#9daab8"
android:id="@+id/phone_text_view"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/chat_time_text"
android:textColor="#a1aab3"
android:textSize="12dp"
android:layout_marginBottom="5dp"
android:layout_gravity="bottom|right"/>
</org.telegram.ui.Views.FrameLayoutFixed>
</org.telegram.ui.Views.FrameLayoutFixed>
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_height="wrap_content"
android:layout_width="140dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_gravity="center_vertical"
android:id="@+id/chat_view_action_layout"
android:visibility="gone">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:scaleType="centerInside"
android:layout_marginRight="4dp"
android:layout_gravity="right|center"
android:id="@+id/chat_view_action_cancel_button"
android:src="@drawable/ic_msg_btn_cross_custom"
android:clickable="true"/>
<ProgressBar
android:layout_width="fill_parent"
android:layout_height="3dp"
android:layout_gravity="left|center_vertical"
android:progressDrawable="@drawable/progress_chat"
style="?android:attr/progressBarStyleHorizontal"
android:progress="50"
android:layout_marginLeft="12dp"
android:layout_marginRight="36dp"
android:id="@+id/chat_view_action_progress"
android:max="100"/>
</org.telegram.ui.Views.FrameLayoutFixed>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#54759e"
android:background="@drawable/chat_incoming_media_states"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:id="@+id/chat_view_action_button"
android:textSize="14dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:descendantFocusability="blocksDescendants"
android:clickable="true"
android:gravity="center|left"
android:visibility="gone"
android:textStyle="bold"
android:layout_gravity="center_vertical|left"/>
</LinearLayout>

View File

@ -1,75 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="1dp"
android:paddingTop="1dp"
android:layout_gravity="top">
<org.telegram.ui.Views.BackupImageView
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_marginLeft="6dp"
android:id="@+id/chat_group_avatar_image"
android:layout_marginBottom="2dp"
android:layout_gravity="bottom"/>
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="13dp"
android:layout_gravity="top"
android:id="@+id/chat_bubble_layout"
android:addStatesFromChildren="true">
<org.telegram.ui.Views.BackupImageView
android:layout_height="100dp"
android:layout_width="100dp"
android:layout_margin="6dp"
android:layout_gravity="top"
android:id="@+id/chat_photo_image"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="16dp"
android:id="@+id/chat_time_layout"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:layout_gravity="right|bottom"
android:background="@drawable/phototime">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textColor="#ffffff"
android:textSize="12dp"
android:layout_gravity="bottom"
android:layout_marginBottom="1dp"
android:id="@+id/chat_time_text"/>
</LinearLayout>
</org.telegram.ui.Views.FrameLayoutFixed>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:textStyle="bold"
android:id="@+id/chat_view_action_button"
android:layout_gravity="center"
android:gravity="center"
android:textSize="14dp"
android:textColor="#54759e"
android:background="@drawable/chat_incoming_media_states"
android:descendantFocusability="blocksDescendants"
android:clickable="true"
android:layout_marginLeft="10dp"/>
</LinearLayout>

View File

@ -1,126 +0,0 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="1dp"
android:paddingTop="1dp"
android:layout_gravity="top"
android:gravity="left">
<org.telegram.ui.Views.FrameLayoutFixed
android:orientation="horizontal"
android:layout_height="78dp"
android:layout_width="wrap_content"
android:paddingTop="9dp"
android:paddingLeft="18dp"
android:paddingRight="9dp"
android:layout_gravity="top|left"
android:id="@+id/chat_bubble_layout">
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_height="69dp"
android:layout_width="wrap_content"
android:layout_gravity="top|right"
android:id="@+id/shared_layout">
<org.telegram.ui.Views.BackupImageView
android:layout_width="42dp"
android:layout_height="42dp"
android:background="#40b7c9d7"
android:src="@drawable/doc_blue"
android:id="@+id/contact_avatar"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:scrollHorizontally="true"
android:layout_marginTop="3dp"
android:textSize="14dp"
android:lines="1"
android:singleLine="true"
android:layout_marginRight="2dp"
android:layout_gravity="top"
android:ellipsize="end"
android:textColor="#000000"
android:id="@+id/chat_user_group_name"
android:maxLines="1"
android:layout_marginLeft="50dp"/>
<TextView android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginTop="22dp"
android:layout_gravity="top"
android:layout_marginRight="2dp"
android:textSize="11dp"
android:maxLines="1"
android:singleLine="true"
android:textColor="#9daab8"
android:id="@+id/phone_text_view"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/chat_time_text"
android:textColor="#a1aab3"
android:textSize="12dp"
android:layout_gravity="bottom|right"
android:layout_marginBottom="5dp"/>
</org.telegram.ui.Views.FrameLayoutFixed>
</org.telegram.ui.Views.FrameLayoutFixed>
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_height="wrap_content"
android:layout_width="140dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_gravity="center_vertical"
android:id="@+id/chat_view_action_layout"
android:visibility="gone">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:scaleType="centerInside"
android:layout_marginRight="4dp"
android:layout_gravity="right|center"
android:id="@+id/chat_view_action_cancel_button"
android:src="@drawable/ic_msg_btn_cross_custom"
android:clickable="true"/>
<ProgressBar
android:layout_width="fill_parent"
android:layout_height="3dp"
android:layout_gravity="left|center_vertical"
android:progressDrawable="@drawable/progress_chat"
style="?android:attr/progressBarStyleHorizontal"
android:progress="50"
android:layout_marginLeft="12dp"
android:layout_marginRight="36dp"
android:id="@+id/chat_view_action_progress"
android:max="100"/>
</org.telegram.ui.Views.FrameLayoutFixed>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#54759e"
android:background="@drawable/chat_incoming_media_states"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:id="@+id/chat_view_action_button"
android:textSize="14dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:descendantFocusability="blocksDescendants"
android:clickable="true"
android:gravity="center"
android:visibility="gone"
android:textStyle="bold"
android:layout_gravity="center_vertical"/>
</LinearLayout>

View File

@ -1,69 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="1dp"
android:paddingTop="1dp"
android:layout_gravity="top">
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="9dp"
android:id="@+id/chat_bubble_layout"
android:layout_gravity="top"
android:addStatesFromChildren="true">
<org.telegram.ui.Views.BackupImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_margin="6dp"
android:layout_gravity="top"
android:minHeight="100dp"
android:minWidth="100dp"
android:id="@+id/chat_photo_image"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="16dp"
android:id="@+id/chat_time_layout"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:layout_gravity="right|bottom"
android:background="@drawable/phototime">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textColor="#ffffff"
android:textSize="12dp"
android:layout_gravity="bottom"
android:layout_marginBottom="1dp"
android:id="@+id/chat_time_text"/>
</LinearLayout>
</org.telegram.ui.Views.FrameLayoutFixed>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#54759e"
android:background="@drawable/chat_incoming_media_states"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:layout_gravity="center"
android:gravity="center"
android:textStyle="bold"
android:id="@+id/chat_view_action_button"
android:textSize="14dp"
android:layout_marginLeft="10dp"
android:descendantFocusability="blocksDescendants"
android:clickable="true"/>
</LinearLayout>

View File

@ -1,152 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="1dp"
android:paddingTop="1dp"
android:layout_gravity="top"
android:gravity="right">
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_height="wrap_content"
android:layout_width="140dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:id="@+id/chat_view_action_layout"
android:layout_gravity="center"
android:visibility="gone">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:scaleType="centerInside"
android:layout_marginLeft="4dp"
android:id="@+id/chat_view_action_cancel_button"
android:src="@drawable/ic_msg_btn_cross_custom"
android:layout_gravity="left|center"
android:clickable="true"/>
<ProgressBar
android:layout_width="fill_parent"
android:layout_height="3dp"
style="?android:attr/progressBarStyleHorizontal"
android:progress="50"
android:layout_marginLeft="36dp"
android:layout_marginRight="12dp"
android:layout_gravity="right|center_vertical"
android:progressDrawable="@drawable/progress_chat"
android:id="@+id/chat_view_action_progress"
android:max="100"/>
</org.telegram.ui.Views.FrameLayoutFixed>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#54759e"
android:background="@drawable/chat_incoming_media_states"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:id="@+id/chat_view_action_button"
android:textSize="14dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:descendantFocusability="blocksDescendants"
android:clickable="true"
android:gravity="center"
android:visibility="gone"
android:textStyle="bold"
android:layout_gravity="center"/>
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_height="78dp"
android:layout_width="wrap_content"
android:paddingTop="9dp"
android:paddingLeft="9dp"
android:paddingRight="18dp"
android:layout_gravity="top|right"
android:id="@+id/chat_bubble_layout">
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_height="69dp"
android:layout_width="wrap_content"
android:layout_gravity="top|right"
android:id="@+id/shared_layout">
<org.telegram.ui.Views.BackupImageView
android:layout_width="42dp"
android:layout_height="42dp"
android:background="#408ed057"
android:id="@+id/contact_avatar"/>
<org.telegram.ui.Views.TightTextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:scrollHorizontally="true"
android:layout_marginTop="3dp"
android:textSize="14dp"
android:lines="1"
android:singleLine="true"
android:layout_marginRight="2dp"
android:layout_gravity="top"
android:ellipsize="end"
android:textColor="#000000"
android:id="@+id/chat_user_group_name"
android:layout_marginLeft="50dp"/>
<org.telegram.ui.Views.TightTextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginTop="22dp"
android:layout_gravity="top"
android:layout_marginRight="2dp"
android:textSize="11dp"
android:maxLines="1"
android:textColor="#75b166"
android:id="@+id/phone_text_view"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/chat_time_layout"
android:layout_gravity="bottom|right"
android:layout_marginBottom="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/chat_time_text"
android:textColor="#70b15c"
android:textSize="12dp"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/msg_check"
android:layout_marginTop="2dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="-8dp"
android:id="@+id/chat_row_check"
android:visibility="visible"
android:layout_gravity="top"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/msg_halfcheck"
android:layout_marginTop="2dp"
android:id="@+id/chat_row_halfcheck"
android:visibility="visible"
android:layout_gravity="top"/>
</LinearLayout>
</org.telegram.ui.Views.FrameLayoutFixed>
</org.telegram.ui.Views.FrameLayoutFixed>
</LinearLayout>

View File

@ -1,90 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:paddingBottom="1dp"
android:paddingTop="1dp"
android:layout_gravity="top">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#54759e"
android:background="@drawable/chat_incoming_media_states"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:id="@+id/chat_view_action_button"
android:textSize="14dp"
android:layout_marginRight="10dp"
android:textStyle="bold"
android:descendantFocusability="blocksDescendants"
android:clickable="true"
android:gravity="center"
android:layout_gravity="center"/>
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="9dp"
android:id="@+id/chat_bubble_layout"
android:layout_gravity="top"
android:addStatesFromChildren="true">
<org.telegram.ui.Views.BackupImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_margin="6dp"
android:layout_gravity="top"
android:minHeight="100dp"
android:minWidth="100dp"
android:id="@+id/chat_photo_image"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="16dp"
android:id="@+id/chat_time_layout"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:layout_gravity="right|bottom"
android:background="@drawable/phototime">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textColor="#ffffff"
android:textSize="12dp"
android:layout_gravity="bottom"
android:layout_marginBottom="1dp"
android:id="@+id/chat_time_text"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/msg_check_w"
android:layout_marginTop="1dp"
android:layout_marginLeft="3dp"
android:layout_marginRight="-8dp"
android:id="@+id/chat_row_check"
android:visibility="visible"
android:layout_gravity="top"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="1dp"
android:id="@+id/chat_row_halfcheck"
android:visibility="visible"
android:src="@drawable/msg_halfcheck_w"
android:layout_gravity="top"/>
</LinearLayout>
</org.telegram.ui.Views.FrameLayoutFixed>
</LinearLayout>

View File

@ -11,14 +11,14 @@
<!--signin view--> <!--signin view-->
<string name="YourPhone">Il tuo telefono</string> <string name="YourPhone">Il tuo telefono</string>
<string name="StartText">Conferma il prefisso della tua nazione \ne inserisci il tuo numero di telefono.</string> <string name="StartText">Conferma il prefisso della tua nazione\ne inserisci il tuo numero di telefono.</string>
<string name="ChooseCountry">Scegli una nazione</string> <string name="ChooseCountry">Scegli una nazione</string>
<string name="WrongCountry">Prefisso errato</string> <string name="WrongCountry">Prefisso errato</string>
<!--code enter view--> <!--code enter view-->
<string name="YourCode">Il tuo codice</string> <string name="YourCode">Il tuo codice</string>
<string name="SentSmsCode">Abbiamo inviato un SMS al tuo telefono con il codice di attivazione</string> <string name="SentSmsCode">Abbiamo inviato un SMS al tuo telefono con il codice di attivazione</string>
<string name="CallText">Ti chiameremo tra</string> <string name="CallText">Ti telefoneremo tra</string>
<string name="Calling">Ti stiamo chiamando…</string> <string name="Calling">Ti stiamo chiamando…</string>
<string name="Code">Codice</string> <string name="Code">Codice</string>
<string name="WrongNumber">Numero errato?</string> <string name="WrongNumber">Numero errato?</string>
@ -58,11 +58,11 @@
<string name="SelectChat">Seleziona chat</string> <string name="SelectChat">Seleziona chat</string>
<!--broadcasts--> <!--broadcasts-->
<string name="BroadcastList">Lista Broadcast</string> <string name="BroadcastList">Lista broadcast</string>
<string name="NewBroadcastList">Nuova Lista Broadcast</string> <string name="NewBroadcastList">Nuova lista broadcast</string>
<string name="EnterListName">Immetti il nome della lista</string> <string name="EnterListName">Immetti il nome della lista</string>
<string name="YouCreatedBroadcastList">Hai creato una lista broadcast</string> <string name="YouCreatedBroadcastList">Hai creato una lista broadcast</string>
<string name="AddRecipient">Aggiungi Destinatario</string> <string name="AddRecipient">Aggiungi destinatario</string>
<string name="KickFromBroadcast">Rimuovi dalla lista broadcast</string> <string name="KickFromBroadcast">Rimuovi dalla lista broadcast</string>
<!--documents view--> <!--documents view-->
@ -76,12 +76,12 @@
<string name="UsbActive">Trasferimento USB attivo</string> <string name="UsbActive">Trasferimento USB attivo</string>
<string name="InternalStorage">Archiviazione interna</string> <string name="InternalStorage">Archiviazione interna</string>
<string name="ExternalStorage">Archiviazione esterna</string> <string name="ExternalStorage">Archiviazione esterna</string>
<string name="SystemRoot">Radice di sistema</string> <string name="SystemRoot">Root di sistema</string>
<string name="SdCard">Scheda SD</string> <string name="SdCard">Scheda SD</string>
<!--chat view--> <!--chat view-->
<string name="Invisible">invisibile</string> <string name="Invisible">invisibile</string>
<string name="Typing">scrivendo…</string> <string name="Typing">sta scrivendo…</string>
<string name="Attach">Allega</string> <string name="Attach">Allega</string>
<string name="IsTyping">sta scrivendo…</string> <string name="IsTyping">sta scrivendo…</string>
<string name="AreTyping">stanno scrivendo…</string> <string name="AreTyping">stanno scrivendo…</string>
@ -104,10 +104,10 @@
<string name="Selected">Selezionati: %d</string> <string name="Selected">Selezionati: %d</string>
<string name="ShareMyContactInfo">CONDIVIDI LE MIE INFORMAZIONI DI CONTATTO</string> <string name="ShareMyContactInfo">CONDIVIDI LE MIE INFORMAZIONI DI CONTATTO</string>
<string name="AddToContacts">AGGIUNGI AI CONTATTI</string> <string name="AddToContacts">AGGIUNGI AI CONTATTI</string>
<string name="EncryptedPlaceholderTitleIncoming">%s ti ha mandato un invito a una chat privata.</string> <string name="EncryptedPlaceholderTitleIncoming">%s ti ha mandato un invito a una chat segreta.</string>
<string name="EncryptedPlaceholderTitleOutgoing">Hai invitato %s a entrare in una chat segreta.</string> <string name="EncryptedPlaceholderTitleOutgoing">Hai invitato %s a entrare in una chat segreta.</string>
<string name="EncryptedDescriptionTitle">Chat segrete:</string> <string name="EncryptedDescriptionTitle">Chat segrete:</string>
<string name="EncryptedDescription1">Utilizzano la cifratura punto-punto</string> <string name="EncryptedDescription1">Utilizzano la crittografia end-to-end</string>
<string name="EncryptedDescription2">Non lasciano traccia sui nostri server</string> <string name="EncryptedDescription2">Non lasciano traccia sui nostri server</string>
<string name="EncryptedDescription3">Hanno un contatore di autodistruzione</string> <string name="EncryptedDescription3">Hanno un contatore di autodistruzione</string>
<string name="EncryptedDescription4">Non permettono linoltro</string> <string name="EncryptedDescription4">Non permettono linoltro</string>
@ -115,7 +115,7 @@
<string name="YouLeft">Hai lasciato il gruppo</string> <string name="YouLeft">Hai lasciato il gruppo</string>
<string name="DeleteThisGroup">Elimina questo gruppo</string> <string name="DeleteThisGroup">Elimina questo gruppo</string>
<string name="DeleteThisChat">Elimina questa chat</string> <string name="DeleteThisChat">Elimina questa chat</string>
<string name="SlideToCancel">TRASCINA PER ANNULLARE</string> <string name="SlideToCancel">CANCELLA</string>
<string name="SaveToDownloads">Salva in download</string> <string name="SaveToDownloads">Salva in download</string>
<string name="ApplyLocalizationFile">Applica file di localizzazione</string> <string name="ApplyLocalizationFile">Applica file di localizzazione</string>
<string name="UnsupportedAttachment">Allegato non supportato</string> <string name="UnsupportedAttachment">Allegato non supportato</string>
@ -123,10 +123,10 @@
<!--notification--> <!--notification-->
<string name="EncryptedChatRequested">Chat segreta richiesta</string> <string name="EncryptedChatRequested">Chat segreta richiesta</string>
<string name="EncryptedChatAccepted">Chat segreta iniziata</string> <string name="EncryptedChatAccepted">Chat segreta iniziata</string>
<string name="MessageLifetimeChanged">%1$s imposta il contatore di autodistruzione a %2$s</string> <string name="MessageLifetimeChanged">%1$s ha impostato il timer di autodistruzione a %2$s</string>
<string name="MessageLifetimeChangedOutgoing">Hai impostato il contatore di autodistruzione a %1$s</string> <string name="MessageLifetimeChangedOutgoing">Hai impostato il timer di autodistruzione a %1$s</string>
<string name="MessageLifetimeRemoved">%1$s ha disabilitato il contatore di autodistruzione</string> <string name="MessageLifetimeRemoved">%1$s ha disabilitato il timer di autodistruzione</string>
<string name="MessageLifetimeYouRemoved">Hai disabilitato il contatore di autodistruzione</string> <string name="MessageLifetimeYouRemoved">Hai disabilitato il timer di autodistruzione</string>
<string name="MessageLifetime2s">2 secondi</string> <string name="MessageLifetime2s">2 secondi</string>
<string name="MessageLifetime5s">5 secondi</string> <string name="MessageLifetime5s">5 secondi</string>
<string name="MessageLifetime1m">1 minuto</string> <string name="MessageLifetime1m">1 minuto</string>
@ -141,7 +141,7 @@
<string name="NotificationMessageContact">%1$s ha condiviso un contatto con te</string> <string name="NotificationMessageContact">%1$s ha condiviso un contatto con te</string>
<string name="NotificationMessageMap">%1$s ti ha inviato una posizione</string> <string name="NotificationMessageMap">%1$s ti ha inviato una posizione</string>
<string name="NotificationMessageDocument">%1$s ti ha inviato un documento</string> <string name="NotificationMessageDocument">%1$s ti ha inviato un documento</string>
<string name="NotificationMessageAudio">%1$s ti ha inviato dell\'audio</string> <string name="NotificationMessageAudio">%1$s ti ha inviato un audio</string>
<string name="NotificationMessageGroupText">%1$s @ %2$s: %3$s</string> <string name="NotificationMessageGroupText">%1$s @ %2$s: %3$s</string>
<string name="NotificationMessageGroupNoText">%1$s ha inviato un messaggio al gruppo %2$s</string> <string name="NotificationMessageGroupNoText">%1$s ha inviato un messaggio al gruppo %2$s</string>
<string name="NotificationMessageGroupPhoto">%1$s ha inviato una foto al gruppo %2$s</string> <string name="NotificationMessageGroupPhoto">%1$s ha inviato una foto al gruppo %2$s</string>
@ -149,7 +149,7 @@
<string name="NotificationMessageGroupContact">%1$s ha condiviso un contatto con il gruppo %2$s</string> <string name="NotificationMessageGroupContact">%1$s ha condiviso un contatto con il gruppo %2$s</string>
<string name="NotificationMessageGroupMap">%1$s ha inviato una posizione al gruppo %2$s</string> <string name="NotificationMessageGroupMap">%1$s ha inviato una posizione al gruppo %2$s</string>
<string name="NotificationMessageGroupDocument">%1$s ha inviato un documento al gruppo %2$s</string> <string name="NotificationMessageGroupDocument">%1$s ha inviato un documento al gruppo %2$s</string>
<string name="NotificationMessageGroupAudio">%1$s ha inviato dell\'audio al gruppo %2$s</string> <string name="NotificationMessageGroupAudio">%1$s ha inviato un audio al gruppo %2$s</string>
<string name="NotificationInvitedToGroup">%1$s ti ha invitato nel gruppo %2$s</string> <string name="NotificationInvitedToGroup">%1$s ti ha invitato nel gruppo %2$s</string>
<string name="NotificationEditedGroupName">%1$s ha modificato il nome del gruppo %2$s</string> <string name="NotificationEditedGroupName">%1$s ha modificato il nome del gruppo %2$s</string>
<string name="NotificationEditedGroupPhoto">%1$s ha modificato la foto del gruppo %2$s</string> <string name="NotificationEditedGroupPhoto">%1$s ha modificato la foto del gruppo %2$s</string>
@ -158,9 +158,9 @@
<string name="NotificationGroupKickYou">%1$s ti ha rimosso dal gruppo %2$s</string> <string name="NotificationGroupKickYou">%1$s ti ha rimosso dal gruppo %2$s</string>
<string name="NotificationGroupLeftMember">%1$s ha lasciato il gruppo %2$s</string> <string name="NotificationGroupLeftMember">%1$s ha lasciato il gruppo %2$s</string>
<string name="NotificationContactJoined">%1$s ha iniziato a usare Telegram!</string> <string name="NotificationContactJoined">%1$s ha iniziato a usare Telegram!</string>
<string name="NotificationUnrecognizedDevice">%1$s,\nAbbiamo rilevato un accesso al tuo account da un nuovo dispositivo %2$s\n\nDispositivo: %3$s\nPosizione: %4$s\n\nSe non sei stato tu, puoi andare su Impostazioni - Termina tutte le sessioni.\n\nGrazie,\nIl Team di Telegram</string> <string name="NotificationUnrecognizedDevice">%1$s,\nAbbiamo rilevato un accesso al tuo account da un nuovo dispositivo %2$s\n\nDispositivo: %3$s\nPosizione: %4$s\n\nSe non sei stato tu, puoi andare su Impostazioni - Termina tutte le sessioni.\n\nGrazie,\nil team di Telegram</string>
<string name="NotificationContactNewPhoto">%1$s ha aggiornato la foto del profilo</string> <string name="NotificationContactNewPhoto">%1$s ha aggiornato la foto del profilo</string>
<string name="Reply">Reply</string> <string name="Reply">Rispondi</string>
<!--contacts view--> <!--contacts view-->
<string name="SelectContact">Seleziona contatto</string> <string name="SelectContact">Seleziona contatto</string>
@ -211,7 +211,7 @@
<string name="CreateEncryptedChatOutdatedError">Impossibile creare una chat segreta con %1$s.\n\n%2$s sta usando una vecchia versione di Telegram e deve prima aggiornarla.</string> <string name="CreateEncryptedChatOutdatedError">Impossibile creare una chat segreta con %1$s.\n\n%2$s sta usando una vecchia versione di Telegram e deve prima aggiornarla.</string>
<string name="SecretTitle">Chat segreta</string> <string name="SecretTitle">Chat segreta</string>
<string name="EncryptionKey">Chiave di cifratura</string> <string name="EncryptionKey">Chiave di cifratura</string>
<string name="MessageLifetime">Contatore di autodistruzione</string> <string name="MessageLifetime">Timer di autodistruzione</string>
<string name="ShortMessageLifetimeForever">Spento</string> <string name="ShortMessageLifetimeForever">Spento</string>
<string name="ShortMessageLifetime2s">2s</string> <string name="ShortMessageLifetime2s">2s</string>
<string name="ShortMessageLifetime5s">5s</string> <string name="ShortMessageLifetime5s">5s</string>
@ -259,37 +259,37 @@
<string name="ContactJoined">Un contatto si è collegato a Telegram</string> <string name="ContactJoined">Un contatto si è collegato a Telegram</string>
<string name="Pebble">PEBBLE</string> <string name="Pebble">PEBBLE</string>
<string name="Language">Lingua</string> <string name="Language">Lingua</string>
<string name="AskAQuestionInfo">Nota che il supporto di Telegram è fornito da volontari. Proviamo a rispondere non appena possibile, ma potrebbe richiedere del tempo.<![CDATA[<br><br>]]>Dai un\'occhiata alle <![CDATA[<a href="http://telegram.org/faq#general">Domande frequenti</a>]]>: troverai risposte alla maggior parte delle domande e suggerimenti importanti per <![CDATA[<a href="http://telegram.org/faq#troubleshooting">l\'individuazione del problema</a>]]>.</string> <string name="AskAQuestionInfo">Nota che il supporto di Telegram è fornito da volontari. Proviamo a rispondere non appena possibile, ma potrebbe richiedere del tempo.<![CDATA[<br><br>]]>Dai un\'occhiata alle <![CDATA[<a href=\"https://telegram.org/faq/it#domande-generali\">Domande frequenti</a>]]>: troverai risposte alla maggior parte delle domande e suggerimenti importanti per <![CDATA[<a href=\"https://telegram.org/faq/it#risoluzione-dei-problemi\">l\'individuazione del problema</a>]]>.</string>
<string name="AskButton">Chiedi a un volontario</string> <string name="AskButton">Chiedi a un volontario</string>
<string name="TelegramFaq">Domande frequenti</string> <string name="TelegramFaq">Domande frequenti</string>
<string name="TelegramFaqUrl">https://telegram.org/faq</string> <string name="TelegramFaqUrl">https://telegram.org/faq/it</string>
<string name="DeleteLocalization">Eliminare la localizzazione?</string> <string name="DeleteLocalization">Eliminare la localizzazione?</string>
<string name="IncorrectLocalization">File della localizzazione non valido</string> <string name="IncorrectLocalization">File della localizzazione non valido</string>
<string name="Enabled">Abilitato</string> <string name="Enabled">Abilitato</string>
<string name="Disabled">Disabilitato</string> <string name="Disabled">Disabilitato</string>
<string name="NotificationsService">Servizio notifiche</string> <string name="NotificationsService">Servizio notifiche</string>
<string name="NotificationsServiceDisableInfo">Se i servizi di Google Play sono sufficienti per ricevere le notifiche, è possibile disabilitare il Servizio Notifiche. Ti raccomandiamo comunque di lasciarlo abilitato per lasciare l\'app attiva in background e ricevere le notifiche istantanee.</string> <string name="NotificationsServiceDisableInfo">Se i servizi di Google Play sono sufficienti per ricevere le notifiche, è possibile disabilitare il Servizio notifiche. Ti raccomandiamo comunque di lasciarlo abilitato per lasciare l\'app attiva in background e ricevere le notifiche istantanee.</string>
<string name="SortBy">Ordina per</string> <string name="SortBy">Ordina per</string>
<string name="ImportContacts">Importa contatti</string> <string name="ImportContacts">Importa contatti</string>
<string name="WiFiOnly">Solo tramite WiFi</string> <string name="WiFiOnly">Solo tramite WiFi</string>
<string name="SortFirstName">Nome</string> <string name="SortFirstName">Nome</string>
<string name="SortLastName">Cognome</string> <string name="SortLastName">Cognome</string>
<string name="LedColor">Colore LED</string> <string name="LedColor">Colore LED</string>
<string name="PopupNotification">Notifiche Popup</string> <string name="PopupNotification">Notifiche popup</string>
<string name="NoPopup">Nessun popup</string> <string name="NoPopup">Nessun popup</string>
<string name="OnlyWhenScreenOn">Solo con schermo acceso</string> <string name="OnlyWhenScreenOn">Solo con schermo acceso</string>
<string name="OnlyWhenScreenOff">Solo con schermo spento</string> <string name="OnlyWhenScreenOff">Solo con schermo spento</string>
<string name="AlwaysShowPopup">Mostra sempre i popup</string> <string name="AlwaysShowPopup">Mostra sempre i popup</string>
<string name="BadgeNumber">Contatore Badge</string> <string name="BadgeNumber">Contatore Badge</string>
<string name="Short">Short</string> <string name="Short">Breve</string>
<string name="Long">Long</string> <string name="Long">Lungo</string>
<string name="SystemDefault">System default</string> <string name="SystemDefault">Predefinito di sistema</string>
<string name="SettingsDefault">Settings default</string> <string name="SettingsDefault">Impostazioni predefinite</string>
<string name="AutomaticMediaDownload">AUTOMATIC MEDIA DOWNLOAD</string> <string name="AutomaticMediaDownload">SCARICAMENTO AUTOMATICO MEDIA</string>
<string name="WhenUsingMobileData">When using mobile data</string> <string name="WhenUsingMobileData">Quando si utilizza la rete dati</string>
<string name="WhenConnectedOnWiFi">When connected on Wi-Fi</string> <string name="WhenConnectedOnWiFi">Quando si utilizza il Wi-Fi</string>
<string name="WhenRoaming">When roaming</string> <string name="WhenRoaming">In roaming</string>
<string name="NoMediaAutoDownload">No media</string> <string name="NoMediaAutoDownload">Nessun media</string>
<!--media view--> <!--media view-->
<string name="NoMedia">Nessun media condiviso</string> <string name="NoMedia">Nessun media condiviso</string>
@ -314,9 +314,9 @@
<string name="NoPhotos">Ancora nessuna foto</string> <string name="NoPhotos">Ancora nessuna foto</string>
<!--edit video view--> <!--edit video view-->
<string name="EditVideo">Modifica Video</string> <string name="EditVideo">Modifica video</string>
<string name="OriginalVideo">Video Originale</string> <string name="OriginalVideo">Video originale</string>
<string name="EditedVideo">Video Modificato</string> <string name="EditedVideo">Video modificato</string>
<!--button titles--> <!--button titles-->
<string name="Next">Avanti</string> <string name="Next">Avanti</string>
@ -376,8 +376,8 @@
<string name="InvalidLastName">Cognome non valido</string> <string name="InvalidLastName">Cognome non valido</string>
<string name="Loading">Caricamento…</string> <string name="Loading">Caricamento…</string>
<string name="NoPlayerInstalled">Non hai un lettore video, per favore installane uno per continuare</string> <string name="NoPlayerInstalled">Non hai un lettore video, per favore installane uno per continuare</string>
<string name="NoMailInstalled">Invia unemail a sms@telegram.org e parlaci del tuo problema.</string> <string name="NoMailInstalled">Invia unemail a sms@telegram.org spiegandoci il problema.</string>
<string name="NoHandleAppInstalled">Nessuna applicazione può gestire il tipo di file \'%1$s\', per favore installane una per proseguire</string> <string name="NoHandleAppInstalled">Non hai nessuna applicazione che può gestire il tipo di file \'%1$s\': installane una per proseguire</string>
<string name="InviteUser">Questo utente non ha ancora Telegram, vuoi invitarlo?</string> <string name="InviteUser">Questo utente non ha ancora Telegram, vuoi invitarlo?</string>
<string name="AreYouSure">Sei sicuro?</string> <string name="AreYouSure">Sei sicuro?</string>
<string name="AddContactQ">Vuoi aggiungere il contatto?</string> <string name="AddContactQ">Vuoi aggiungere il contatto?</string>

View File

@ -160,7 +160,7 @@
<string name="NotificationContactJoined">%1$s heeft nu Telegram!</string> <string name="NotificationContactJoined">%1$s heeft nu Telegram!</string>
<string name="NotificationUnrecognizedDevice">%1$s,\nEr is op je account ingelogd vanaf een nieuw apparaat op %2$s\n\nApparaat: %3$s\nLocatie: %4$s\n\nAls jij dit niet was, kun je alle sessies beëindigen via Instellingen Beëindig alle andere sessies.\n\nBedankt,\nHet Telegram-team</string> <string name="NotificationUnrecognizedDevice">%1$s,\nEr is op je account ingelogd vanaf een nieuw apparaat op %2$s\n\nApparaat: %3$s\nLocatie: %4$s\n\nAls jij dit niet was, kun je alle sessies beëindigen via Instellingen Beëindig alle andere sessies.\n\nBedankt,\nHet Telegram-team</string>
<string name="NotificationContactNewPhoto">%1$s heeft zijn/haar profielfoto gewijzigd</string> <string name="NotificationContactNewPhoto">%1$s heeft zijn/haar profielfoto gewijzigd</string>
<string name="Reply">Reply</string> <string name="Reply">Antwoord</string>
<!--contacts view--> <!--contacts view-->
<string name="SelectContact">Kies een contact</string> <string name="SelectContact">Kies een contact</string>
@ -259,7 +259,7 @@
<string name="ContactJoined">Contact lid geworden van Telegram</string> <string name="ContactJoined">Contact lid geworden van Telegram</string>
<string name="Pebble">PEBBLE</string> <string name="Pebble">PEBBLE</string>
<string name="Language">Taal</string> <string name="Language">Taal</string>
<string name="AskAQuestionInfo">Houd er rekening mee dat de ondersteuning van Telegram door vrijwilligers wordt gedaan. We doen ons best om zo snel mogelijk te antwoorden, maar het kan even even duren.<![CDATA[<br><br>]]>Bekijk ook de <![CDATA[<a href="http://telegram.org/faq#general">veelgestelde vragen</a>]]>: hier staan de antwoorden op de meeste vragen en belangrijke tips voor <![CDATA[<a href="http://telegram.org/faq#troubleshooting">het oplossen van problemen</a>]]>.</string> <string name="AskAQuestionInfo">Houd er rekening mee dat de ondersteuning van Telegram door vrijwilligers wordt gedaan. We doen ons best om zo snel mogelijk te antwoorden, maar het kan even even duren.<![CDATA[<br><br>]]>Bekijk ook de <![CDATA[<a href=\"http://telegram.org/faq#general\">veelgestelde vragen</a>]]>: hier staan de antwoorden op de meeste vragen en belangrijke tips voor <![CDATA[<a href=\"http://telegram.org/faq#troubleshooting\">het oplossen van problemen</a>]]>.</string>
<string name="AskButton">Vraag een vrijwilliger</string> <string name="AskButton">Vraag een vrijwilliger</string>
<string name="TelegramFaq">Veelgestelde vragen</string> <string name="TelegramFaq">Veelgestelde vragen</string>
<string name="TelegramFaqUrl">https://telegram.org/faq</string> <string name="TelegramFaqUrl">https://telegram.org/faq</string>
@ -281,15 +281,15 @@
<string name="OnlyWhenScreenOff">Alleen wanneer scherm \"uit\" staat</string> <string name="OnlyWhenScreenOff">Alleen wanneer scherm \"uit\" staat</string>
<string name="AlwaysShowPopup">Altijd popup tonen</string> <string name="AlwaysShowPopup">Altijd popup tonen</string>
<string name="BadgeNumber">Badgenummer</string> <string name="BadgeNumber">Badgenummer</string>
<string name="Short">Short</string> <string name="Short">Kort</string>
<string name="Long">Long</string> <string name="Long">Lang</string>
<string name="SystemDefault">System default</string> <string name="SystemDefault">Standaardinstelling</string>
<string name="SettingsDefault">Settings default</string> <string name="SettingsDefault">Standaardinstelling</string>
<string name="AutomaticMediaDownload">AUTOMATIC MEDIA DOWNLOAD</string> <string name="AutomaticMediaDownload">AUTOMATISCH MEDIA OPHALEN</string>
<string name="WhenUsingMobileData">When using mobile data</string> <string name="WhenUsingMobileData">Bij mobiel datagebruik</string>
<string name="WhenConnectedOnWiFi">When connected on Wi-Fi</string> <string name="WhenConnectedOnWiFi">Bij Wi-Fi verbinding</string>
<string name="WhenRoaming">When roaming</string> <string name="WhenRoaming">Bij roamen</string>
<string name="NoMediaAutoDownload">No media</string> <string name="NoMediaAutoDownload">Geen media</string>
<!--media view--> <!--media view-->
<string name="NoMedia">Nog geen media gedeeld</string> <string name="NoMedia">Nog geen media gedeeld</string>