Commit 53ddefb8 authored by DrKLO's avatar DrKLO

Bug fixes

parent f7d3faab
...@@ -80,7 +80,7 @@ android { ...@@ -80,7 +80,7 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 8 minSdkVersion 8
targetSdkVersion 19 targetSdkVersion 19
versionCode 335 versionCode 343
versionName "1.9.0" versionName "1.9.1"
} }
} }
...@@ -551,7 +551,7 @@ public class ImageLoader { ...@@ -551,7 +551,7 @@ public class ImageLoader {
@Override @Override
public void run() { public void run() {
if (location != null) { if (location != null) {
if (telegramPath != null && finalFile != null && finalFile.exists() && location.endsWith(".mp4") || location.endsWith(".jpg")) { if (MediaController.getInstance().canSaveToGallery() && telegramPath != null && finalFile != null && finalFile.exists() && (location.endsWith(".mp4") || location.endsWith(".jpg"))) {
if (finalFile.toString().startsWith(telegramPath.toString())) { if (finalFile.toString().startsWith(telegramPath.toString())) {
Utilities.addMediaToGallery(finalFile.toString()); Utilities.addMediaToGallery(finalFile.toString());
} }
...@@ -624,7 +624,6 @@ public class ImageLoader { ...@@ -624,7 +624,6 @@ public class ImageLoader {
File videoPath = new File(telegramPath, LocaleController.getString("AppName", R.string.AppName) + " Video"); File videoPath = new File(telegramPath, LocaleController.getString("AppName", R.string.AppName) + " Video");
videoPath.mkdir(); videoPath.mkdir();
if (videoPath.isDirectory()) { if (videoPath.isDirectory()) {
//new File(videoPath, ".nomedia").delete();
mediaDirs.put(FileLoader.MEDIA_DIR_VIDEO, videoPath); mediaDirs.put(FileLoader.MEDIA_DIR_VIDEO, videoPath);
} }
} catch (Exception e) { } catch (Exception e) {
......
...@@ -172,6 +172,8 @@ public class MediaController implements NotificationCenter.NotificationCenterDel ...@@ -172,6 +172,8 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
private ArrayList<DownloadObject> videoDownloadQueue = new ArrayList<DownloadObject>(); private ArrayList<DownloadObject> videoDownloadQueue = new ArrayList<DownloadObject>();
private HashMap<String, DownloadObject> downloadQueueKeys = new HashMap<String, DownloadObject>(); private HashMap<String, DownloadObject> downloadQueueKeys = new HashMap<String, DownloadObject>();
private boolean saveToGallery = true;
private HashMap<String, ArrayList<WeakReference<FileDownloadProgressListener>>> loadingFileObservers = new HashMap<String, ArrayList<WeakReference<FileDownloadProgressListener>>>(); private HashMap<String, ArrayList<WeakReference<FileDownloadProgressListener>>> loadingFileObservers = new HashMap<String, ArrayList<WeakReference<FileDownloadProgressListener>>>();
private HashMap<Integer, String> observersByTag = new HashMap<Integer, String>(); private HashMap<Integer, String> observersByTag = new HashMap<Integer, String>();
private boolean listenerInProgress = false; private boolean listenerInProgress = false;
...@@ -392,6 +394,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel ...@@ -392,6 +394,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
mobileDataDownloadMask = preferences.getInt("mobileDataDownloadMask", AUTODOWNLOAD_MASK_PHOTO | AUTODOWNLOAD_MASK_AUDIO); mobileDataDownloadMask = preferences.getInt("mobileDataDownloadMask", AUTODOWNLOAD_MASK_PHOTO | AUTODOWNLOAD_MASK_AUDIO);
wifiDownloadMask = preferences.getInt("wifiDownloadMask", AUTODOWNLOAD_MASK_PHOTO | AUTODOWNLOAD_MASK_AUDIO); wifiDownloadMask = preferences.getInt("wifiDownloadMask", AUTODOWNLOAD_MASK_PHOTO | AUTODOWNLOAD_MASK_AUDIO);
roamingDownloadMask = preferences.getInt("roamingDownloadMask", 0); roamingDownloadMask = preferences.getInt("roamingDownloadMask", 0);
saveToGallery = preferences.getBoolean("save_gallery", false);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidFailedLoad); NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidFailedLoad);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidLoaded); NotificationCenter.getInstance().addObserver(this, NotificationCenter.FileDidLoaded);
...@@ -1785,6 +1788,43 @@ public class MediaController implements NotificationCenter.NotificationCenterDel ...@@ -1785,6 +1788,43 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
return null; return null;
} }
public void toggleSaveToGallery() {
saveToGallery = !saveToGallery;
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
editor.putBoolean("save_gallery", saveToGallery);
editor.commit();
try {
File telegramPath = new File(Environment.getExternalStorageDirectory(), LocaleController.getString("AppName", R.string.AppName));
File imagePath = new File(telegramPath, LocaleController.getString("AppName", R.string.AppName) + " Images");
imagePath.mkdir();
File videoPath = new File(telegramPath, LocaleController.getString("AppName", R.string.AppName) + " Video");
videoPath.mkdir();
if (saveToGallery) {
if (imagePath.isDirectory()) {
new File(imagePath, ".nomedia").delete();
}
if (videoPath.isDirectory()) {
new File(videoPath, ".nomedia").delete();
}
} else {
if (imagePath.isDirectory()) {
new File(imagePath, ".nomedia").createNewFile();
}
if (videoPath.isDirectory()) {
new File(videoPath, ".nomedia").createNewFile();
}
}
} catch (Exception e) {
FileLog.e("tmessages", e);
}
}
public boolean canSaveToGallery() {
return saveToGallery;
}
public static void loadGalleryPhotosAlbums(final int guid) { public static void loadGalleryPhotosAlbums(final int guid) {
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
...@@ -1972,7 +2012,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel ...@@ -1972,7 +2012,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
return -5; return -5;
} }
private void didWriteData(final MessageObject messageObject, final File file, final long finalSize, final boolean error) { private void didWriteData(final MessageObject messageObject, final File file, final boolean last, final boolean error) {
final boolean firstWrite = videoConvertFirstWrite; final boolean firstWrite = videoConvertFirstWrite;
if (firstWrite) { if (firstWrite) {
videoConvertFirstWrite = false; videoConvertFirstWrite = false;
...@@ -1986,9 +2026,9 @@ public class MediaController implements NotificationCenter.NotificationCenterDel ...@@ -1986,9 +2026,9 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
if (firstWrite) { if (firstWrite) {
NotificationCenter.getInstance().postNotificationName(NotificationCenter.FilePreparingStarted, messageObject, file.toString()); NotificationCenter.getInstance().postNotificationName(NotificationCenter.FilePreparingStarted, messageObject, file.toString());
} }
NotificationCenter.getInstance().postNotificationName(NotificationCenter.FileNewChunkAvailable, messageObject, file.toString(), finalSize); NotificationCenter.getInstance().postNotificationName(NotificationCenter.FileNewChunkAvailable, messageObject, file.toString(), last ? file.length() : 0);
} }
if (error || finalSize != 0) { if (error || last) {
synchronized (videoConvertSync) { synchronized (videoConvertSync) {
cancelCurrentVideoConversion = false; cancelCurrentVideoConversion = false;
} }
...@@ -2043,7 +2083,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel ...@@ -2043,7 +2083,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
buffer.putInt(info.size - 4); buffer.putInt(info.size - 4);
} }
if (mediaMuxer.writeSampleData(muxerTrackIndex, buffer, info)) { if (mediaMuxer.writeSampleData(muxerTrackIndex, buffer, info)) {
didWriteData(messageObject, file, 0, false); didWriteData(messageObject, file, false, false);
} }
extractor.advance(); extractor.advance();
} else { } else {
...@@ -2172,13 +2212,13 @@ public class MediaController implements NotificationCenter.NotificationCenterDel ...@@ -2172,13 +2212,13 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
int colorFormat = 0; int colorFormat = 0;
int processorType = PROCESSOR_TYPE_OTHER; int processorType = PROCESSOR_TYPE_OTHER;
String manufacturer = Build.MANUFACTURER.toLowerCase();
if (Build.VERSION.SDK_INT < 18) { if (Build.VERSION.SDK_INT < 18) {
MediaCodecInfo codecInfo = selectCodec(MIME_TYPE); MediaCodecInfo codecInfo = selectCodec(MIME_TYPE);
colorFormat = selectColorFormat(codecInfo, MIME_TYPE); colorFormat = selectColorFormat(codecInfo, MIME_TYPE);
if (colorFormat == 0) { if (colorFormat == 0) {
throw new RuntimeException("no supported color format"); throw new RuntimeException("no supported color format");
} }
String manufacturer = Build.MANUFACTURER.toLowerCase();
String codecName = codecInfo.getName(); String codecName = codecInfo.getName();
if (codecName.contains("OMX.qcom.")) { if (codecName.contains("OMX.qcom.")) {
processorType = PROCESSOR_TYPE_QCOM; processorType = PROCESSOR_TYPE_QCOM;
...@@ -2213,7 +2253,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel ...@@ -2213,7 +2253,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
bufferSize += padding * 5 / 4; bufferSize += padding * 5 / 4;
} }
} else if (processorType == PROCESSOR_TYPE_QCOM) { } else if (processorType == PROCESSOR_TYPE_QCOM) {
if (!Build.MANUFACTURER.toLowerCase().equals("lge")) { if (!manufacturer.toLowerCase().equals("lge")) {
int uvoffset = (resultWidth * resultHeight + 2047) & ~2047; int uvoffset = (resultWidth * resultHeight + 2047) & ~2047;
padding = uvoffset - (resultWidth * resultHeight); padding = uvoffset - (resultWidth * resultHeight);
bufferSize += padding; bufferSize += padding;
...@@ -2224,6 +2264,12 @@ public class MediaController implements NotificationCenter.NotificationCenterDel ...@@ -2224,6 +2264,12 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
//resultHeightAligned += (16 - (resultHeight % 16)); //resultHeightAligned += (16 - (resultHeight % 16));
//padding = resultWidth * (resultHeightAligned - resultHeight); //padding = resultWidth * (resultHeightAligned - resultHeight);
//bufferSize += padding * 5 / 4; //bufferSize += padding * 5 / 4;
} else if (processorType == PROCESSOR_TYPE_MTK) {
if (manufacturer.equals("baidu")) {
resultHeightAligned += (16 - (resultHeight % 16));
padding = resultWidth * (resultHeightAligned - resultHeight);
bufferSize += padding * 5 / 4;
}
} }
extractor.selectTrack(videoIndex); extractor.selectTrack(videoIndex);
...@@ -2328,7 +2374,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel ...@@ -2328,7 +2374,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
encodedData.position(info.offset); encodedData.position(info.offset);
encodedData.putInt(Integer.reverseBytes(info.size - 4)); encodedData.putInt(Integer.reverseBytes(info.size - 4));
if (mediaMuxer.writeSampleData(videoTrackIndex, encodedData, info)) { if (mediaMuxer.writeSampleData(videoTrackIndex, encodedData, info)) {
didWriteData(messageObject, cacheFile, 0, false); didWriteData(messageObject, cacheFile, false, false);
} }
} else if (videoTrackIndex == -5) { } else if (videoTrackIndex == -5) {
byte[] csd = new byte[info.size]; byte[] csd = new byte[info.size];
...@@ -2504,7 +2550,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel ...@@ -2504,7 +2550,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
} else { } else {
return false; return false;
} }
didWriteData(messageObject, cacheFile, cacheFile.length(), error); didWriteData(messageObject, cacheFile, true, error);
return true; return true;
} }
} }
...@@ -105,7 +105,11 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter ...@@ -105,7 +105,11 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
} else if (message.type == 1) { } else if (message.type == 1) {
if (media.file == null) { if (media.file == null) {
media.file = file; media.file = file;
performSendDelayedMessage(message); if (media.thumb == null && message.location != null) {
performSendDelayedMessage(message);
} else {
performSendMessageRequest(message.sendRequest, message.obj, message.originalPath);
}
} else { } else {
media.thumb = file; media.thumb = file;
performSendMessageRequest(message.sendRequest, message.obj, message.originalPath); performSendMessageRequest(message.sendRequest, message.obj, message.originalPath);
...@@ -261,6 +265,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter ...@@ -261,6 +265,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
} }
if (keyToRemvoe != null) { if (keyToRemvoe != null) {
FileLoader.getInstance().cancelUploadFile(keyToRemvoe, enc); FileLoader.getInstance().cancelUploadFile(keyToRemvoe, enc);
stopVideoService(keyToRemvoe);
} }
ArrayList<Integer> messages = new ArrayList<Integer>(); ArrayList<Integer> messages = new ArrayList<Integer>();
messages.add(object.messageOwner.id); messages.add(object.messageOwner.id);
...@@ -610,7 +615,11 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter ...@@ -610,7 +615,11 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
} }
} else if (type == 3) { } else if (type == 3) {
if (video.access_hash == 0) { if (video.access_hash == 0) {
inputMedia = new TLRPC.TL_inputMediaUploadedThumbVideo(); if (video.thumb.location != null) {
inputMedia = new TLRPC.TL_inputMediaUploadedThumbVideo();
} else {
inputMedia = new TLRPC.TL_inputMediaUploadedVideo();
}
inputMedia.duration = video.duration; inputMedia.duration = video.duration;
inputMedia.w = video.w; inputMedia.w = video.w;
inputMedia.h = video.h; inputMedia.h = video.h;
...@@ -910,7 +919,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter ...@@ -910,7 +919,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
location = FileLoader.getInstance().getDirectory(FileLoader.MEDIA_DIR_CACHE) + "/" + message.videoLocation.id + ".mp4"; location = FileLoader.getInstance().getDirectory(FileLoader.MEDIA_DIR_CACHE) + "/" + message.videoLocation.id + ".mp4";
} }
putToDelayedMessages(location, message); putToDelayedMessages(location, message);
if (message.videoLocation.videoEditedInfo != null) { if (message.obj.messageOwner.videoEditedInfo != null) {
FileLoader.getInstance().uploadFile(location, true, false, message.videoLocation.size); FileLoader.getInstance().uploadFile(location, true, false, message.videoLocation.size);
} else { } else {
FileLoader.getInstance().uploadFile(location, true, false); FileLoader.getInstance().uploadFile(location, true, false);
......
...@@ -45,6 +45,7 @@ public class FileUploadOperation { ...@@ -45,6 +45,7 @@ public class FileUploadOperation {
private int uploadStartTime = 0; private int uploadStartTime = 0;
private FileInputStream stream; private FileInputStream stream;
private MessageDigest mdEnc = null; private MessageDigest mdEnc = null;
private boolean started = false;
public static interface FileUploadOperationDelegate { public static interface FileUploadOperationDelegate {
public abstract void didFinishUploadingFile(FileUploadOperation operation, TLRPC.InputFile inputFile, TLRPC.InputEncryptedFile inputEncryptedFile); public abstract void didFinishUploadingFile(FileUploadOperation operation, TLRPC.InputFile inputFile, TLRPC.InputEncryptedFile inputEncryptedFile);
...@@ -102,8 +103,10 @@ public class FileUploadOperation { ...@@ -102,8 +103,10 @@ public class FileUploadOperation {
estimatedSize = 0; estimatedSize = 0;
totalFileSize = finalSize; totalFileSize = finalSize;
totalPartsCount = (int) Math.ceil((float) totalFileSize / (float) uploadChunkSize); totalPartsCount = (int) Math.ceil((float) totalFileSize / (float) uploadChunkSize);
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("uploadinfo", Activity.MODE_PRIVATE); if (started) {
storeFileUploadInfo(preferences); SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("uploadinfo", Activity.MODE_PRIVATE);
storeFileUploadInfo(preferences);
}
} }
if (requestToken == 0) { if (requestToken == 0) {
startUploadRequest(); startUploadRequest();
...@@ -134,6 +137,7 @@ public class FileUploadOperation { ...@@ -134,6 +137,7 @@ public class FileUploadOperation {
TLObject finalRequest; TLObject finalRequest;
try { try {
started = true;
if (stream == null) { if (stream == null) {
File cacheFile = new File(uploadingFilePath); File cacheFile = new File(uploadingFilePath);
stream = new FileInputStream(cacheFile); stream = new FileInputStream(cacheFile);
......
...@@ -169,6 +169,8 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ...@@ -169,6 +169,8 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
private long chatEnterTime = 0; private long chatEnterTime = 0;
private long chatLeaveTime = 0; private long chatLeaveTime = 0;
private String startVideoEdit = null;
private final static int copy = 1; private final static int copy = 1;
private final static int forward = 2; private final static int forward = 2;
private final static int delete = 3; private final static int delete = 3;
...@@ -424,7 +426,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ...@@ -424,7 +426,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(image)); takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(image));
currentPicturePath = image.getAbsolutePath(); currentPicturePath = image.getAbsolutePath();
} }
getParentActivity().startActivityForResult(takePictureIntent, 0); startActivityForResult(takePictureIntent, 0);
} catch (Exception e) { } catch (Exception e) {
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
} }
...@@ -441,7 +443,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ...@@ -441,7 +443,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
Intent takeVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); Intent takeVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
File video = Utilities.generateVideoPath(); File video = Utilities.generateVideoPath();
if (video != null) { if (video != null) {
if (android.os.Build.VERSION.SDK_INT >= 18) { if (Build.VERSION.SDK_INT >= 18) {
takeVideoIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(video)); takeVideoIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(video));
} }
takeVideoIntent.putExtra(MediaStore.EXTRA_SIZE_LIMIT, (long) (1024 * 1024 * 1000)); takeVideoIntent.putExtra(MediaStore.EXTRA_SIZE_LIMIT, (long) (1024 * 1024 * 1000));
...@@ -450,7 +452,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ...@@ -450,7 +452,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
Intent chooserIntent = Intent.createChooser(pickIntent, ""); Intent chooserIntent = Intent.createChooser(pickIntent, "");
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[]{takeVideoIntent}); chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[]{takeVideoIntent});
getParentActivity().startActivityForResult(chooserIntent, 2); startActivityForResult(chooserIntent, 2);
} catch (Exception e) { } catch (Exception e) {
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
} }
...@@ -510,7 +512,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ...@@ -510,7 +512,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
} }
} }
if (str.length() != 0) { if (str.length() != 0) {
if (android.os.Build.VERSION.SDK_INT < 11) { if (Build.VERSION.SDK_INT < 11) {
android.text.ClipboardManager clipboard = (android.text.ClipboardManager) ApplicationLoader.applicationContext.getSystemService(Context.CLIPBOARD_SERVICE); android.text.ClipboardManager clipboard = (android.text.ClipboardManager) ApplicationLoader.applicationContext.getSystemService(Context.CLIPBOARD_SERVICE);
clipboard.setText(str); clipboard.setText(str);
} else { } else {
...@@ -897,7 +899,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ...@@ -897,7 +899,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
} }
if (show) { if (show) {
if (pagedownButton.getVisibility() == View.GONE) { if (pagedownButton.getVisibility() == View.GONE) {
if (android.os.Build.VERSION.SDK_INT > 13 && animated) { if (Build.VERSION.SDK_INT > 13 && animated) {
pagedownButton.setVisibility(View.VISIBLE); pagedownButton.setVisibility(View.VISIBLE);
pagedownButton.setAlpha(0); pagedownButton.setAlpha(0);
pagedownButton.animate().alpha(1).setDuration(200).setListener(null).start(); pagedownButton.animate().alpha(1).setDuration(200).setListener(null).start();
...@@ -907,7 +909,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ...@@ -907,7 +909,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
} }
} else { } else {
if (pagedownButton.getVisibility() == View.VISIBLE) { if (pagedownButton.getVisibility() == View.VISIBLE) {
if (android.os.Build.VERSION.SDK_INT > 13 && animated) { if (Build.VERSION.SDK_INT > 13 && animated) {
pagedownButton.animate().alpha(0).setDuration(200).setListener(new Animator.AnimatorListener() { pagedownButton.animate().alpha(0).setDuration(200).setListener(new Animator.AnimatorListener() {
@Override @Override
public void onAnimationStart(Animator animation) { public void onAnimationStart(Animator animation) {
...@@ -1366,12 +1368,18 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ...@@ -1366,12 +1368,18 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
} }
currentPicturePath = null; currentPicturePath = null;
} }
if(android.os.Build.VERSION.SDK_INT >= 16) { if(Build.VERSION.SDK_INT >= 16) {
Bundle args = new Bundle(); if (paused) {
args.putString("videoPath", videoPath); startVideoEdit = videoPath;
VideoEditorActivity fragment = new VideoEditorActivity(args); } else {
fragment.setDelegate(this); Bundle args = new Bundle();
presentFragment(fragment, false, true); args.putString("videoPath", videoPath);
VideoEditorActivity fragment = new VideoEditorActivity(args);
fragment.setDelegate(this);
if (!presentFragment(fragment, false, true)) {
processSendingVideo(videoPath, 0, 0, 0, 0, null);
}
}
} else { } else {
processSendingVideo(videoPath, 0, 0, 0, 0, null); processSendingVideo(videoPath, 0, 0, 0, 0, null);
} }
...@@ -1662,12 +1670,13 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ...@@ -1662,12 +1670,13 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if (video == null) { if (video == null) {
Bitmap thumb = ThumbnailUtils.createVideoThumbnail(videoPath, MediaStore.Video.Thumbnails.MINI_KIND); Bitmap thumb = ThumbnailUtils.createVideoThumbnail(videoPath, MediaStore.Video.Thumbnails.MINI_KIND);
TLRPC.PhotoSize size = ImageLoader.scaleAndSaveImage(thumb, 90, 90, 55, currentEncryptedChat != null); TLRPC.PhotoSize size = ImageLoader.scaleAndSaveImage(thumb, 90, 90, 55, currentEncryptedChat != null);
if (size == null) {
return;
}
size.type = "s";
video = new TLRPC.TL_video(); video = new TLRPC.TL_video();
video.thumb = size; video.thumb = size;
if (video.thumb == null) {
video.thumb = new TLRPC.TL_photoSizeEmpty();
} else {
video.thumb.type = "s";
}
video.caption = ""; video.caption = "";
video.mime_type = "video/mp4"; video.mime_type = "video/mp4";
video.id = 0; video.id = 0;
...@@ -1693,7 +1702,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ...@@ -1693,7 +1702,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if (temp != null && temp.exists()) { if (temp != null && temp.exists()) {
video.size = (int) temp.length(); video.size = (int) temp.length();
} }
if (Build.VERSION.SDK_INT >= 10) { if (Build.VERSION.SDK_INT >= 14) {
MediaMetadataRetriever mediaMetadataRetriever = new MediaMetadataRetriever(); MediaMetadataRetriever mediaMetadataRetriever = new MediaMetadataRetriever();
mediaMetadataRetriever.setDataSource(videoPath); mediaMetadataRetriever.setDataSource(videoPath);
String width = mediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH); String width = mediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH);
...@@ -2519,6 +2528,22 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ...@@ -2519,6 +2528,22 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
chatEnterTime = System.currentTimeMillis(); chatEnterTime = System.currentTimeMillis();
chatLeaveTime = 0; chatLeaveTime = 0;
} }
if (startVideoEdit != null) {
AndroidUtilities.RunOnUIThread(new Runnable() {
@Override
public void run() {
Bundle args = new Bundle();
args.putString("videoPath", startVideoEdit);
VideoEditorActivity fragment = new VideoEditorActivity(args);
fragment.setDelegate(ChatActivity.this);
if (!presentFragment(fragment, false, true)) {
processSendingVideo(startVideoEdit, 0, 0, 0, 0, null);
}
startVideoEdit = null;
}
});
}
} }
@Override @Override
...@@ -2542,7 +2567,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ...@@ -2542,7 +2567,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
try { try {
Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
photoPickerIntent.setType("image/*"); photoPickerIntent.setType("image/*");
getParentActivity().startActivityForResult(photoPickerIntent, 1); startActivityForResult(photoPickerIntent, 1);
} catch (Exception e) { } catch (Exception e) {
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
} }
...@@ -2874,7 +2899,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ...@@ -2874,7 +2899,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
fragment.setDelegate(this); fragment.setDelegate(this);
presentFragment(fragment); presentFragment(fragment);
} else if (option == 3) { } else if (option == 3) {
if(android.os.Build.VERSION.SDK_INT < 11) { if(Build.VERSION.SDK_INT < 11) {
android.text.ClipboardManager clipboard = (android.text.ClipboardManager)ApplicationLoader.applicationContext.getSystemService(Context.CLIPBOARD_SERVICE); android.text.ClipboardManager clipboard = (android.text.ClipboardManager)ApplicationLoader.applicationContext.getSystemService(Context.CLIPBOARD_SERVICE);
clipboard.setText(selectedObject.messageText); clipboard.setText(selectedObject.messageText);
} else { } else {
...@@ -2938,7 +2963,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not ...@@ -2938,7 +2963,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
try { try {
Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
photoPickerIntent.setType("*/*"); photoPickerIntent.setType("*/*");
getParentActivity().startActivityForResult(photoPickerIntent, 21); startActivityForResult(photoPickerIntent, 21);
} catch (Exception e) { } catch (Exception e) {
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
} }
......
...@@ -183,7 +183,7 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi ...@@ -183,7 +183,7 @@ public class ProfileNotificationsActivity extends BaseFragment implements Notifi
} }
tmpIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, currentSound); tmpIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, currentSound);
getParentActivity().startActivityForResult(tmpIntent, 12); startActivityForResult(tmpIntent, 12);
} catch (Exception e) { } catch (Exception e) {
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
} }
......
...@@ -91,6 +91,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter ...@@ -91,6 +91,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
private int mobileDownloadRow; private int mobileDownloadRow;
private int wifiDownloadRow; private int wifiDownloadRow;
private int roamingDownloadRow; private int roamingDownloadRow;
private int saveToGalleryRow;
private int telegramFaqRow; private int telegramFaqRow;
private int languageRow; private int languageRow;
private int versionRow; private int versionRow;
...@@ -188,6 +189,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter ...@@ -188,6 +189,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
mobileDownloadRow = rowCount++; mobileDownloadRow = rowCount++;
wifiDownloadRow = rowCount++; wifiDownloadRow = rowCount++;
roamingDownloadRow = rowCount++; roamingDownloadRow = rowCount++;
saveToGalleryRow = rowCount++;
messagesSectionRow = rowCount++; messagesSectionRow = rowCount++;
textSizeRow = rowCount++; textSizeRow = rowCount++;
sendByEnterRow = rowCount++; sendByEnterRow = rowCount++;
...@@ -325,6 +327,11 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter ...@@ -325,6 +327,11 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
if (listView != null) { if (listView != null) {
listView.invalidateViews(); listView.invalidateViews();
} }
} else if (i == saveToGalleryRow) {
MediaController.getInstance().toggleSaveToGallery();
if (listView != null) {
listView.invalidateViews();
}
} else if (i == terminateSessionsRow) { } else if (i == terminateSessionsRow) {
if (getParentActivity() == null) { if (getParentActivity() == null) {
return; return;
...@@ -717,7 +724,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter ...@@ -717,7 +724,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
return i == textSizeRow || i == enableAnimationsRow || i == blockedRow || i == notificationRow || i == backgroundRow || return i == textSizeRow || i == enableAnimationsRow || i == blockedRow || i == notificationRow || i == backgroundRow ||
i == askQuestionRow || i == sendLogsRow || i == sendByEnterRow || i == terminateSessionsRow || i == wifiDownloadRow || i == askQuestionRow || i == sendLogsRow || i == sendByEnterRow || i == terminateSessionsRow || i == wifiDownloadRow ||
i == mobileDownloadRow || i == clearLogsRow || i == roamingDownloadRow || i == languageRow || i == mobileDownloadRow || i == clearLogsRow || i == roamingDownloadRow || i == languageRow ||
i == switchBackendButtonRow || i == telegramFaqRow || i == contactsSortRow || i == contactsReimportRow; i == switchBackendButtonRow || i == telegramFaqRow || i == contactsSortRow || i == contactsReimportRow || i == saveToGalleryRow;
} }
@Override @Override
...@@ -921,18 +928,15 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter ...@@ -921,18 +928,15 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
} else { } else {
checkButton.setImageResource(R.drawable.btn_check_off); checkButton.setImageResource(R.drawable.btn_check_off);
} }
} else if (i == saveToGalleryRow) {
textView.setText(LocaleController.getString("SaveToGallerySettings", R.string.SaveToGallerySettings));
divider.setVisibility(View.INVISIBLE);
if (MediaController.getInstance().canSaveToGallery()) {
checkButton.setImageResource(R.drawable.btn_check_on);
} else {
checkButton.setImageResource(R.drawable.btn_check_off);
}
} }
// if (i == 7) {
// textView.setText(LocaleController.getString(R.string.SaveIncomingPhotos));
// divider.setVisibility(View.INVISIBLE);
//
// ImageView checkButton = (ImageView)view.findViewById(R.id.settings_row_check_button);
// if (UserConfig.saveIncomingPhotos) {
// checkButton.setImageResource(R.drawable.btn_check_on);
// } else {
// checkButton.setImageResource(R.drawable.btn_check_off);
// }
// }
} else if (type == 4) { } else if (type == 4) {
if (view == null) { if (view == null) {
LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
...@@ -1032,7 +1036,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter ...@@ -1032,7 +1036,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
mask = MediaController.getInstance().wifiDownloadMask; mask = MediaController.getInstance().wifiDownloadMask;
} else if (i == roamingDownloadRow) { } else if (i == roamingDownloadRow) {
textView.setText(LocaleController.getString("WhenRoaming", R.string.WhenRoaming)); textView.setText(LocaleController.getString("WhenRoaming", R.string.WhenRoaming));
divider.setVisibility(View.GONE); divider.setVisibility(View.VISIBLE);
mask = MediaController.getInstance().roamingDownloadMask; mask = MediaController.getInstance().roamingDownloadMask;
} }
String text = ""; String text = "";
...@@ -1073,7 +1077,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter ...@@ -1073,7 +1077,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
return 1; return 1;
} else if (i == textSizeRow || i == languageRow || i == contactsSortRow) { } else if (i == textSizeRow || i == languageRow || i == contactsSortRow) {
return 5; return 5;
} else if (i == enableAnimationsRow || i == sendByEnterRow) { } else if (i == enableAnimationsRow || i == sendByEnterRow || i == saveToGalleryRow) {
return 3; return 3;
} else if (i == numberRow || i == notificationRow || i == blockedRow || i == backgroundRow || i == askQuestionRow || i == sendLogsRow || i == terminateSessionsRow || i == clearLogsRow || i == switchBackendButtonRow || i == telegramFaqRow || i == contactsReimportRow) { } else if (i == numberRow || i == notificationRow || i == blockedRow || i == backgroundRow || i == askQuestionRow || i == sendLogsRow || i == terminateSessionsRow || i == clearLogsRow || i == switchBackendButtonRow || i == telegramFaqRow || i == contactsReimportRow) {
return 2; return 2;
......
...@@ -200,7 +200,7 @@ public class SettingsNotificationsActivity extends BaseFragment implements Notif ...@@ -200,7 +200,7 @@ public class SettingsNotificationsActivity extends BaseFragment implements Notif
} }
} }
tmpIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, currentSound); tmpIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, currentSound);
getParentActivity().startActivityForResult(tmpIntent, i); startActivityForResult(tmpIntent, i);
} catch (Exception e) { } catch (Exception e) {
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
} }
......
...@@ -184,11 +184,11 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica ...@@ -184,11 +184,11 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(image)); takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(image));
currentPicturePath = image.getAbsolutePath(); currentPicturePath = image.getAbsolutePath();
} }
getParentActivity().startActivityForResult(takePictureIntent, 10); startActivityForResult(takePictureIntent, 10);
} else if (i == 1) { } else if (i == 1) {
Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
photoPickerIntent.setType("image/*"); photoPickerIntent.setType("image/*");
getParentActivity().startActivityForResult(photoPickerIntent, 11); startActivityForResult(photoPickerIntent, 11);
} }
} catch (Exception e) { } catch (Exception e) {
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
......
...@@ -14,6 +14,7 @@ import android.content.SharedPreferences; ...@@ -14,6 +14,7 @@ import android.content.SharedPreferences;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.graphics.SurfaceTexture; import android.graphics.SurfaceTexture;
import android.media.MediaPlayer; import android.media.MediaPlayer;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.Gravity; import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
...@@ -99,10 +100,19 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur ...@@ -99,10 +100,19 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
@Override @Override
public void run() { public void run() {
boolean playerCheck = false; boolean playerCheck = false;
synchronized (sync) {
playerCheck = videoPlayer != null && videoPlayer.isPlaying(); while (true) {
} synchronized (sync) {
while (playerCheck) { try {
playerCheck = videoPlayer != null && videoPlayer.isPlaying();
} catch (Exception e) {
playerCheck = false;
FileLog.e("tmessages", e);
}
}
if (!playerCheck) {
break;
}
AndroidUtilities.RunOnUIThread(new Runnable() { AndroidUtilities.RunOnUIThread(new Runnable() {
@Override @Override
public void run() { public void run() {
...@@ -176,6 +186,7 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur ...@@ -176,6 +186,7 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
videoPlayer.prepareAsync(); videoPlayer.prepareAsync();
} catch (Exception e) { } catch (Exception e) {
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
return false;
} }
return super.onFragmentCreate(); return super.onFragmentCreate();
...@@ -357,10 +368,24 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur ...@@ -357,10 +368,24 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
parent.removeView(fragmentView); parent.removeView(fragmentView);
} }
} }
fixLayoutInternal();
return fragmentView; return fragmentView;
} }
private void setPlayerSurface() {
if (textureView == null || !textureView.isAvailable() || videoPlayer == null) {
return;
}
try {
Surface s = new Surface(textureView.getSurfaceTexture());
videoPlayer.setSurface(s);
if (playerPrepared) {
videoPlayer.seekTo((int) (videoTimelineView.getLeftProgress() * videoDuration));
}
} catch (Exception e) {
FileLog.e("tmessages", e);
}
}
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
...@@ -375,18 +400,7 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur ...@@ -375,18 +400,7 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
@Override @Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) { public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
if (videoPlayer == null) { setPlayerSurface();
return;
}
try {
Surface s = new Surface(surface);
videoPlayer.setSurface(s);
if (playerPrepared) {
videoPlayer.seekTo((int) (videoTimelineView.getLeftProgress() * videoDuration));
}
} catch (Exception e) {
FileLog.e("tmessages", e);
}
} }
@Override @Override
...@@ -515,12 +529,14 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur ...@@ -515,12 +529,14 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
height = (int) (width / ar); height = (int) (width / ar);
} }
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams)textureView.getLayoutParams(); if (textureView != null) {
layoutParams.width = width; FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) textureView.getLayoutParams();
layoutParams.height = height; layoutParams.width = width;
layoutParams.leftMargin = 0; layoutParams.height = height;
layoutParams.topMargin = 0; layoutParams.leftMargin = 0;
textureView.setLayoutParams(layoutParams); layoutParams.topMargin = 0;
textureView.setLayoutParams(layoutParams);
}
} }
private void fixLayoutInternal() { private void fixLayoutInternal() {
...@@ -574,17 +590,20 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur ...@@ -574,17 +590,20 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
} }
private void fixLayout() { private void fixLayout() {
if (originalSizeTextView == null) { if (fragmentView == null) {
return; return;
} }
fragmentView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { fragmentView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override @Override
public boolean onPreDraw() { public void onGlobalLayout() {
fixLayoutInternal(); fixLayoutInternal();
if (fragmentView != null) { if (fragmentView != null) {
fragmentView.getViewTreeObserver().removeOnPreDrawListener(this); if (Build.VERSION.SDK_INT < 16) {
fragmentView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
} else {
fragmentView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
}
} }
return true;
} }
}); });
} }
...@@ -644,9 +663,19 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur ...@@ -644,9 +663,19 @@ public class VideoEditorActivity extends BaseFragment implements TextureView.Sur
List<Box> boxes = Path.getPaths(isoFile, "/moov/trak/"); List<Box> boxes = Path.getPaths(isoFile, "/moov/trak/");
TrackHeaderBox trackHeaderBox = null; TrackHeaderBox trackHeaderBox = null;
boolean isAvc = true; boolean isAvc = true;
boolean isMp4A = true;
Box boxTest = Path.getPath(isoFile, "/moov/trak/mdia/minf/stbl/stsd/mp4a/");
if (boxTest == null) {
isMp4A = false;
}
if (!isMp4A) {
return false;
}
Box avc = Path.getPath(isoFile, "/moov/trak/mdia/minf/stbl/stsd/avc1/"); boxTest = Path.getPath(isoFile, "/moov/trak/mdia/minf/stbl/stsd/avc1/");
if (avc == null) { if (boxTest == null) {
isAvc = false; isAvc = false;
} }
......
...@@ -418,8 +418,7 @@ public class ActionBarLayout extends FrameLayout { ...@@ -418,8 +418,7 @@ public class ActionBarLayout extends FrameLayout {
} }
private void fixLayout() { private void fixLayout() {
ViewTreeObserver obs = getViewTreeObserver(); getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
obs.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override @Override
public void onGlobalLayout() { public void onGlobalLayout() {
needLayout(); needLayout();
...@@ -790,6 +789,9 @@ public class ActionBarLayout extends FrameLayout { ...@@ -790,6 +789,9 @@ public class ActionBarLayout extends FrameLayout {
} }
public void startActivityForResult(final Intent intent, final int requestCode) { public void startActivityForResult(final Intent intent, final int requestCode) {
if (parentActivity == null) {
return;
}
if (transitionAnimationInProgress) { if (transitionAnimationInProgress) {
if (onCloseAnimationEndRunnable != null) { if (onCloseAnimationEndRunnable != null) {
closeAnimation.cancel(); closeAnimation.cancel();
......
...@@ -31,6 +31,7 @@ import android.widget.LinearLayout; ...@@ -31,6 +31,7 @@ import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import org.telegram.android.AndroidUtilities; import org.telegram.android.AndroidUtilities;
import org.telegram.android.LocaleController;
import org.telegram.messenger.R; import org.telegram.messenger.R;
import java.lang.reflect.Field; import java.lang.reflect.Field;
...@@ -155,7 +156,7 @@ public class ActionBarMenuItem extends ImageView { ...@@ -155,7 +156,7 @@ public class ActionBarMenuItem extends ImageView {
delimeter.setBackgroundColor(0xffdcdcdc); delimeter.setBackgroundColor(0xffdcdcdc);
popupLayout.addView(delimeter); popupLayout.addView(delimeter);
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)delimeter.getLayoutParams(); LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)delimeter.getLayoutParams();
layoutParams.width = AndroidUtilities.dp(196); layoutParams.width = LinearLayout.LayoutParams.MATCH_PARENT;
layoutParams.height = AndroidUtilities.density >= 3 ? 2 : 1; layoutParams.height = AndroidUtilities.density >= 3 ? 2 : 1;
delimeter.setLayoutParams(layoutParams); delimeter.setLayoutParams(layoutParams);
delimeter.setTag(100 + id); delimeter.setTag(100 + id);
...@@ -163,7 +164,11 @@ public class ActionBarMenuItem extends ImageView { ...@@ -163,7 +164,11 @@ public class ActionBarMenuItem extends ImageView {
TextView textView = new TextView(getContext()); TextView textView = new TextView(getContext());
textView.setTextColor(0xff000000); textView.setTextColor(0xff000000);
textView.setBackgroundResource(R.drawable.list_selector); textView.setBackgroundResource(R.drawable.list_selector);
textView.setGravity(Gravity.CENTER_VERTICAL); if (!LocaleController.isRTL) {
textView.setGravity(Gravity.CENTER_VERTICAL);
} else {
textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.RIGHT);
}
textView.setPadding(AndroidUtilities.dp(16), 0, AndroidUtilities.dp(16), 0); textView.setPadding(AndroidUtilities.dp(16), 0, AndroidUtilities.dp(16), 0);
textView.setTextSize(18); textView.setTextSize(18);
textView.setMinWidth(AndroidUtilities.dp(196)); textView.setMinWidth(AndroidUtilities.dp(196));
...@@ -171,10 +176,17 @@ public class ActionBarMenuItem extends ImageView { ...@@ -171,10 +176,17 @@ public class ActionBarMenuItem extends ImageView {
textView.setText(text); textView.setText(text);
if (icon != 0) { if (icon != 0) {
textView.setCompoundDrawablePadding(AndroidUtilities.dp(12)); textView.setCompoundDrawablePadding(AndroidUtilities.dp(12));
textView.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(icon), null, null, null); if (!LocaleController.isRTL) {
textView.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(icon), null, null, null);
} else {
textView.setCompoundDrawablesWithIntrinsicBounds(null, null, getResources().getDrawable(icon), null);
}
} }
popupLayout.addView(textView); popupLayout.addView(textView);
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)textView.getLayoutParams(); LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)textView.getLayoutParams();
if (LocaleController.isRTL) {
layoutParams.gravity = Gravity.RIGHT;
}
layoutParams.width = LinearLayout.LayoutParams.WRAP_CONTENT; layoutParams.width = LinearLayout.LayoutParams.WRAP_CONTENT;
layoutParams.height = AndroidUtilities.dp(48); layoutParams.height = AndroidUtilities.dp(48);
textView.setLayoutParams(layoutParams); textView.setLayoutParams(layoutParams);
......
...@@ -139,25 +139,16 @@ public class BaseFragment { ...@@ -139,25 +139,16 @@ public class BaseFragment {
} }
public void presentFragment(BaseFragment fragment) { public boolean presentFragment(BaseFragment fragment) {
if (parentLayout == null) { return parentLayout != null && parentLayout.presentFragment(fragment);
return;
}
parentLayout.presentFragment(fragment);
} }
public void presentFragment(BaseFragment fragment, boolean removeLast) { public boolean presentFragment(BaseFragment fragment, boolean removeLast) {
if (parentLayout == null) { return parentLayout != null && parentLayout.presentFragment(fragment, removeLast);
return;
}
parentLayout.presentFragment(fragment, removeLast);
} }
public void presentFragment(BaseFragment fragment, boolean removeLast, boolean forceWithoutAnimation) { public boolean presentFragment(BaseFragment fragment, boolean removeLast, boolean forceWithoutAnimation) {
if (parentLayout == null) { return parentLayout != null && parentLayout.presentFragment(fragment, removeLast, forceWithoutAnimation, true);
return;
}
parentLayout.presentFragment(fragment, removeLast, forceWithoutAnimation, true);
} }
public Activity getParentActivity() { public Activity getParentActivity() {
...@@ -167,6 +158,12 @@ public class BaseFragment { ...@@ -167,6 +158,12 @@ public class BaseFragment {
return null; return null;
} }
public void startActivityForResult(final Intent intent, final int requestCode) {
if (parentLayout != null) {
parentLayout.startActivityForResult(intent, requestCode);
}
}
public void showActionBar() { public void showActionBar() {
if (parentLayout != null) { if (parentLayout != null) {
parentLayout.showActionBar(); parentLayout.showActionBar();
......
...@@ -61,7 +61,7 @@ public class AvatarUpdater implements NotificationCenter.NotificationCenterDeleg ...@@ -61,7 +61,7 @@ public class AvatarUpdater implements NotificationCenter.NotificationCenterDeleg
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(image)); takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(image));
currentPicturePath = image.getAbsolutePath(); currentPicturePath = image.getAbsolutePath();
} }
parentFragment.getParentActivity().startActivityForResult(takePictureIntent, 13); parentFragment.startActivityForResult(takePictureIntent, 13);
} catch (Exception e) { } catch (Exception e) {
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
} }
...@@ -71,7 +71,7 @@ public class AvatarUpdater implements NotificationCenter.NotificationCenterDeleg ...@@ -71,7 +71,7 @@ public class AvatarUpdater implements NotificationCenter.NotificationCenterDeleg
try { try {
Intent photoPickerIntent = new Intent(Intent.ACTION_GET_CONTENT); Intent photoPickerIntent = new Intent(Intent.ACTION_GET_CONTENT);
photoPickerIntent.setType("image/*"); photoPickerIntent.setType("image/*");
parentFragment.getParentActivity().startActivityForResult(photoPickerIntent, 14); parentFragment.startActivityForResult(photoPickerIntent, 14);
} catch (Exception e) { } catch (Exception e) {
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
} }
......
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="#40a0bcdd" />
</shape>
</item>
<item android:state_focused="true">
<shape android:shape="rectangle">
<solid android:color="#40a0bcdd" />
</shape>
</item>
<item android:state_selected="true">
<shape android:shape="rectangle">
<solid android:color="#40a0bcdd" />
</shape>
</item>
<item android:drawable="@drawable/transparent" />
</selector>
\ No newline at end of file
<!--
~ This is the source code of Telegram for Android v. 1.7.x.
~ It is licensed under GNU GPL v. 2 or later.
~ You should have received a copy of the license in this archive (see LICENSE).
~
~ Copyright Nikolai Kudashov, 2013-2014.
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/launch_layout">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/cats"
android:scaleType="centerCrop"
android:id="@+id/launch_background"/>
<LinearLayout
android:layout_width="320dp"
android:layout_height="wrap_content"
android:id="@+id/launch_button_layout"
android:layout_centerVertical="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="308dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/btnshadow"
android:layout_gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="60dp"
android:id="@+id/new_group_button"
android:textColor="#ff54759e"
android:gravity="center_vertical"
android:textSize="20dp"
android:paddingRight="17dp"
android:background="@drawable/launch_button_states"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="1px"
android:background="#ffd6dee4"/>
<TextView
android:layout_width="match_parent"
android:layout_height="60dp"
android:id="@+id/new_secret_button"
android:textColor="#ff54759e"
android:gravity="center_vertical"
android:textSize="20dp"
android:paddingRight="17dp"
android:background="@drawable/launch_button_states"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="1px"
android:background="#ffd6dee4"/>
<TextView
android:layout_width="match_parent"
android:layout_height="60dp"
android:id="@+id/new_broadcast_button"
android:textColor="#ff54759e"
android:gravity="center_vertical"
android:textSize="20dp"
android:paddingRight="17dp"
android:background="@drawable/launch_button_states"/>
</LinearLayout>
<LinearLayout
android:layout_width="308dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/btnshadow"
android:layout_gravity="center"
android:layout_marginTop="18dp">
<TextView
android:layout_width="match_parent"
android:layout_height="60dp"
android:id="@+id/contacts_button"
android:textColor="#ff54759e"
android:gravity="center_vertical"
android:textSize="20dp"
android:paddingRight="17dp"
android:background="@drawable/launch_button_states"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="1px"
android:background="#ffd6dee4"/>
<TextView
android:layout_width="match_parent"
android:layout_height="60dp"
android:id="@+id/settings_button"
android:textColor="#ff54759e"
android:gravity="center_vertical"
android:textSize="20dp"
android:paddingRight="17dp"
android:background="@drawable/launch_button_states"/>
</LinearLayout>
</LinearLayout>
<FrameLayout
android:layout_height="match_parent"
android:layout_width="1dp"
android:background="#40295274"
android:id="@+id/shadow_tablet_side"/>
<FrameLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:id="@+id/shadow_tablet"
android:background="#7F000000"
android:visibility="gone"/>
</RelativeLayout>
\ No newline at end of file
...@@ -33,8 +33,6 @@ ...@@ -33,8 +33,6 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:textSize="20dp" android:textSize="20dp"
android:paddingLeft="17dp" android:paddingLeft="17dp"
android:paddingStart="17dp"
android:paddingEnd="17dp"
android:background="@drawable/launch_button_states"/> android:background="@drawable/launch_button_states"/>
<FrameLayout <FrameLayout
...@@ -50,8 +48,6 @@ ...@@ -50,8 +48,6 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:textSize="20dp" android:textSize="20dp"
android:paddingLeft="17dp" android:paddingLeft="17dp"
android:paddingStart="17dp"
android:paddingEnd="17dp"
android:background="@drawable/launch_button_states"/> android:background="@drawable/launch_button_states"/>
<FrameLayout <FrameLayout
...@@ -67,8 +63,6 @@ ...@@ -67,8 +63,6 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:textSize="20dp" android:textSize="20dp"
android:paddingLeft="17dp" android:paddingLeft="17dp"
android:paddingStart="17dp"
android:paddingEnd="17dp"
android:background="@drawable/launch_button_states"/> android:background="@drawable/launch_button_states"/>
</LinearLayout> </LinearLayout>
...@@ -89,8 +83,6 @@ ...@@ -89,8 +83,6 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:textSize="20dp" android:textSize="20dp"
android:paddingLeft="17dp" android:paddingLeft="17dp"
android:paddingStart="17dp"
android:paddingEnd="17dp"
android:background="@drawable/launch_button_states"/> android:background="@drawable/launch_button_states"/>
<FrameLayout <FrameLayout
...@@ -106,8 +98,6 @@ ...@@ -106,8 +98,6 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:textSize="20dp" android:textSize="20dp"
android:paddingLeft="17dp" android:paddingLeft="17dp"
android:paddingStart="17dp"
android:paddingEnd="17dp"
android:background="@drawable/launch_button_states"/> android:background="@drawable/launch_button_states"/>
</LinearLayout> </LinearLayout>
......
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
android:textColor="#f0f0f0" android:textColor="#f0f0f0"
android:textSize="15dp" android:textSize="15dp"
android:layout_marginLeft="13dp" android:layout_marginLeft="13dp"
android:layout_marginRight="13dp"
android:id="@+id/original_title"/> android:id="@+id/original_title"/>
<TextView <TextView
...@@ -76,6 +77,7 @@ ...@@ -76,6 +77,7 @@
android:textColor="#bebebe" android:textColor="#bebebe"
android:textSize="15dp" android:textSize="15dp"
android:layout_marginLeft="13dp" android:layout_marginLeft="13dp"
android:layout_marginRight="13dp"
android:id="@+id/original_size"/> android:id="@+id/original_size"/>
<TextView <TextView
...@@ -85,6 +87,7 @@ ...@@ -85,6 +87,7 @@
android:textSize="15dp" android:textSize="15dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginLeft="13dp" android:layout_marginLeft="13dp"
android:layout_marginRight="13dp"
android:id="@+id/edited_title"/> android:id="@+id/edited_title"/>
<TextView <TextView
...@@ -93,12 +96,14 @@ ...@@ -93,12 +96,14 @@
android:textColor="#bebebe" android:textColor="#bebebe"
android:textSize="15dp" android:textSize="15dp"
android:layout_marginLeft="13dp" android:layout_marginLeft="13dp"
android:layout_marginRight="13dp"
android:id="@+id/edited_size"/> android:id="@+id/edited_size"/>
<CheckBox <CheckBox
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="6dp" android:layout_marginTop="6dp"
android:textColor="#f0f0f0" android:textColor="#f0f0f0"
android:textSize="15dp" android:textSize="15dp"
......
...@@ -4,17 +4,14 @@ ...@@ -4,17 +4,14 @@
<resources> <resources>
<string name="AppName">Telegram</string> <string name="AppName">Telegram</string>
<string name="LanguageName">English</string> <string name="LanguageName">English</string>
<string name="LanguageNameInEnglish">English</string> <string name="LanguageNameInEnglish">English</string>
<string name="LanguageCode">en</string> <string name="LanguageCode">en</string>
<!--signin view--> <!--signin view-->
<string name="YourPhone">Your phone</string> <string name="YourPhone">Your phone</string>
<string name="StartText">Please confirm your country code\nand enter your phone number.</string> <string name="StartText">Please confirm your country code\nand enter your phone number.</string>
<string name="ChooseCountry">Choose a country</string> <string name="ChooseCountry">Choose a country</string>
<string name="WrongCountry">Wrong country code</string> <string name="WrongCountry">Wrong country code</string>
<!--code enter view--> <!--code enter view-->
<string name="YourCode">Your code</string> <string name="YourCode">Your code</string>
<string name="SentSmsCode">We\'ve sent an SMS with an activation code to your phone</string> <string name="SentSmsCode">We\'ve sent an SMS with an activation code to your phone</string>
...@@ -23,7 +20,6 @@ ...@@ -23,7 +20,6 @@
<string name="Code">Code</string> <string name="Code">Code</string>
<string name="WrongNumber">Wrong number?</string> <string name="WrongNumber">Wrong number?</string>
<string name="DidNotGetTheCode">Didn\'t get the code?</string> <string name="DidNotGetTheCode">Didn\'t get the code?</string>
<!--signup view--> <!--signup view-->
<string name="YourName">Your name</string> <string name="YourName">Your name</string>
<string name="RegisterText">Set up your first and last name</string> <string name="RegisterText">Set up your first and last name</string>
...@@ -31,7 +27,6 @@ ...@@ -31,7 +27,6 @@
<string name="FirstName">First name (required)</string> <string name="FirstName">First name (required)</string>
<string name="LastName">Last name (optional)</string> <string name="LastName">Last name (optional)</string>
<string name="CancelRegistration">Cancel registration</string> <string name="CancelRegistration">Cancel registration</string>
<!--chats view--> <!--chats view-->
<string name="Chats">Chats</string> <string name="Chats">Chats</string>
<string name="Search">Search</string> <string name="Search">Search</string>
...@@ -56,7 +51,6 @@ ...@@ -56,7 +51,6 @@
<string name="DeleteChat">Delete and exit</string> <string name="DeleteChat">Delete and exit</string>
<string name="HiddenName">Hidden Name</string> <string name="HiddenName">Hidden Name</string>
<string name="SelectChat">Select Chat</string> <string name="SelectChat">Select Chat</string>
<!--broadcasts--> <!--broadcasts-->
<string name="BroadcastList">Broadcast List</string> <string name="BroadcastList">Broadcast List</string>
<string name="NewBroadcastList">New Broadcast List</string> <string name="NewBroadcastList">New Broadcast List</string>
...@@ -64,7 +58,6 @@ ...@@ -64,7 +58,6 @@
<string name="YouCreatedBroadcastList">You created a broadcast list</string> <string name="YouCreatedBroadcastList">You created a broadcast list</string>
<string name="AddRecipient">Add Recipient</string> <string name="AddRecipient">Add Recipient</string>
<string name="KickFromBroadcast">Remove from broadcast list</string> <string name="KickFromBroadcast">Remove from broadcast list</string>
<!--documents view--> <!--documents view-->
<string name="SelectFile">Select File</string> <string name="SelectFile">Select File</string>
<string name="FreeOfTotal">Free %1$s of %2$s</string> <string name="FreeOfTotal">Free %1$s of %2$s</string>
...@@ -78,7 +71,6 @@ ...@@ -78,7 +71,6 @@
<string name="ExternalStorage">External Storage</string> <string name="ExternalStorage">External Storage</string>
<string name="SystemRoot">System Root</string> <string name="SystemRoot">System Root</string>
<string name="SdCard">SD Card</string> <string name="SdCard">SD Card</string>
<!--chat view--> <!--chat view-->
<string name="Invisible">invisible</string> <string name="Invisible">invisible</string>
<string name="Typing">typing...</string> <string name="Typing">typing...</string>
...@@ -119,7 +111,6 @@ ...@@ -119,7 +111,6 @@
<string name="SaveToDownloads">Save to downloads</string> <string name="SaveToDownloads">Save to downloads</string>
<string name="ApplyLocalizationFile">Apply localization file</string> <string name="ApplyLocalizationFile">Apply localization file</string>
<string name="UnsupportedAttachment">Unsupported attachment</string> <string name="UnsupportedAttachment">Unsupported attachment</string>
<!--notification--> <!--notification-->
<string name="EncryptedChatRequested">Secret chat requested</string> <string name="EncryptedChatRequested">Secret chat requested</string>
<string name="EncryptedChatAccepted">Secret chat started</string> <string name="EncryptedChatAccepted">Secret chat started</string>
...@@ -161,7 +152,6 @@ ...@@ -161,7 +152,6 @@
<string name="NotificationUnrecognizedDevice">%1$s,\nWe detected a login into your account from a new device on %2$s\n\nDevice: %3$s\nLocation: %4$s\n\nIf this wasn\'t you, you can go to Settings - Terminate all sessions.\n\nSincerely,\nThe Telegram Team</string> <string name="NotificationUnrecognizedDevice">%1$s,\nWe detected a login into your account from a new device on %2$s\n\nDevice: %3$s\nLocation: %4$s\n\nIf this wasn\'t you, you can go to Settings - Terminate all sessions.\n\nSincerely,\nThe Telegram Team</string>
<string name="NotificationContactNewPhoto">%1$s updated profile photo</string> <string name="NotificationContactNewPhoto">%1$s updated profile photo</string>
<string name="Reply">Reply</string> <string name="Reply">Reply</string>
<!--contacts view--> <!--contacts view-->
<string name="SelectContact">Select Contact</string> <string name="SelectContact">Select Contact</string>
<string name="NoContacts">No contacts yet</string> <string name="NoContacts">No contacts yet</string>
...@@ -174,14 +164,12 @@ ...@@ -174,14 +164,12 @@
<string name="LastSeen">last seen</string> <string name="LastSeen">last seen</string>
<string name="LastSeenDate">last seen</string> <string name="LastSeenDate">last seen</string>
<string name="InviteFriends">Invite Friends</string> <string name="InviteFriends">Invite Friends</string>
<!--group create view--> <!--group create view-->
<string name="SendMessageTo">Send message to...</string> <string name="SendMessageTo">Send message to...</string>
<string name="EnterGroupNamePlaceholder">Enter group name</string> <string name="EnterGroupNamePlaceholder">Enter group name</string>
<string name="GroupName">Group name</string> <string name="GroupName">Group name</string>
<string name="AllContacts">ALL CONTACTS</string> <string name="AllContacts">ALL CONTACTS</string>
<string name="MembersCount">%1$d/%2$d members</string> <string name="MembersCount">%1$d/%2$d members</string>
<!--group info view--> <!--group info view-->
<string name="EnterGroupNameTitle">ENTER GROUP NAME</string> <string name="EnterGroupNameTitle">ENTER GROUP NAME</string>
<string name="SharedMedia">Shared Media</string> <string name="SharedMedia">Shared Media</string>
...@@ -192,7 +180,6 @@ ...@@ -192,7 +180,6 @@
<string name="DeleteAndExit">Delete and leave group</string> <string name="DeleteAndExit">Delete and leave group</string>
<string name="Notifications">Notifications</string> <string name="Notifications">Notifications</string>
<string name="KickFromGroup">Remove from group</string> <string name="KickFromGroup">Remove from group</string>
<!--contact info view--> <!--contact info view-->
<string name="ShareContact">Share</string> <string name="ShareContact">Share</string>
<string name="AddContact">Add</string> <string name="AddContact">Add</string>
...@@ -220,7 +207,6 @@ ...@@ -220,7 +207,6 @@
<string name="ShortMessageLifetime1d">1d</string> <string name="ShortMessageLifetime1d">1d</string>
<string name="ShortMessageLifetime1w">1w</string> <string name="ShortMessageLifetime1w">1w</string>
<string name="EncryptionKeyDescription">This image is a visualization of the encryption key for this secret chat with <![CDATA[<b>]]>%1$s<![CDATA[</b>]]>.<![CDATA[<br><br>]]>If this image looks the same on <![CDATA[<b>]]>%2$s\'s<![CDATA[</b>]]> phone, your chat is 200%% secure.<![CDATA[<br><br>]]>Learn more at telegram.org</string> <string name="EncryptionKeyDescription">This image is a visualization of the encryption key for this secret chat with <![CDATA[<b>]]>%1$s<![CDATA[</b>]]>.<![CDATA[<br><br>]]>If this image looks the same on <![CDATA[<b>]]>%2$s\'s<![CDATA[</b>]]> phone, your chat is 200%% secure.<![CDATA[<br><br>]]>Learn more at telegram.org</string>
<!--settings view--> <!--settings view-->
<string name="ResetNotificationsText">Reset all notification settings to default</string> <string name="ResetNotificationsText">Reset all notification settings to default</string>
<string name="TextSize">Messages Text Size</string> <string name="TextSize">Messages Text Size</string>
...@@ -290,11 +276,10 @@ ...@@ -290,11 +276,10 @@
<string name="WhenConnectedOnWiFi">When connected on Wi-Fi</string> <string name="WhenConnectedOnWiFi">When connected on Wi-Fi</string>
<string name="WhenRoaming">When roaming</string> <string name="WhenRoaming">When roaming</string>
<string name="NoMediaAutoDownload">No media</string> <string name="NoMediaAutoDownload">No media</string>
<string name="SaveToGallerySettings">Save to gallery</string>
<!--media view--> <!--media view-->
<string name="NoMedia">No shared media yet</string> <string name="NoMedia">No shared media yet</string>
<string name="CancelDownload">Cancel Download</string> <string name="CancelDownload">Cancel Download</string>
<!--map view--> <!--map view-->
<string name="MyLocation">My location</string> <string name="MyLocation">My location</string>
<string name="Map">Map</string> <string name="Map">Map</string>
...@@ -304,7 +289,6 @@ ...@@ -304,7 +289,6 @@
<string name="KMetersAway">km away</string> <string name="KMetersAway">km away</string>
<string name="SendLocation">Send Location</string> <string name="SendLocation">Send Location</string>
<string name="ShareLocation">Share Location</string> <string name="ShareLocation">Share Location</string>
<!--photo gallery view--> <!--photo gallery view-->
<string name="ShowAllMedia">Show all media</string> <string name="ShowAllMedia">Show all media</string>
<string name="SaveToGallery">Save to gallery</string> <string name="SaveToGallery">Save to gallery</string>
...@@ -312,14 +296,12 @@ ...@@ -312,14 +296,12 @@
<string name="Gallery">Gallery</string> <string name="Gallery">Gallery</string>
<string name="AllPhotos">All Photos</string> <string name="AllPhotos">All Photos</string>
<string name="NoPhotos">No photos yet</string> <string name="NoPhotos">No photos yet</string>
<!--edit video view--> <!--edit video view-->
<string name="EditVideo">Edit Video</string> <string name="EditVideo">Edit Video</string>
<string name="OriginalVideo">Original Video</string> <string name="OriginalVideo">Original Video</string>
<string name="EditedVideo">Edited Video</string> <string name="EditedVideo">Edited Video</string>
<string name="SendingVideo">Sending video...</string> <string name="SendingVideo">Sending video...</string>
<string name="CompressVideo">Compress Video</string> <string name="CompressVideo">Compress Video</string>
<!--button titles--> <!--button titles-->
<string name="Next">Next</string> <string name="Next">Next</string>
<string name="Back">Back</string> <string name="Back">Back</string>
...@@ -340,7 +322,6 @@ ...@@ -340,7 +322,6 @@
<string name="OpenPhoto">Open photo</string> <string name="OpenPhoto">Open photo</string>
<string name="Set">Set</string> <string name="Set">Set</string>
<string name="OK">OK</string> <string name="OK">OK</string>
<!--messages--> <!--messages-->
<string name="ActionKickUser">un1 removed un2</string> <string name="ActionKickUser">un1 removed un2</string>
<string name="ActionLeftUser">un1 left group</string> <string name="ActionLeftUser">un1 left group</string>
...@@ -368,7 +349,6 @@ ...@@ -368,7 +349,6 @@
<string name="FromYou">You</string> <string name="FromYou">You</string>
<string name="ActionTakeScreenshootYou">You took a screenshot!</string> <string name="ActionTakeScreenshootYou">You took a screenshot!</string>
<string name="ActionTakeScreenshoot">un1 took a screenshot!</string> <string name="ActionTakeScreenshoot">un1 took a screenshot!</string>
<!--Alert messages--> <!--Alert messages-->
<string name="InvalidPhoneNumber">Invalid phone number</string> <string name="InvalidPhoneNumber">Invalid phone number</string>
<string name="CodeExpired">Code expired, please login again</string> <string name="CodeExpired">Code expired, please login again</string>
...@@ -397,7 +377,6 @@ ...@@ -397,7 +377,6 @@
<string name="AreYouSureDeleteContact">Are you sure you want to delete this contact?</string> <string name="AreYouSureDeleteContact">Are you sure you want to delete this contact?</string>
<string name="AreYouSureSecretChat">Are you sure you want to start a secret chat?</string> <string name="AreYouSureSecretChat">Are you sure you want to start a secret chat?</string>
<string name="ForwardFromMyName">forward from my name</string> <string name="ForwardFromMyName">forward from my name</string>
<!--Intro view--> <!--Intro view-->
<string name="Page1Title">Telegram</string> <string name="Page1Title">Telegram</string>
<string name="Page2Title">Fast</string> <string name="Page2Title">Fast</string>
...@@ -406,15 +385,14 @@ ...@@ -406,15 +385,14 @@
<string name="Page5Title">Powerful</string> <string name="Page5Title">Powerful</string>
<string name="Page6Title">Cloud-Based</string> <string name="Page6Title">Cloud-Based</string>
<string name="Page7Title">Private</string> <string name="Page7Title">Private</string>
<string name="Page1Message">The world\'s <![CDATA[<b>fastest</b>]]> messaging app.\nIt is <![CDATA[<b>free</b>]]> and <![CDATA[<b>secure</b>]]>.</string> <string name="Page1Message">The world\'s <![CDATA[<b>fastest</b>]]> messaging app.<![CDATA[<br/>]]>It is <![CDATA[<b>free</b>]]> and <![CDATA[<b>secure</b>]]>.</string>
<string name="Page2Message"><![CDATA[<b>Telegram</b>]]> delivers messages faster than<![CDATA[<br/>]]>any other application</string> <string name="Page2Message"><![CDATA[<b>Telegram</b>]]> delivers messages faster than<![CDATA[<br/>]]>any other application.</string>
<string name="Page3Message"><![CDATA[<b>Telegram</b>]]> is free forever. No ads.<![CDATA[<br/>]]>No subscription fees</string> <string name="Page3Message"><![CDATA[<b>Telegram</b>]]> is free forever. No ads.<![CDATA[<br/>]]>No subscription fees.</string>
<string name="Page4Message"><![CDATA[<b>Telegram</b>]]> keeps your messages safe<![CDATA[<br/>]]>from hacker attacks</string> <string name="Page4Message"><![CDATA[<b>Telegram</b>]]> keeps your messages safe<![CDATA[<br/>]]>from hacker attacks.</string>
<string name="Page5Message"><![CDATA[<b>Telegram</b>]]> has no limits on the size of<![CDATA[<br/>]]>your media and chats</string> <string name="Page5Message"><![CDATA[<b>Telegram</b>]]> has no limits on the size of<![CDATA[<br/>]]>your media and chats.</string>
<string name="Page6Message"><![CDATA[<b>Telegram</b>]]> lets you access your messages<![CDATA[<br/>]]>from multiple devices</string> <string name="Page6Message"><![CDATA[<b>Telegram</b>]]> lets you access your messages<![CDATA[<br/>]]>from multiple devices.</string>
<string name="Page7Message"><![CDATA[<b>Telegram</b>]]> messages are heavily encrypted<![CDATA[<br/>]]>and can self-destruct</string> <string name="Page7Message"><![CDATA[<b>Telegram</b>]]> messages are heavily encrypted<![CDATA[<br/>]]>and can self-destruct.</string>
<string name="StartMessaging">Start Messaging</string> <string name="StartMessaging">Start Messaging</string>
<!--plurals--> <!--plurals-->
<string name="Members_zero">no members</string> <string name="Members_zero">no members</string>
<string name="Members_one">%1$d member</string> <string name="Members_one">%1$d member</string>
...@@ -446,7 +424,6 @@ ...@@ -446,7 +424,6 @@
<string name="FromContacts_few">from %1$d contacts</string> <string name="FromContacts_few">from %1$d contacts</string>
<string name="FromContacts_many">from %1$d contacts</string> <string name="FromContacts_many">from %1$d contacts</string>
<string name="FromContacts_other">from %1$d contacts</string> <string name="FromContacts_other">from %1$d contacts</string>
<!--Don't change this! Not for localization!--> <!--Don't change this! Not for localization!-->
<string name="CacheTag">CACHE_TAG</string> <string name="CacheTag">CACHE_TAG</string>
</resources> </resources>
\ No newline at end of file
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<item name="android:listViewStyle">@style/Theme.TMessages.ListView</item> <item name="android:listViewStyle">@style/Theme.TMessages.ListView</item>
<item name="android:listChoiceBackgroundIndicator">@drawable/list_selector</item> <item name="android:listChoiceBackgroundIndicator">@drawable/list_selector</item>
<item name="android:editTextStyle">@style/Theme.TMessages.EditText</item> <item name="android:editTextStyle">@style/Theme.TMessages.EditText</item>
<item name="android:actionBarItemBackground">@drawable/bar_selector</item> <item name="android:actionBarItemBackground">@drawable/bar_selector_style</item>
</style> </style>
<style name="Theme.TMessages.PopupNotification" parent="Theme.TMessages"> <style name="Theme.TMessages.PopupNotification" parent="Theme.TMessages">
......
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