Commit ebe7ab78 authored by DrKLO's avatar DrKLO

Gif support, applying localization files from document messages

parent 5323e87b
...@@ -794,6 +794,9 @@ JNIEXPORT void JNICALL Java_org_telegram_ui_Views_GifDrawable_saveRemainder(JNIE ...@@ -794,6 +794,9 @@ JNIEXPORT void JNICALL Java_org_telegram_ui_Views_GifDrawable_saveRemainder(JNIE
return; return;
} }
info->lastFrameReaminder = getRealTime() - info->nextStartTime; info->lastFrameReaminder = getRealTime() - info->nextStartTime;
if (info->lastFrameReaminder > 0) {
info->lastFrameReaminder = 0;
}
} }
JNIEXPORT void JNICALL Java_org_telegram_ui_Views_GifDrawable_restoreRemainder(JNIEnv *env, jclass class, jobject gifInfo) { JNIEXPORT void JNICALL Java_org_telegram_ui_Views_GifDrawable_restoreRemainder(JNIEnv *env, jclass class, jobject gifInfo) {
......
...@@ -198,7 +198,7 @@ public class FileLoadOperation { ...@@ -198,7 +198,7 @@ public class FileLoadOperation {
} }
final boolean dontDelete = isLocalFile; final boolean dontDelete = isLocalFile;
if ((exist = cacheFileFinal.exists()) && !ignoreCache) { if ((exist = cacheFileFinal.exists()) && !ignoreCache) {
Utilities.cacheOutQueue.postRunnable(new Runnable() { FileLoader.cacheOutQueue.postRunnable(new Runnable() {
@Override @Override
public void run() { public void run() {
try { try {
...@@ -403,7 +403,7 @@ public class FileLoadOperation { ...@@ -403,7 +403,7 @@ public class FileLoadOperation {
final boolean renamed = cacheFileTemp.renameTo(cacheFileFinal); final boolean renamed = cacheFileTemp.renameTo(cacheFileFinal);
if (needBitmapCreate) { if (needBitmapCreate) {
Utilities.cacheOutQueue.postRunnable(new Runnable() { FileLoader.cacheOutQueue.postRunnable(new Runnable() {
@Override @Override
public void run() { public void run() {
int delay = 20; int delay = 20;
...@@ -520,7 +520,7 @@ public class FileLoadOperation { ...@@ -520,7 +520,7 @@ public class FileLoadOperation {
int readed = httpConnectionStream.read(data); int readed = httpConnectionStream.read(data);
if (readed > 0) { if (readed > 0) {
fileOutputStream.write(data, 0, readed); fileOutputStream.write(data, 0, readed);
Utilities.imageLoadQueue.postRunnable(new Runnable() { FileLoader.fileLoaderQueue.postRunnable(new Runnable() {
@Override @Override
public void run() { public void run() {
startDownloadHTTPRequest(); startDownloadHTTPRequest();
......
...@@ -12,9 +12,13 @@ import android.app.Activity; ...@@ -12,9 +12,13 @@ import android.app.Activity;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.text.format.DateFormat; import android.text.format.DateFormat;
import android.util.Xml;
import org.telegram.ui.ApplicationLoader; import org.telegram.ui.ApplicationLoader;
import org.xmlpull.v1.XmlPullParser;
import java.io.File;
import java.io.FileInputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Collections; import java.util.Collections;
...@@ -66,42 +70,42 @@ public class LocaleController { ...@@ -66,42 +70,42 @@ public class LocaleController {
} }
public LocaleController() { public LocaleController() {
LocaleController.LocaleInfo localeInfo = new LocaleController.LocaleInfo(); LocaleInfo localeInfo = new LocaleInfo();
localeInfo.name = "English"; localeInfo.name = "English";
localeInfo.nameEnglish = "English"; localeInfo.nameEnglish = "English";
localeInfo.shortName = "en"; localeInfo.shortName = "en";
sortedLanguages.add(localeInfo); sortedLanguages.add(localeInfo);
languagesDict.put(localeInfo.shortName, localeInfo); languagesDict.put(localeInfo.shortName, localeInfo);
localeInfo = new LocaleController.LocaleInfo(); localeInfo = new LocaleInfo();
localeInfo.name = "Italiano"; localeInfo.name = "Italiano";
localeInfo.nameEnglish = "Italian"; localeInfo.nameEnglish = "Italian";
localeInfo.shortName = "it"; localeInfo.shortName = "it";
sortedLanguages.add(localeInfo); sortedLanguages.add(localeInfo);
languagesDict.put(localeInfo.shortName, localeInfo); languagesDict.put(localeInfo.shortName, localeInfo);
localeInfo = new LocaleController.LocaleInfo(); localeInfo = new LocaleInfo();
localeInfo.name = "Español"; localeInfo.name = "Español";
localeInfo.nameEnglish = "Spanish"; localeInfo.nameEnglish = "Spanish";
localeInfo.shortName = "es"; localeInfo.shortName = "es";
sortedLanguages.add(localeInfo); sortedLanguages.add(localeInfo);
languagesDict.put(localeInfo.shortName, localeInfo); languagesDict.put(localeInfo.shortName, localeInfo);
localeInfo = new LocaleController.LocaleInfo(); localeInfo = new LocaleInfo();
localeInfo.name = "Deutsch"; localeInfo.name = "Deutsch";
localeInfo.nameEnglish = "German"; localeInfo.nameEnglish = "German";
localeInfo.shortName = "de"; localeInfo.shortName = "de";
sortedLanguages.add(localeInfo); sortedLanguages.add(localeInfo);
languagesDict.put(localeInfo.shortName, localeInfo); languagesDict.put(localeInfo.shortName, localeInfo);
localeInfo = new LocaleController.LocaleInfo(); localeInfo = new LocaleInfo();
localeInfo.name = "Nederlands"; localeInfo.name = "Nederlands";
localeInfo.nameEnglish = "Dutch"; localeInfo.nameEnglish = "Dutch";
localeInfo.shortName = "nl"; localeInfo.shortName = "nl";
sortedLanguages.add(localeInfo); sortedLanguages.add(localeInfo);
languagesDict.put(localeInfo.shortName, localeInfo); languagesDict.put(localeInfo.shortName, localeInfo);
localeInfo = new LocaleController.LocaleInfo(); localeInfo = new LocaleInfo();
localeInfo.name = "العربية"; localeInfo.name = "العربية";
localeInfo.nameEnglish = "Arabic"; localeInfo.nameEnglish = "Arabic";
localeInfo.shortName = "ar"; localeInfo.shortName = "ar";
...@@ -148,6 +152,75 @@ public class LocaleController { ...@@ -148,6 +152,75 @@ public class LocaleController {
} }
} }
public boolean applyLanguageFile(File file) {
try {
HashMap<String, String> stringMap = new HashMap<String, String>();
XmlPullParser parser = Xml.newPullParser();
parser.setInput(new FileInputStream(file), "UTF-8");
int eventType = parser.getEventType();
String name = null;
String value = null;
String attrName = null;
while (eventType != XmlPullParser.END_DOCUMENT) {
if(eventType == XmlPullParser.START_TAG) {
name = parser.getName();
int c = parser.getAttributeCount();
if (c > 0) {
attrName = parser.getAttributeValue(0);
}
} else if(eventType == XmlPullParser.TEXT) {
if (attrName != null) {
value = parser.getText();
}
} else if (eventType == XmlPullParser.END_TAG) {
value = null;
attrName = null;
name = null;
}
if (name != null && name.equals("string") && value != null && attrName != null) {
stringMap.put(attrName, value);
name = null;
value = null;
attrName = null;
}
eventType = parser.next();
}
String languageName = stringMap.get("LanguageName");
String languageNameInEnglish = stringMap.get("LanguageNameInEnglish");
String languageCode = stringMap.get("LanguageCode");
if (languageName != null && languageName.length() > 0 &&
languageNameInEnglish != null && languageNameInEnglish.length() > 0 &&
languageCode != null && languageCode.length() > 0) {
LocaleInfo localeInfo = new LocaleInfo();
localeInfo.name = languageName;
localeInfo.nameEnglish = languageNameInEnglish;
localeInfo.shortName = languageCode;
sortedLanguages.add(localeInfo);
languagesDict.put(localeInfo.shortName, localeInfo);
Collections.sort(sortedLanguages, new Comparator<LocaleInfo>() {
@Override
public int compare(LocaleController.LocaleInfo o, LocaleController.LocaleInfo o2) {
if (o.shortName == null) {
return -1;
} else if (o2.shortName == null) {
return 1;
}
return o.name.compareTo(o2.name);
}
});
applyLanguage(localeInfo, true);
localeValues = stringMap;
return true;
}
} catch (Exception e) {
FileLog.e("tmessages", e);
}
return false;
}
public void applyLanguage(LocaleInfo localeInfo, boolean override) { public void applyLanguage(LocaleInfo localeInfo, boolean override) {
if (localeInfo == null) { if (localeInfo == null) {
return; return;
...@@ -196,7 +269,7 @@ public class LocaleController { ...@@ -196,7 +269,7 @@ public class LocaleController {
} }
public static String getCurrentLanguageName() { public static String getCurrentLanguageName() {
return getString("LanguangeName", R.string.LanguangeName); return getString("LanguageName", R.string.LanguageName);
} }
public static String getString(String key, int res) { public static String getString(String key, int res) {
......
...@@ -20,9 +20,12 @@ import android.media.audiofx.AutomaticGainControl; ...@@ -20,9 +20,12 @@ import android.media.audiofx.AutomaticGainControl;
import android.net.Uri; import android.net.Uri;
import android.os.Environment; import android.os.Environment;
import android.os.Vibrator; import android.os.Vibrator;
import android.view.View;
import org.telegram.objects.MessageObject; import org.telegram.objects.MessageObject;
import org.telegram.ui.ApplicationLoader; import org.telegram.ui.ApplicationLoader;
import org.telegram.ui.Cells.ChatMediaCell;
import org.telegram.ui.Views.GifDrawable;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
...@@ -54,6 +57,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel ...@@ -54,6 +57,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
public void onFailedDownload(String fileName); public void onFailedDownload(String fileName);
public void onSuccessDownload(String fileName); public void onSuccessDownload(String fileName);
public void onProgressDownload(String fileName, float progress); public void onProgressDownload(String fileName, float progress);
public void onProgressUpload(String fileName, float progress, boolean isEncrypted);
public int getObserverTag(); public int getObserverTag();
} }
...@@ -84,6 +88,10 @@ public class MediaController implements NotificationCenter.NotificationCenterDel ...@@ -84,6 +88,10 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
private ArrayList<FileDownloadProgressListener> deleteLaterArray = new ArrayList<FileDownloadProgressListener>(); private ArrayList<FileDownloadProgressListener> deleteLaterArray = new ArrayList<FileDownloadProgressListener>();
private int lastTag = 0; private int lastTag = 0;
private GifDrawable currentGifDrawable;
private MessageObject currentGifMessageObject;
private ChatMediaCell currentMediaCell;
private boolean isPaused = false; private boolean isPaused = false;
private MediaPlayer audioPlayer = null; private MediaPlayer audioPlayer = null;
private AudioTrack audioTrackPlayer = null; private AudioTrack audioTrackPlayer = null;
...@@ -226,6 +234,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel ...@@ -226,6 +234,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
NotificationCenter.getInstance().addObserver(this, FileLoader.FileDidFailedLoad); NotificationCenter.getInstance().addObserver(this, FileLoader.FileDidFailedLoad);
NotificationCenter.getInstance().addObserver(this, FileLoader.FileDidLoaded); NotificationCenter.getInstance().addObserver(this, FileLoader.FileDidLoaded);
NotificationCenter.getInstance().addObserver(this, FileLoader.FileLoadProgressChanged); NotificationCenter.getInstance().addObserver(this, FileLoader.FileLoadProgressChanged);
NotificationCenter.getInstance().addObserver(this, FileLoader.FileUploadProgressChanged);
Timer progressTimer = new Timer(); Timer progressTimer = new Timer();
progressTimer.schedule(new TimerTask() { progressTimer.schedule(new TimerTask() {
...@@ -273,6 +282,12 @@ public class MediaController implements NotificationCenter.NotificationCenterDel ...@@ -273,6 +282,12 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
public void cleanup() { public void cleanup() {
clenupPlayer(false); clenupPlayer(false);
if (currentGifDrawable != null) {
currentGifDrawable.recycle();
currentGifDrawable = null;
}
currentMediaCell = null;
currentGifMessageObject = null;
} }
public int generateObserverTag() { public int generateObserverTag() {
...@@ -377,6 +392,22 @@ public class MediaController implements NotificationCenter.NotificationCenterDel ...@@ -377,6 +392,22 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
} }
listenerInProgress = false; listenerInProgress = false;
processLaterArrays(); processLaterArrays();
} else if (id == FileLoader.FileUploadProgressChanged) {
String location = (String)args[0];
listenerInProgress = true;
String fileName = (String)args[0];
ArrayList<WeakReference<FileDownloadProgressListener>> arrayList = loadingFileObservers.get(fileName);
if (arrayList != null) {
Float progress = (Float)args[1];
Boolean enc = (Boolean)args[2];
for (WeakReference<FileDownloadProgressListener> reference : arrayList) {
if (reference.get() != null) {
reference.get().onProgressUpload(fileName, progress, enc);
}
}
}
listenerInProgress = false;
processLaterArrays();
} }
} }
...@@ -1079,4 +1110,73 @@ public class MediaController implements NotificationCenter.NotificationCenterDel ...@@ -1079,4 +1110,73 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
}); });
} }
} }
public GifDrawable getGifDrawable(ChatMediaCell cell, boolean create) {
if (cell == null) {
return null;
}
MessageObject messageObject = cell.getMessageObject();
if (messageObject == null) {
return null;
}
if (currentGifMessageObject != null && messageObject.messageOwner.id == currentGifMessageObject.messageOwner.id) {
currentMediaCell = cell;
currentGifDrawable.parentView = new WeakReference<View>(cell);
return currentGifDrawable;
}
if (create) {
if (currentMediaCell != null) {
if (currentGifDrawable != null) {
currentGifDrawable.stop();
currentGifDrawable.recycle();
}
currentMediaCell.clearGifImage();
}
currentGifMessageObject = cell.getMessageObject();
currentMediaCell = cell;
File cacheFile = null;
if (currentGifMessageObject.messageOwner.attachPath != null && currentGifMessageObject.messageOwner.attachPath.length() != 0) {
File f = new File(currentGifMessageObject.messageOwner.attachPath);
if (f.length() > 0) {
cacheFile = f;
}
} else {
cacheFile = new File(Utilities.getCacheDir(), messageObject.getFileName());
}
try {
currentGifDrawable = new GifDrawable(cacheFile);
currentGifDrawable.parentView = new WeakReference<View>(cell);
return currentGifDrawable;
} catch (Exception e) {
FileLog.e("tmessages", e);
}
}
return null;
}
public void clearGifDrawable(ChatMediaCell cell) {
if (cell == null) {
return;
}
MessageObject messageObject = cell.getMessageObject();
if (messageObject == null) {
return;
}
if (currentGifMessageObject != null && messageObject.messageOwner.id == currentGifMessageObject.messageOwner.id) {
if (currentGifDrawable != null) {
currentGifDrawable.stop();
currentGifDrawable.recycle();
currentGifDrawable = null;
}
currentMediaCell = null;
currentGifMessageObject = null;
}
}
} }
...@@ -76,9 +76,6 @@ public class Utilities { ...@@ -76,9 +76,6 @@ public class Utilities {
public static volatile DispatchQueue stageQueue = new DispatchQueue("stageQueue"); public static volatile DispatchQueue stageQueue = new DispatchQueue("stageQueue");
public static volatile DispatchQueue globalQueue = new DispatchQueue("globalQueue"); public static volatile DispatchQueue globalQueue = new DispatchQueue("globalQueue");
public static volatile DispatchQueue cacheOutQueue = new DispatchQueue("cacheOutQueue");
public static volatile DispatchQueue imageLoadQueue = new DispatchQueue("imageLoadQueue");
public static volatile DispatchQueue fileUploadQueue = new DispatchQueue("fileUploadQueue");
public static int[] arrColors = {0xffee4928, 0xff41a903, 0xffe09602, 0xff0f94ed, 0xff8f3bf7, 0xfffc4380, 0xff00a1c4, 0xffeb7002}; public static int[] arrColors = {0xffee4928, 0xff41a903, 0xffe09602, 0xff0f94ed, 0xff8f3bf7, 0xfffc4380, 0xff00a1c4, 0xffeb7002};
public static int[] arrUsersAvatars = { public static int[] arrUsersAvatars = {
......
...@@ -35,6 +35,7 @@ public class MessageObject { ...@@ -35,6 +35,7 @@ public class MessageObject {
public TLRPC.Message messageOwner; public TLRPC.Message messageOwner;
public CharSequence messageText; public CharSequence messageText;
public int type; public int type;
public int contentType;
public ArrayList<PhotoObject> photoThumbs; public ArrayList<PhotoObject> photoThumbs;
public Bitmap imagePreview; public Bitmap imagePreview;
public PhotoObject previewPhoto; public PhotoObject previewPhoto;
...@@ -244,6 +245,11 @@ public class MessageObject { ...@@ -244,6 +245,11 @@ public class MessageObject {
} else if (message.media instanceof TLRPC.TL_messageMediaUnsupported) { } else if (message.media instanceof TLRPC.TL_messageMediaUnsupported) {
messageText = LocaleController.getString("UnsuppotedMedia", R.string.UnsuppotedMedia); messageText = LocaleController.getString("UnsuppotedMedia", R.string.UnsuppotedMedia);
} else if (message.media instanceof TLRPC.TL_messageMediaDocument) { } else if (message.media instanceof TLRPC.TL_messageMediaDocument) {
if (!(message.media.document.thumb instanceof TLRPC.TL_photoSizeEmpty)) {
photoThumbs = new ArrayList<PhotoObject>();
PhotoObject obj = new PhotoObject(message.media.document.thumb);
photoThumbs.add(obj);
}
messageText = LocaleController.getString("AttachDocument", R.string.AttachDocument); messageText = LocaleController.getString("AttachDocument", R.string.AttachDocument);
} else if (message.media instanceof TLRPC.TL_messageMediaAudio) { } else if (message.media instanceof TLRPC.TL_messageMediaAudio) {
messageText = LocaleController.getString("AttachAudio", R.string.AttachAudio); messageText = LocaleController.getString("AttachAudio", R.string.AttachAudio);
...@@ -255,68 +261,53 @@ public class MessageObject { ...@@ -255,68 +261,53 @@ public class MessageObject {
if (message instanceof TLRPC.TL_message || (message instanceof TLRPC.TL_messageForwarded && (message.media == null || !(message.media instanceof TLRPC.TL_messageMediaEmpty)))) { if (message instanceof TLRPC.TL_message || (message instanceof TLRPC.TL_messageForwarded && (message.media == null || !(message.media instanceof TLRPC.TL_messageMediaEmpty)))) {
if (message.media == null || message.media instanceof TLRPC.TL_messageMediaEmpty) { if (message.media == null || message.media instanceof TLRPC.TL_messageMediaEmpty) {
if (message.from_id == UserConfig.clientUserId) { contentType = type = 0;
type = 0;
} else {
type = 1;
}
} else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaPhoto) { } else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaPhoto) {
if (message.from_id == UserConfig.clientUserId) { contentType = type = 1;
type = 2;
} else {
type = 3;
}
} else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaGeo) { } else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaGeo) {
if (message.from_id == UserConfig.clientUserId) { if (message.from_id == UserConfig.clientUserId) {
type = 4; contentType = type = 4;
} else { } else {
type = 5; contentType = type = 5;
} }
} else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaVideo) { } else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaVideo) {
if (message.from_id == UserConfig.clientUserId) { if (message.from_id == UserConfig.clientUserId) {
type = 6; contentType = type = 6;
} else { } else {
type = 7; contentType = type = 7;
} }
} else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaContact) { } else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaContact) {
if (message.from_id == UserConfig.clientUserId) { if (message.from_id == UserConfig.clientUserId) {
type = 12; contentType = type = 12;
} else { } else {
type = 13; contentType = type = 13;
} }
} else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaUnsupported) { } else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaUnsupported) {
if (message.from_id == UserConfig.clientUserId) { contentType = type = 0;
type = 0;
} else {
type = 1;
}
} else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaDocument) { } else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaDocument) {
if (message.from_id == UserConfig.clientUserId) { 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 = 16; contentType = 1;
type = 8;
} else { } else {
type = 17; if (message.from_id == UserConfig.clientUserId) {
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) {
if (message.from_id == UserConfig.clientUserId) { contentType = type = 2;
type = 18;
} else {
type = 19;
}
} }
} else if (message instanceof TLRPC.TL_messageService) { } else if (message instanceof TLRPC.TL_messageService) {
if (message.action instanceof TLRPC.TL_messageActionLoginUnknownLocation) { if (message.action instanceof TLRPC.TL_messageActionLoginUnknownLocation) {
type = 1; 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) {
type = 11; contentType = type = 11;
} else { } else {
type = 10; contentType = type = 10;
} }
} else if (message instanceof TLRPC.TL_messageForwarded) { } else if (message instanceof TLRPC.TL_messageForwarded) {
if (message.from_id == UserConfig.clientUserId) { contentType = type = 0;
type = 8;
} else {
type = 9;
}
} }
Calendar rightNow = new GregorianCalendar(); Calendar rightNow = new GregorianCalendar();
......
...@@ -60,8 +60,8 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega ...@@ -60,8 +60,8 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega
private TLRPC.FileLocation currentPhoto; private TLRPC.FileLocation currentPhoto;
private String currentNameString; private String currentNameString;
public ChatAudioCell(Context context, boolean isChat) { public ChatAudioCell(Context context) {
super(context, isChat); super(context, false);
TAG = MediaController.getInstance().generateObserverTag(); TAG = MediaController.getInstance().generateObserverTag();
avatarImage = new ImageReceiver(); avatarImage = new ImageReceiver();
...@@ -101,6 +101,7 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega ...@@ -101,6 +101,7 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega
avatarImage.clearImage(); avatarImage.clearImage();
currentPhoto = null; currentPhoto = null;
} }
MediaController.getInstance().removeLoadingFileObserver(this);
} }
@Override @Override
...@@ -230,7 +231,7 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega ...@@ -230,7 +231,7 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega
} }
progressView.setProgress(0); progressView.setProgress(0);
} else { } else {
MediaController.getInstance().addLoadingFileObserver(currentMessageObject.getFileName(), this); MediaController.getInstance().addLoadingFileObserver(fileName, this);
if (!FileLoader.getInstance().isLoadingFile(fileName)) { if (!FileLoader.getInstance().isLoadingFile(fileName)) {
buttonState = 2; buttonState = 2;
progressView.setProgress(0); progressView.setProgress(0);
...@@ -263,6 +264,11 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega ...@@ -263,6 +264,11 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega
invalidate(); invalidate();
} }
@Override
public void onProgressUpload(String fileName, float progress, boolean isEncrypted) {
}
@Override @Override
public int getObserverTag() { public int getObserverTag() {
return TAG; return TAG;
...@@ -281,7 +287,7 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega ...@@ -281,7 +287,7 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int width = MeasureSpec.getSize(widthMeasureSpec); int width = MeasureSpec.getSize(widthMeasureSpec);
setMeasuredDimension(width, Utilities.dp(68)); setMeasuredDimension(width, Utilities.dp(68));
if (chat) { if (isChat) {
backgroundWidth = Math.min(width - Utilities.dp(102), Utilities.dp(300)); backgroundWidth = Math.min(width - Utilities.dp(102), Utilities.dp(300));
} else { } else {
backgroundWidth = Math.min(width - Utilities.dp(50), Utilities.dp(300)); backgroundWidth = Math.min(width - Utilities.dp(50), Utilities.dp(300));
...@@ -298,7 +304,7 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega ...@@ -298,7 +304,7 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega
buttonX = layoutWidth - backgroundWidth + Utilities.dp(67); buttonX = layoutWidth - backgroundWidth + Utilities.dp(67);
timeX = layoutWidth - backgroundWidth + Utilities.dp(71); timeX = layoutWidth - backgroundWidth + Utilities.dp(71);
} else { } else {
if (chat) { if (isChat) {
avatarImage.imageX = Utilities.dp(69); avatarImage.imageX = Utilities.dp(69);
seekBarX = Utilities.dp(158); seekBarX = Utilities.dp(158);
buttonX = Utilities.dp(128); buttonX = Utilities.dp(128);
...@@ -355,10 +361,10 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega ...@@ -355,10 +361,10 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega
if (messageObject.messageOwner.out) { if (messageObject.messageOwner.out) {
seekBar.type = 0; seekBar.type = 0;
progressView.type = 0; progressView.setProgressColors(0xffb4e396, 0xff6ac453);
} else { } else {
seekBar.type = 1; seekBar.type = 1;
progressView.type = 1; progressView.setProgressColors(0xffd9e2eb, 0xff86c5f8);
} }
super.setMessageObject(messageObject); super.setMessageObject(messageObject);
...@@ -405,10 +411,4 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega ...@@ -405,10 +411,4 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega
timeLayout.draw(canvas); timeLayout.draw(canvas);
canvas.restore(); canvas.restore();
} }
@Override
protected void finalize() throws Throwable {
MediaController.getInstance().removeLoadingFileObserver(this);
super.finalize();
}
} }
...@@ -28,8 +28,8 @@ public class ChatMessageCell extends ChatBaseCell { ...@@ -28,8 +28,8 @@ public class ChatMessageCell extends ChatBaseCell {
private int firstVisibleBlockNum = 0; private int firstVisibleBlockNum = 0;
private int totalVisibleBlocksCount = 0; private int totalVisibleBlocksCount = 0;
public ChatMessageCell(Context context, boolean isChat) { public ChatMessageCell(Context context) {
super(context, isChat); super(context, false);
drawForwardedName = true; drawForwardedName = true;
} }
...@@ -131,7 +131,7 @@ public class ChatMessageCell extends ChatBaseCell { ...@@ -131,7 +131,7 @@ public class ChatMessageCell extends ChatBaseCell {
} }
pressedLink = null; pressedLink = null;
int maxWidth; int maxWidth;
if (chat) { if (isChat) {
maxWidth = Utilities.displaySize.x - Utilities.dp(122); maxWidth = Utilities.displaySize.x - Utilities.dp(122);
drawName = true; drawName = true;
} else { } else {
...@@ -180,7 +180,7 @@ public class ChatMessageCell extends ChatBaseCell { ...@@ -180,7 +180,7 @@ public class ChatMessageCell extends ChatBaseCell {
textX = layoutWidth - backgroundWidth + Utilities.dp(10); textX = layoutWidth - backgroundWidth + Utilities.dp(10);
textY = Utilities.dp(10) + namesOffset; textY = Utilities.dp(10) + namesOffset;
} else { } else {
textX = Utilities.dp(19) + (chat ? Utilities.dp(52) : 0); textX = Utilities.dp(19) + (isChat ? Utilities.dp(52) : 0);
textY = Utilities.dp(10) + namesOffset; textY = Utilities.dp(10) + namesOffset;
} }
} }
...@@ -196,7 +196,7 @@ public class ChatMessageCell extends ChatBaseCell { ...@@ -196,7 +196,7 @@ public class ChatMessageCell extends ChatBaseCell {
textX = layoutWidth - backgroundWidth + Utilities.dp(10); textX = layoutWidth - backgroundWidth + Utilities.dp(10);
textY = Utilities.dp(10) + namesOffset; textY = Utilities.dp(10) + namesOffset;
} else { } else {
textX = Utilities.dp(19) + (chat ? Utilities.dp(52) : 0); textX = Utilities.dp(19) + (isChat ? Utilities.dp(52) : 0);
textY = Utilities.dp(10) + namesOffset; textY = Utilities.dp(10) + namesOffset;
} }
......
...@@ -409,7 +409,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter ...@@ -409,7 +409,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
listView.invalidateViews(); listView.invalidateViews();
} }
} else if (i == languageRow) { } else if (i == languageRow) {
((LaunchActivity)parentActivity).presentFragment(new LanguageSelectActivity(), "settings_wallpapers", false); ((LaunchActivity)parentActivity).presentFragment(new LanguageSelectActivity(), "settings_lang", false);
} else if (i == switchBackendButtonRow) { } else if (i == switchBackendButtonRow) {
AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity); AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity);
builder.setMessage(LocaleController.getString("AreYouSure", R.string.AreYouSure)); builder.setMessage(LocaleController.getString("AreYouSure", R.string.AreYouSure));
......
...@@ -24,6 +24,7 @@ THE SOFTWARE. ...@@ -24,6 +24,7 @@ THE SOFTWARE.
package org.telegram.ui.Views; package org.telegram.ui.Views;
import android.graphics.Bitmap;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.ColorFilter; import android.graphics.ColorFilter;
import android.graphics.Paint; import android.graphics.Paint;
...@@ -33,9 +34,11 @@ import android.graphics.drawable.Animatable; ...@@ -33,9 +34,11 @@ import android.graphics.drawable.Animatable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import android.view.View;
import android.widget.MediaController; import android.widget.MediaController;
import java.io.File; import java.io.File;
import java.lang.ref.WeakReference;
import java.util.Locale; import java.util.Locale;
public class GifDrawable extends Drawable implements Animatable, MediaController.MediaPlayerControl { public class GifDrawable extends Drawable implements Animatable, MediaController.MediaPlayerControl {
...@@ -68,6 +71,8 @@ public class GifDrawable extends Drawable implements Animatable, MediaController ...@@ -68,6 +71,8 @@ public class GifDrawable extends Drawable implements Animatable, MediaController
private boolean mApplyTransformation; private boolean mApplyTransformation;
private final Rect mDstRect = new Rect(); private final Rect mDstRect = new Rect();
public WeakReference<View> parentView = null;
protected final Paint mPaint = new Paint(Paint.FILTER_BITMAP_FLAG | Paint.DITHER_FLAG); protected final Paint mPaint = new Paint(Paint.FILTER_BITMAP_FLAG | Paint.DITHER_FLAG);
protected final int[] mColors; protected final int[] mColors;
...@@ -82,7 +87,10 @@ public class GifDrawable extends Drawable implements Animatable, MediaController ...@@ -82,7 +87,10 @@ public class GifDrawable extends Drawable implements Animatable, MediaController
@Override @Override
public void run() { public void run() {
restoreRemainder(mGifInfoPtr); restoreRemainder(mGifInfoPtr);
invalidateSelf(); if (parentView != null && parentView.get() != null) {
parentView.get().invalidate();
}
mMetaData[4] = 0;
} }
}; };
...@@ -96,7 +104,9 @@ public class GifDrawable extends Drawable implements Animatable, MediaController ...@@ -96,7 +104,9 @@ public class GifDrawable extends Drawable implements Animatable, MediaController
private final Runnable mInvalidateTask = new Runnable() { private final Runnable mInvalidateTask = new Runnable() {
@Override @Override
public void run() { public void run() {
invalidateSelf(); if (parentView != null && parentView.get() != null) {
parentView.get().invalidate();
}
} }
}; };
...@@ -109,18 +119,12 @@ public class GifDrawable extends Drawable implements Animatable, MediaController ...@@ -109,18 +119,12 @@ public class GifDrawable extends Drawable implements Animatable, MediaController
} }
public GifDrawable(String filePath) throws Exception { public GifDrawable(String filePath) throws Exception {
if (filePath == null) {
throw new NullPointerException("Source is null");
}
mInputSourceLength = new File(filePath).length(); mInputSourceLength = new File(filePath).length();
mGifInfoPtr = openFile(mMetaData, filePath); mGifInfoPtr = openFile(mMetaData, filePath);
mColors = new int[mMetaData[0] * mMetaData[1]]; mColors = new int[mMetaData[0] * mMetaData[1]];
} }
public GifDrawable(File file) throws Exception { public GifDrawable(File file) throws Exception {
if (file == null) {
throw new NullPointerException("Source is null");
}
mInputSourceLength = file.length(); mInputSourceLength = file.length();
mGifInfoPtr = openFile(mMetaData, file.getPath()); mGifInfoPtr = openFile(mMetaData, file.getPath());
mColors = new int[mMetaData[0] * mMetaData[1]]; mColors = new int[mMetaData[0] * mMetaData[1]];
...@@ -169,6 +173,9 @@ public class GifDrawable extends Drawable implements Animatable, MediaController ...@@ -169,6 +173,9 @@ public class GifDrawable extends Drawable implements Animatable, MediaController
@Override @Override
public void start() { public void start() {
if (mIsRunning) {
return;
}
mIsRunning = true; mIsRunning = true;
runOnUiThread(mStartTask); runOnUiThread(mStartTask);
} }
...@@ -240,7 +247,9 @@ public class GifDrawable extends Drawable implements Animatable, MediaController ...@@ -240,7 +247,9 @@ public class GifDrawable extends Drawable implements Animatable, MediaController
@Override @Override
public void run() { public void run() {
seekToTime(mGifInfoPtr, position, mColors); seekToTime(mGifInfoPtr, position, mColors);
invalidateSelf(); if (parentView != null && parentView.get() != null) {
parentView.get().invalidate();
}
} }
}); });
} }
...@@ -253,7 +262,9 @@ public class GifDrawable extends Drawable implements Animatable, MediaController ...@@ -253,7 +262,9 @@ public class GifDrawable extends Drawable implements Animatable, MediaController
@Override @Override
public void run() { public void run() {
seekToFrame(mGifInfoPtr, frameIndex, mColors); seekToFrame(mGifInfoPtr, frameIndex, mColors);
invalidateSelf(); if (parentView != null && parentView.get() != null) {
parentView.get().invalidate();
}
} }
}); });
} }
...@@ -323,6 +334,11 @@ public class GifDrawable extends Drawable implements Animatable, MediaController ...@@ -323,6 +334,11 @@ public class GifDrawable extends Drawable implements Animatable, MediaController
return mColors[mMetaData[1] * y + x]; return mColors[mMetaData[1] * y + x];
} }
public Bitmap getBitmap() {
seekToFrame(mGifInfoPtr, 0, mColors);
return Bitmap.createBitmap(mColors, 0, mMetaData[0], mMetaData[0], mMetaData[1], Bitmap.Config.ARGB_8888);
}
@Override @Override
protected void onBoundsChange(Rect bounds) { protected void onBoundsChange(Rect bounds) {
super.onBoundsChange(bounds); super.onBoundsChange(bounds);
...@@ -343,6 +359,7 @@ public class GifDrawable extends Drawable implements Animatable, MediaController ...@@ -343,6 +359,7 @@ public class GifDrawable extends Drawable implements Animatable, MediaController
} else { } else {
mMetaData[4] = -1; mMetaData[4] = -1;
} }
canvas.translate(mDstRect.left, mDstRect.top);
canvas.scale(mSx, mSy); canvas.scale(mSx, mSy);
canvas.drawBitmap(mColors, 0, mMetaData[0], 0f, 0f, mMetaData[0], mMetaData[1], true, mPaint); canvas.drawBitmap(mColors, 0, mMetaData[0], 0f, 0f, mMetaData[0], mMetaData[1], true, mPaint);
if (mMetaData[4] >= 0 && mMetaData[2] > 1) { if (mMetaData[4] >= 0 && mMetaData[2] > 1) {
...@@ -365,13 +382,17 @@ public class GifDrawable extends Drawable implements Animatable, MediaController ...@@ -365,13 +382,17 @@ public class GifDrawable extends Drawable implements Animatable, MediaController
@Override @Override
public void setFilterBitmap(boolean filter) { public void setFilterBitmap(boolean filter) {
mPaint.setFilterBitmap(filter); mPaint.setFilterBitmap(filter);
invalidateSelf(); if (parentView != null && parentView.get() != null) {
parentView.get().invalidate();
}
} }
@Override @Override
public void setDither(boolean dither) { public void setDither(boolean dither) {
mPaint.setDither(dither); mPaint.setDither(dither);
invalidateSelf(); if (parentView != null && parentView.get() != null) {
parentView.get().invalidate();
}
} }
@Override @Override
......
...@@ -111,10 +111,47 @@ public class ImageReceiver { ...@@ -111,10 +111,47 @@ public class ImageReceiver {
} }
} }
public void setImageBitmap(Bitmap bitmap) {
currentPath = null;
last_path = null;
last_httpUrl = null;
last_filter = null;
last_placeholder = null;
last_size = 0;
FileLoader.getInstance().cancelLoadingForImageView(this);
if (bitmap != null) {
recycleBitmap(null);
currentImage = new BitmapDrawable(null, bitmap);
}
}
public void setImageBitmap(Drawable bitmap) {
currentPath = null;
last_path = null;
last_httpUrl = null;
last_filter = null;
last_placeholder = null;
last_size = 0;
FileLoader.getInstance().cancelLoadingForImageView(this);
if (bitmap != null) {
recycleBitmap(null);
currentImage = bitmap;
}
}
public void clearImage() { public void clearImage() {
recycleBitmap(null); recycleBitmap(null);
} }
@Override
protected void finalize() throws Throwable {
try {
clearImage();
} finally {
super.finalize();
}
}
private void recycleBitmap(Bitmap newBitmap) { private void recycleBitmap(Bitmap newBitmap) {
if (currentImage == null || isPlaceholder) { if (currentImage == null || isPlaceholder) {
return; return;
......
...@@ -14,50 +14,35 @@ import android.graphics.Paint; ...@@ -14,50 +14,35 @@ import android.graphics.Paint;
import org.telegram.messenger.Utilities; import org.telegram.messenger.Utilities;
public class ProgressView { public class ProgressView {
private static Paint innerPaint1; private Paint innerPaint;
private static Paint outerPaint1; private Paint outerPaint;
private static Paint innerPaint2;
private static Paint outerPaint2;
public int type; public float currentProgress = 0;
public int thumbX = 0;
public int width; public int width;
public int height; public int height;
public float progressHeight = Utilities.dpf(2.0f);
public ProgressView() { public ProgressView() {
if (innerPaint1 == null) { innerPaint = new Paint();
innerPaint1 = new Paint(); outerPaint = new Paint();
outerPaint1 = new Paint(); }
innerPaint2 = new Paint();
outerPaint2 = new Paint(); public void setProgressColors(int innerColor, int outerColor) {
innerPaint.setColor(innerColor);
innerPaint1.setColor(0xffb4e396); outerPaint.setColor(outerColor);
outerPaint1.setColor(0xff6ac453);
innerPaint2.setColor(0xffd9e2eb);
outerPaint2.setColor(0xff86c5f8);
}
} }
public void setProgress(float progress) { public void setProgress(float progress) {
thumbX = (int)Math.ceil(width * progress); currentProgress = progress;
if (thumbX < 0) { if (currentProgress < 0) {
thumbX = 0; currentProgress = 0;
} else if (thumbX > width) { } else if (currentProgress > 1) {
thumbX = width; currentProgress = 1;
} }
} }
public void draw(Canvas canvas) { public void draw(Canvas canvas) {
Paint inner = null; canvas.drawRect(0, height / 2 - progressHeight / 2.0f, width, height / 2 + progressHeight / 2.0f, innerPaint);
Paint outer = null; canvas.drawRect(0, height / 2 - progressHeight / 2.0f, width * currentProgress, height / 2 + progressHeight / 2.0f, outerPaint);
if (type == 0) {
inner = innerPaint1;
outer = outerPaint1;
} else if (type == 1) {
inner = innerPaint2;
outer = outerPaint2;
}
canvas.drawRect(0, height / 2 - Utilities.dp(1), width, height / 2 + Utilities.dp(1), inner);
canvas.drawRect(0, height / 2 - Utilities.dp(1), thumbX, height / 2 + Utilities.dp(1), outer);
} }
} }
<?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:scaleType="fitCenter"
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="wrap_content"
android:layout_width="wrap_content"
android:layout_margin="6dp"
android:layout_gravity="top"
android:scaleType="centerCrop"
android:minHeight="100dp"
android:minWidth="100dp"
android:id="@+id/chat_photo_image"/>
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_height="44dp"
android:layout_width="44dp"
android:id="@+id/chat_view_action_layout"
android:layout_gravity="center"
android:visibility="visible">
<ImageView
android:layout_width="44dp"
android:layout_height="44dp"
android:scaleType="centerInside"
android:id="@+id/chat_view_action_cancel_button"
android:src="@drawable/photo_download_states"
android:layout_gravity="center"
android:clickable="true"/>
</org.telegram.ui.Views.FrameLayoutFixed>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="16dp"
android:orientation="horizontal"
android:layout_marginLeft="10dp"
android:layout_marginBottom="10dp"
android:layout_marginRight="10dp"
android:layout_gravity="right|bottom"
android:gravity="right">
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_width="0dp"
android:layout_height="16dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:paddingTop="1dp"
android:layout_marginRight="4dp"
android:background="@drawable/phototime"
android:id="@+id/photo_progress"
android:layout_weight="1">
<ProgressBar
android:layout_width="fill_parent"
android:layout_height="3dp"
android:layout_gravity="right|center_vertical"
android:progressDrawable="@drawable/photo_progress_chat"
style="?android:attr/progressBarStyleHorizontal"
android:progress="50"
android:id="@+id/chat_view_action_progress"
android:max="100"/>
</org.telegram.ui.Views.FrameLayoutFixed>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="16dp"
android:id="@+id/chat_time_layout"
android:paddingLeft="3dp"
android:paddingRight="3dp"
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>
</LinearLayout>
</org.telegram.ui.Views.FrameLayoutFixed>
</LinearLayout>
\ No newline at end of file
<?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:scaleType="centerCrop"
android:minHeight="100dp"
android:minWidth="100dp"
android:id="@+id/chat_photo_image"/>
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_height="44dp"
android:layout_width="44dp"
android:id="@+id/chat_view_action_layout"
android:layout_gravity="center"
android:visibility="visible">
<ImageView
android:layout_width="44dp"
android:layout_height="44dp"
android:scaleType="centerInside"
android:id="@+id/chat_view_action_cancel_button"
android:src="@drawable/photo_download_states"
android:layout_gravity="center"
android:clickable="true"/>
</org.telegram.ui.Views.FrameLayoutFixed>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="16dp"
android:orientation="horizontal"
android:layout_marginLeft="10dp"
android:layout_marginBottom="10dp"
android:layout_marginRight="10dp"
android:layout_gravity="right|bottom"
android:gravity="right">
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_width="0dp"
android:layout_height="16dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:paddingTop="1dp"
android:layout_marginRight="4dp"
android:background="@drawable/phototime"
android:id="@+id/photo_progress"
android:layout_weight="1">
<ProgressBar
android:layout_width="fill_parent"
android:layout_height="3dp"
android:layout_gravity="right|center_vertical"
android:progressDrawable="@drawable/photo_progress_chat"
style="?android:attr/progressBarStyleHorizontal"
android:progress="50"
android:id="@+id/chat_view_action_progress"
android:max="100"/>
</org.telegram.ui.Views.FrameLayoutFixed>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="16dp"
android:id="@+id/chat_time_layout"
android:paddingLeft="3dp"
android:paddingRight="3dp"
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>
</LinearLayout>
</org.telegram.ui.Views.FrameLayoutFixed>
</LinearLayout>
\ No newline at end of file
<?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">
<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:addStatesFromChildren="true">
<org.telegram.ui.Views.BackupImageView
android:layout_height="100dp"
android:layout_width="100dp"
android:layout_margin="6dp"
android:layout_gravity="top|left"
android:scaleType="centerCrop"
android:minHeight="100dp"
android:minWidth="100dp"
android:id="@+id/chat_photo_image"/>
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_height="44dp"
android:layout_width="44dp"
android:id="@+id/chat_view_action_layout"
android:layout_gravity="center"
android:visibility="visible">
<ImageView
android:layout_width="44dp"
android:layout_height="44dp"
android:scaleType="centerInside"
android:id="@+id/chat_view_action_cancel_button"
android:src="@drawable/photo_download_cancel_states"
android:layout_gravity="center"
android:clickable="true"/>
</org.telegram.ui.Views.FrameLayoutFixed>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="16dp"
android:orientation="horizontal"
android:layout_marginLeft="10dp"
android:layout_marginBottom="10dp"
android:layout_marginRight="10dp"
android:layout_gravity="right|bottom"
android:gravity="right">
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_width="0dp"
android:layout_height="16dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:paddingTop="1dp"
android:layout_marginRight="4dp"
android:background="@drawable/phototime"
android:id="@+id/photo_progress"
android:layout_weight="1">
<ProgressBar
android:layout_width="fill_parent"
android:layout_height="3dp"
android:layout_gravity="right|center_vertical"
android:progressDrawable="@drawable/photo_progress_chat"
style="?android:attr/progressBarStyleHorizontal"
android:progress="50"
android:id="@+id/chat_view_action_progress"
android:max="100"/>
</org.telegram.ui.Views.FrameLayoutFixed>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="16dp"
android:id="@+id/chat_time_layout"
android:paddingLeft="3dp"
android:paddingRight="3dp"
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="2dp"
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="2dp"
android:id="@+id/chat_row_halfcheck"
android:visibility="visible"
android:src="@drawable/msg_halfcheck_w"
android:layout_gravity="top"/>
</LinearLayout>
</LinearLayout>
</org.telegram.ui.Views.FrameLayoutFixed>
</LinearLayout>
\ No newline at end of file
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
<resources> <resources>
<string name="AppName">Telegram</string> <string name="AppName">Telegram</string>
<string name="LanguangeName">العربية</string> <string name="LanguageName">العربية</string>
<string name="LanguangeNameInEnglish">Arabic</string> <string name="LanguageNameInEnglish">Arabic</string>
<string name="LanguageCode">ar</string>
<!--signin view--> <!--signin view-->
<string name="YourPhone">رقم هاتفك المحمول</string> <string name="YourPhone">رقم هاتفك المحمول</string>
...@@ -110,7 +111,7 @@ ...@@ -110,7 +111,7 @@
<string name="DeleteThisGroup">حذف المجموعة</string> <string name="DeleteThisGroup">حذف المجموعة</string>
<string name="SlideToCancel">قم بالسحب للإلغاء</string> <string name="SlideToCancel">قم بالسحب للإلغاء</string>
<string name="SaveToDownloads">حفظ في الجهاز</string> <string name="SaveToDownloads">حفظ في الجهاز</string>
<string name="ApplyLocalizationFile">Apply localization file</string> <string name="ApplyLocalizationFile">تطبيق ملف التعريب</string>
<!--notification--> <!--notification-->
<string name="EncryptedChatRequested">تم طلب محادثة سرية</string> <string name="EncryptedChatRequested">تم طلب محادثة سرية</string>
......
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
<resources> <resources>
<string name="AppName">Telegram</string> <string name="AppName">Telegram</string>
<string name="LanguangeName">Deutsch</string> <string name="LanguageName">Deutsch</string>
<string name="LanguangeNameInEnglish">German</string> <string name="LanguageNameInEnglish">German</string>
<string name="LanguageCode">de</string>
<!--signin view--> <!--signin view-->
<string name="YourPhone">Dein Telefon</string> <string name="YourPhone">Dein Telefon</string>
...@@ -110,7 +111,7 @@ ...@@ -110,7 +111,7 @@
<string name="DeleteThisGroup">Diese Gruppe löschen</string> <string name="DeleteThisGroup">Diese Gruppe löschen</string>
<string name="SlideToCancel">WISCHEN UM ABZUBRECHEN</string> <string name="SlideToCancel">WISCHEN UM ABZUBRECHEN</string>
<string name="SaveToDownloads">In Ordner Downloads speichern</string> <string name="SaveToDownloads">In Ordner Downloads speichern</string>
<string name="ApplyLocalizationFile">Apply localization file</string> <string name="ApplyLocalizationFile">Sprachdatei benutzen</string>
<!--notification--> <!--notification-->
<string name="EncryptedChatRequested">Geheimen Chat angefordert</string> <string name="EncryptedChatRequested">Geheimen Chat angefordert</string>
......
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
<resources> <resources>
<string name="AppName">Telegram</string> <string name="AppName">Telegram</string>
<string name="LanguangeName">Español</string> <string name="LanguageName">Español</string>
<string name="LanguangeNameInEnglish">Spanish</string> <string name="LanguageNameInEnglish">Spanish</string>
<string name="LanguageCode">es</string>
<!--signin view--> <!--signin view-->
<string name="YourPhone">Tu teléfono</string> <string name="YourPhone">Tu teléfono</string>
...@@ -110,7 +111,7 @@ ...@@ -110,7 +111,7 @@
<string name="DeleteThisGroup">Eliminar este grupo</string> <string name="DeleteThisGroup">Eliminar este grupo</string>
<string name="SlideToCancel">DESLIZA PARA CANCELAR</string> <string name="SlideToCancel">DESLIZA PARA CANCELAR</string>
<string name="SaveToDownloads">Guardar en descargas</string> <string name="SaveToDownloads">Guardar en descargas</string>
<string name="ApplyLocalizationFile">Apply localization file</string> <string name="ApplyLocalizationFile">Aplicar fichero de localización</string>
<!--notification--> <!--notification-->
<string name="EncryptedChatRequested">Chat secreto solicitado</string> <string name="EncryptedChatRequested">Chat secreto solicitado</string>
......
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
<resources> <resources>
<string name="AppName">Telegram</string> <string name="AppName">Telegram</string>
<string name="LanguangeName">Italiano</string> <string name="LanguageName">Italiano</string>
<string name="LanguangeNameInEnglish">Italian</string> <string name="LanguageNameInEnglish">Italian</string>
<string name="LanguageCode">it</string>
<!--signin view--> <!--signin view-->
<string name="YourPhone">Il tuo telefono</string> <string name="YourPhone">Il tuo telefono</string>
...@@ -110,7 +111,7 @@ ...@@ -110,7 +111,7 @@
<string name="DeleteThisGroup">Elimina questo gruppo</string> <string name="DeleteThisGroup">Elimina questo gruppo</string>
<string name="SlideToCancel">TRASCINA PER ANNULLARE</string> <string name="SlideToCancel">TRASCINA PER ANNULLARE</string>
<string name="SaveToDownloads">Salva in download</string> <string name="SaveToDownloads">Salva in download</string>
<string name="ApplyLocalizationFile">Apply localization file</string> <string name="ApplyLocalizationFile">Applica file di localizzazione</string>
<!--notification--> <!--notification-->
<string name="EncryptedChatRequested">Chat segreta richiesta</string> <string name="EncryptedChatRequested">Chat segreta richiesta</string>
......
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
<resources> <resources>
<string name="AppName">Telegram</string> <string name="AppName">Telegram</string>
<string name="LanguangeName">Nederlands</string> <string name="LanguageName">Nederlands</string>
<string name="LanguangeNameInEnglish">Dutch</string> <string name="LanguageNameInEnglish">Dutch</string>
<string name="LanguageCode">nl</string>
<!--signin view--> <!--signin view-->
<string name="YourPhone">Uw telefoon</string> <string name="YourPhone">Uw telefoon</string>
...@@ -110,7 +111,7 @@ ...@@ -110,7 +111,7 @@
<string name="DeleteThisGroup">Deze groep verwijderen</string> <string name="DeleteThisGroup">Deze groep verwijderen</string>
<string name="SlideToCancel">SLEEP OM TE ANNULEREN</string> <string name="SlideToCancel">SLEEP OM TE ANNULEREN</string>
<string name="SaveToDownloads">Opslaan in downloads</string> <string name="SaveToDownloads">Opslaan in downloads</string>
<string name="ApplyLocalizationFile">Apply localization file</string> <string name="ApplyLocalizationFile">Vertaling toepassen</string>
<!--notification--> <!--notification-->
<string name="EncryptedChatRequested">Privégesprek aangevraagd</string> <string name="EncryptedChatRequested">Privégesprek aangevraagd</string>
......
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
<resources> <resources>
<string name="AppName">Telegram</string> <string name="AppName">Telegram</string>
<string name="LanguangeName">English</string> <string name="LanguageName">English</string>
<string name="LanguangeNameInEnglish">English</string> <string name="LanguageNameInEnglish">English</string>
<string name="LanguageCode">en</string>
<!--signin view--> <!--signin view-->
<string name="YourPhone">Your phone</string> <string name="YourPhone">Your phone</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment