mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-22 14:35:03 +01:00
update to 9.4.9
This commit is contained in:
parent
8bb3438f62
commit
1ac56c671e
16 changed files with 108 additions and 101 deletions
|
@ -719,6 +719,7 @@ JNIEXPORT jlong JNICALL Java_org_telegram_messenger_voip_NativeInstance_makeNati
|
||||||
},
|
},
|
||||||
.platformContext = platformContext,
|
.platformContext = platformContext,
|
||||||
};
|
};
|
||||||
|
descriptor.version = v;
|
||||||
|
|
||||||
for (int i = 0, size = env->GetArrayLength(endpoints); i < size; i++) {
|
for (int i = 0, size = env->GetArrayLength(endpoints); i < size; i++) {
|
||||||
JavaObject endpointObject(env, env->GetObjectArrayElement(endpoints, i));
|
JavaObject endpointObject(env, env->GetObjectArrayElement(endpoints, i));
|
||||||
|
|
|
@ -1893,9 +1893,6 @@ public class AndroidUtilities {
|
||||||
result = new ArrayList<>();
|
result = new ArrayList<>();
|
||||||
}
|
}
|
||||||
File file = new File(path.substring(0, idx));
|
File file = new File(path.substring(0, idx));
|
||||||
if (!file.canWrite()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
for (int i = 0; i < result.size(); i++) {
|
for (int i = 0; i < result.size(); i++) {
|
||||||
if (result.get(i).getPath().equals(file.getPath())) {
|
if (result.get(i).getPath().equals(file.getPath())) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -1930,7 +1927,7 @@ public class AndroidUtilities {
|
||||||
file = dirs[0];
|
file = dirs[0];
|
||||||
if (!TextUtils.isEmpty(SharedConfig.storageCacheDir)) {
|
if (!TextUtils.isEmpty(SharedConfig.storageCacheDir)) {
|
||||||
for (int a = 0; a < dirs.length; a++) {
|
for (int a = 0; a < dirs.length; a++) {
|
||||||
if (dirs[a] != null && dirs[a].getAbsolutePath().startsWith(SharedConfig.storageCacheDir) && dirs[a].canWrite()) {
|
if (dirs[a] != null && dirs[a].getAbsolutePath().startsWith(SharedConfig.storageCacheDir)) {
|
||||||
file = dirs[a];
|
file = dirs[a];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,8 +24,8 @@ public class BuildVars {
|
||||||
public static boolean USE_CLOUD_STRINGS = true;
|
public static boolean USE_CLOUD_STRINGS = true;
|
||||||
public static boolean CHECK_UPDATES = true;
|
public static boolean CHECK_UPDATES = true;
|
||||||
public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29;
|
public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29;
|
||||||
public static int BUILD_VERSION = 3161;
|
public static int BUILD_VERSION = 3164;
|
||||||
public static String BUILD_VERSION_STRING = "9.4.8";
|
public static String BUILD_VERSION_STRING = "9.4.9";
|
||||||
public static int APP_ID = 4;
|
public static int APP_ID = 4;
|
||||||
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
|
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
|
||||||
|
|
||||||
|
|
|
@ -2216,7 +2216,7 @@ public class ImageLoader {
|
||||||
if (dirs != null) {
|
if (dirs != null) {
|
||||||
for (int a = 0, N = dirs.size(); a < N; a++) {
|
for (int a = 0, N = dirs.size(); a < N; a++) {
|
||||||
File dir = dirs.get(a);
|
File dir = dirs.get(a);
|
||||||
if (dir.getAbsolutePath().startsWith(SharedConfig.storageCacheDir) && dir.canWrite()) {
|
if (dir.getAbsolutePath().startsWith(SharedConfig.storageCacheDir)) {
|
||||||
path = dir;
|
path = dir;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2250,7 +2250,7 @@ public class ImageLoader {
|
||||||
ArrayList<File> dirs = AndroidUtilities.getDataDirs();
|
ArrayList<File> dirs = AndroidUtilities.getDataDirs();
|
||||||
for (int a = 0, N = dirs.size(); a < N; a++) {
|
for (int a = 0, N = dirs.size(); a < N; a++) {
|
||||||
File dir = dirs.get(a);
|
File dir = dirs.get(a);
|
||||||
if (dir != null && !TextUtils.isEmpty(SharedConfig.storageCacheDir) && dir.getAbsolutePath().startsWith(SharedConfig.storageCacheDir) && dir.canWrite()) {
|
if (dir != null && !TextUtils.isEmpty(SharedConfig.storageCacheDir) && dir.getAbsolutePath().startsWith(SharedConfig.storageCacheDir)) {
|
||||||
path = dir;
|
path = dir;
|
||||||
telegramPath = new File(path, "Telegram");
|
telegramPath = new File(path, "Telegram");
|
||||||
telegramPath.mkdirs();
|
telegramPath.mkdirs();
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class LanguageDetector {
|
||||||
if (onFail != null) {
|
if (onFail != null) {
|
||||||
onFail.run(e);
|
onFail.run(e);
|
||||||
}
|
}
|
||||||
FileLog.e(e);
|
FileLog.e(e, false);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (onFail != null) {
|
if (onFail != null) {
|
||||||
|
@ -51,7 +51,7 @@ public class LanguageDetector {
|
||||||
if (onFail != null) {
|
if (onFail != null) {
|
||||||
onFail.run(null);
|
onFail.run(null);
|
||||||
}
|
}
|
||||||
FileLog.e(t);
|
FileLog.e(t, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2001,6 +2001,7 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener,
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean seekToProgress(MessageObject messageObject, float progress) {
|
public boolean seekToProgress(MessageObject messageObject, float progress) {
|
||||||
|
final MessageObject playingMessageObject = this.playingMessageObject;
|
||||||
if (audioPlayer == null && videoPlayer == null || messageObject == null || playingMessageObject == null || !isSamePlayingMessage(messageObject)) {
|
if (audioPlayer == null && videoPlayer == null || messageObject == null || playingMessageObject == null || !isSamePlayingMessage(messageObject)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8385,7 +8385,10 @@ public class MessagesStorage extends BaseController {
|
||||||
|
|
||||||
public void getMessages(long dialogId, long mergeDialogId, boolean loadInfo, int count, int max_id, int offset_date, int minDate, int classGuid, int load_type, boolean scheduled, int replyMessageId, int loadIndex, boolean processMessages, boolean isTopic) {
|
public void getMessages(long dialogId, long mergeDialogId, boolean loadInfo, int count, int max_id, int offset_date, int minDate, int classGuid, int load_type, boolean scheduled, int replyMessageId, int loadIndex, boolean processMessages, boolean isTopic) {
|
||||||
storageQueue.postRunnable(() -> {
|
storageQueue.postRunnable(() -> {
|
||||||
getMessagesInternal(dialogId, mergeDialogId, count, max_id, offset_date, minDate, classGuid, load_type, scheduled, replyMessageId, loadIndex, processMessages, isTopic).run();
|
Runnable processMessagesRunnable = getMessagesInternal(dialogId, mergeDialogId, count, max_id, offset_date, minDate, classGuid, load_type, scheduled, replyMessageId, loadIndex, processMessages, isTopic);
|
||||||
|
Utilities.stageQueue.postRunnable(() -> {
|
||||||
|
processMessagesRunnable.run();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3791,7 +3791,7 @@ public class NotificationsController extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
intent.putExtra("currentAccount", currentAccount);
|
intent.putExtra("currentAccount", currentAccount);
|
||||||
PendingIntent contentIntent = PendingIntent.getActivity(ApplicationLoader.applicationContext, 0, intent, PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_ONE_SHOT);
|
PendingIntent contentIntent = PendingIntent.getActivity(ApplicationLoader.applicationContext, 0, intent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_ONE_SHOT);
|
||||||
|
|
||||||
mBuilder.setContentTitle(name)
|
mBuilder.setContentTitle(name)
|
||||||
.setSmallIcon(R.drawable.notification)
|
.setSmallIcon(R.drawable.notification)
|
||||||
|
@ -3812,10 +3812,14 @@ public class NotificationsController extends BaseController {
|
||||||
mBuilder.addPerson("tel:+" + user.phone);
|
mBuilder.addPerson("tel:+" + user.phone);
|
||||||
}
|
}
|
||||||
|
|
||||||
Intent dismissIntent = new Intent(ApplicationLoader.applicationContext, NotificationDismissReceiver.class);
|
try {
|
||||||
dismissIntent.putExtra("messageDate", lastMessageObject.messageOwner.date);
|
Intent dismissIntent = new Intent(ApplicationLoader.applicationContext, NotificationDismissReceiver.class);
|
||||||
dismissIntent.putExtra("currentAccount", currentAccount);
|
dismissIntent.putExtra("messageDate", lastMessageObject.messageOwner.date);
|
||||||
mBuilder.setDeleteIntent(PendingIntent.getBroadcast(ApplicationLoader.applicationContext, 1, dismissIntent, PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_UPDATE_CURRENT));
|
dismissIntent.putExtra("currentAccount", currentAccount);
|
||||||
|
mBuilder.setDeleteIntent(PendingIntent.getBroadcast(ApplicationLoader.applicationContext, 1, dismissIntent, PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_UPDATE_CURRENT));
|
||||||
|
} catch (Throwable e) {
|
||||||
|
FileLog.e(e);
|
||||||
|
}
|
||||||
|
|
||||||
if (photoPath != null) {
|
if (photoPath != null) {
|
||||||
BitmapDrawable img = ImageLoader.getInstance().getImageFromMemory(photoPath, null, "50_50");
|
BitmapDrawable img = ImageLoader.getInstance().getImageFromMemory(photoPath, null, "50_50");
|
||||||
|
@ -3959,10 +3963,7 @@ public class NotificationsController extends BaseController {
|
||||||
showExtraNotifications(mBuilder, detailText, dialog_id, topicId, chatName, vibrationPattern, ledColor, sound, configImportance, isDefault, isInApp, notifyDisabled, chatType);
|
showExtraNotifications(mBuilder, detailText, dialog_id, topicId, chatName, vibrationPattern, ledColor, sound, configImportance, isDefault, isInApp, notifyDisabled, chatType);
|
||||||
scheduleNotificationRepeat();
|
scheduleNotificationRepeat();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// ignore xiaomi issues
|
FileLog.e(e);
|
||||||
// Remote stack trace
|
|
||||||
// To many PendingIntent's
|
|
||||||
FileLog.e(e, !(e instanceof SecurityException));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4544,7 +4545,7 @@ public class NotificationsController extends BaseController {
|
||||||
intent.putExtra("topicId", topicId);
|
intent.putExtra("topicId", topicId);
|
||||||
}
|
}
|
||||||
intent.putExtra("currentAccount", currentAccount);
|
intent.putExtra("currentAccount", currentAccount);
|
||||||
PendingIntent contentIntent = PendingIntent.getActivity(ApplicationLoader.applicationContext, 0, intent, PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_ONE_SHOT);
|
PendingIntent contentIntent = PendingIntent.getActivity(ApplicationLoader.applicationContext, 0, intent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_ONE_SHOT);
|
||||||
|
|
||||||
NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender();
|
NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender();
|
||||||
if (wearReplyAction != null) {
|
if (wearReplyAction != null) {
|
||||||
|
@ -4601,11 +4602,15 @@ public class NotificationsController extends BaseController {
|
||||||
.setSortKey(String.valueOf(Long.MAX_VALUE - date))
|
.setSortKey(String.valueOf(Long.MAX_VALUE - date))
|
||||||
.setCategory(NotificationCompat.CATEGORY_MESSAGE);
|
.setCategory(NotificationCompat.CATEGORY_MESSAGE);
|
||||||
|
|
||||||
Intent dismissIntent = new Intent(ApplicationLoader.applicationContext, NotificationDismissReceiver.class);
|
try {
|
||||||
dismissIntent.putExtra("messageDate", maxDate);
|
Intent dismissIntent = new Intent(ApplicationLoader.applicationContext, NotificationDismissReceiver.class);
|
||||||
dismissIntent.putExtra("dialogId", dialogId);
|
dismissIntent.putExtra("messageDate", maxDate);
|
||||||
dismissIntent.putExtra("currentAccount", currentAccount);
|
dismissIntent.putExtra("dialogId", dialogId);
|
||||||
builder.setDeleteIntent(PendingIntent.getBroadcast(ApplicationLoader.applicationContext, internalId, dismissIntent, PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_UPDATE_CURRENT));
|
dismissIntent.putExtra("currentAccount", currentAccount);
|
||||||
|
builder.setDeleteIntent(PendingIntent.getBroadcast(ApplicationLoader.applicationContext, internalId, dismissIntent, PendingIntent.FLAG_MUTABLE | PendingIntent.FLAG_UPDATE_CURRENT));
|
||||||
|
} catch (Exception e) {
|
||||||
|
FileLog.e(e);
|
||||||
|
}
|
||||||
|
|
||||||
if (useSummaryNotification) {
|
if (useSummaryNotification) {
|
||||||
builder.setGroup(notificationGroup);
|
builder.setGroup(notificationGroup);
|
||||||
|
|
|
@ -1501,4 +1501,8 @@ public class SharedConfig {
|
||||||
public static boolean deviceIsHigh() {
|
public static boolean deviceIsHigh() {
|
||||||
return getDevicePerformanceClass() >= PERFORMANCE_CLASS_HIGH;
|
return getDevicePerformanceClass() >= PERFORMANCE_CLASS_HIGH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean deviceIsAverage() {
|
||||||
|
return getDevicePerformanceClass() <= PERFORMANCE_CLASS_AVERAGE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ import org.telegram.messenger.AndroidUtilities;
|
||||||
import org.telegram.messenger.BuildVars;
|
import org.telegram.messenger.BuildVars;
|
||||||
import org.telegram.messenger.FileLog;
|
import org.telegram.messenger.FileLog;
|
||||||
import org.telegram.messenger.MediaController;
|
import org.telegram.messenger.MediaController;
|
||||||
|
import org.telegram.messenger.SharedConfig;
|
||||||
import org.telegram.messenger.Utilities;
|
import org.telegram.messenger.Utilities;
|
||||||
import org.telegram.messenger.VideoEditedInfo;
|
import org.telegram.messenger.VideoEditedInfo;
|
||||||
|
|
||||||
|
@ -994,8 +995,12 @@ public class MediaCodecVideoConvertor {
|
||||||
final int dstHeight, boolean external) {
|
final int dstHeight, boolean external) {
|
||||||
|
|
||||||
final float kernelSize = Utilities.clamp((float) (Math.max(srcWidth, srcHeight) / (float) Math.max(dstHeight, dstWidth)) * 0.8f, 2f, 1f);
|
final float kernelSize = Utilities.clamp((float) (Math.max(srcWidth, srcHeight) / (float) Math.max(dstHeight, dstWidth)) * 0.8f, 2f, 1f);
|
||||||
final int kernelRadius = (int) kernelSize;
|
int kernelRadius = (int) kernelSize;
|
||||||
|
if (kernelRadius > 1 && SharedConfig.deviceIsAverage()) {
|
||||||
|
kernelRadius = 1;
|
||||||
|
}
|
||||||
FileLog.d("source size " + srcWidth + "x" + srcHeight + " dest size " + dstWidth + dstHeight + " kernelRadius " + kernelRadius);
|
FileLog.d("source size " + srcWidth + "x" + srcHeight + " dest size " + dstWidth + dstHeight + " kernelRadius " + kernelRadius);
|
||||||
|
|
||||||
if (external) {
|
if (external) {
|
||||||
return "#extension GL_OES_EGL_image_external : require\n" +
|
return "#extension GL_OES_EGL_image_external : require\n" +
|
||||||
"precision mediump float;\n" +
|
"precision mediump float;\n" +
|
||||||
|
|
|
@ -7046,7 +7046,7 @@ public class Theme {
|
||||||
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
|
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
|
||||||
SharedPreferences.Editor editor = preferences.edit();
|
SharedPreferences.Editor editor = preferences.edit();
|
||||||
editor.putString("theme", themeInfo.getKey());
|
editor.putString("theme", themeInfo.getKey());
|
||||||
editor.apply();
|
editor.commit();
|
||||||
}
|
}
|
||||||
String[] wallpaperLink = new String[1];
|
String[] wallpaperLink = new String[1];
|
||||||
if (themeInfo.assetName != null) {
|
if (themeInfo.assetName != null) {
|
||||||
|
@ -7131,7 +7131,7 @@ public class Theme {
|
||||||
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
|
SharedPreferences preferences = MessagesController.getGlobalMainSettings();
|
||||||
SharedPreferences.Editor editor = preferences.edit();
|
SharedPreferences.Editor editor = preferences.edit();
|
||||||
editor.remove("theme");
|
editor.remove("theme");
|
||||||
editor.apply();
|
editor.commit();
|
||||||
}
|
}
|
||||||
currentColorsNoAccent.clear();
|
currentColorsNoAccent.clear();
|
||||||
themedWallpaperFileOffset = 0;
|
themedWallpaperFileOffset = 0;
|
||||||
|
|
|
@ -365,7 +365,7 @@ public class CacheControlActivity extends BaseFragment implements NotificationCe
|
||||||
if (!TextUtils.isEmpty(SharedConfig.storageCacheDir)) {
|
if (!TextUtils.isEmpty(SharedConfig.storageCacheDir)) {
|
||||||
for (int a = 0, N = storageDirs.size(); a < N; a++) {
|
for (int a = 0, N = storageDirs.size(); a < N; a++) {
|
||||||
File file = storageDirs.get(a);
|
File file = storageDirs.get(a);
|
||||||
if (file.getAbsolutePath().startsWith(SharedConfig.storageCacheDir) && file.canWrite()) {
|
if (file.getAbsolutePath().startsWith(SharedConfig.storageCacheDir)) {
|
||||||
path = file;
|
path = file;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,24 +24,19 @@ import androidx.annotation.Nullable;
|
||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.DefaultLoadControl;
|
import com.google.android.exoplayer2.DefaultLoadControl;
|
||||||
import com.google.android.exoplayer2.DefaultRenderersFactory;
|
import com.google.android.exoplayer2.DefaultRenderersFactory;
|
||||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
|
||||||
import com.google.android.exoplayer2.ExoPlayer;
|
import com.google.android.exoplayer2.ExoPlayer;
|
||||||
import com.google.android.exoplayer2.MediaItem;
|
import com.google.android.exoplayer2.MediaItem;
|
||||||
import com.google.android.exoplayer2.PlaybackException;
|
import com.google.android.exoplayer2.PlaybackException;
|
||||||
import com.google.android.exoplayer2.PlaybackParameters;
|
import com.google.android.exoplayer2.PlaybackParameters;
|
||||||
import com.google.android.exoplayer2.Player;
|
import com.google.android.exoplayer2.Player;
|
||||||
import com.google.android.exoplayer2.Renderer;
|
|
||||||
import com.google.android.exoplayer2.SimpleExoPlayer;
|
|
||||||
import com.google.android.exoplayer2.analytics.AnalyticsListener;
|
import com.google.android.exoplayer2.analytics.AnalyticsListener;
|
||||||
import com.google.android.exoplayer2.audio.AudioAttributes;
|
import com.google.android.exoplayer2.audio.AudioAttributes;
|
||||||
import com.google.android.exoplayer2.audio.AudioCapabilities;
|
import com.google.android.exoplayer2.audio.AudioCapabilities;
|
||||||
import com.google.android.exoplayer2.audio.AudioProcessor;
|
import com.google.android.exoplayer2.audio.AudioProcessor;
|
||||||
import com.google.android.exoplayer2.audio.AudioRendererEventListener;
|
|
||||||
import com.google.android.exoplayer2.audio.AudioSink;
|
import com.google.android.exoplayer2.audio.AudioSink;
|
||||||
import com.google.android.exoplayer2.audio.DefaultAudioSink;
|
import com.google.android.exoplayer2.audio.DefaultAudioSink;
|
||||||
import com.google.android.exoplayer2.audio.TeeAudioProcessor;
|
import com.google.android.exoplayer2.audio.TeeAudioProcessor;
|
||||||
import com.google.android.exoplayer2.mediacodec.MediaCodecRenderer;
|
import com.google.android.exoplayer2.mediacodec.MediaCodecRenderer;
|
||||||
import com.google.android.exoplayer2.mediacodec.MediaCodecSelector;
|
|
||||||
import com.google.android.exoplayer2.source.LoopingMediaSource;
|
import com.google.android.exoplayer2.source.LoopingMediaSource;
|
||||||
import com.google.android.exoplayer2.source.MediaSource;
|
import com.google.android.exoplayer2.source.MediaSource;
|
||||||
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
|
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
|
||||||
|
@ -52,7 +47,6 @@ import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
||||||
import com.google.android.exoplayer2.trackselection.MappingTrackSelector;
|
import com.google.android.exoplayer2.trackselection.MappingTrackSelector;
|
||||||
import com.google.android.exoplayer2.upstream.DataSource;
|
import com.google.android.exoplayer2.upstream.DataSource;
|
||||||
import com.google.android.exoplayer2.upstream.DefaultAllocator;
|
import com.google.android.exoplayer2.upstream.DefaultAllocator;
|
||||||
import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter;
|
|
||||||
import com.google.android.exoplayer2.video.SurfaceNotValidException;
|
import com.google.android.exoplayer2.video.SurfaceNotValidException;
|
||||||
import com.google.android.exoplayer2.video.VideoListener;
|
import com.google.android.exoplayer2.video.VideoListener;
|
||||||
import com.google.android.exoplayer2.video.VideoSize;
|
import com.google.android.exoplayer2.video.VideoSize;
|
||||||
|
@ -64,7 +58,6 @@ import org.telegram.messenger.NotificationCenter;
|
||||||
import org.telegram.messenger.secretmedia.ExtendedDefaultDataSourceFactory;
|
import org.telegram.messenger.secretmedia.ExtendedDefaultDataSourceFactory;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
public class VideoPlayer implements Player.Listener, VideoListener, AnalyticsListener, NotificationCenter.NotificationCenterDelegate {
|
public class VideoPlayer implements Player.Listener, VideoListener, AnalyticsListener, NotificationCenter.NotificationCenterDelegate {
|
||||||
|
@ -499,7 +492,7 @@ public class VideoPlayer implements Player.Listener, VideoListener, AnalyticsLis
|
||||||
return player != null && lastReportedPlaybackState == ExoPlayer.STATE_BUFFERING;
|
return player != null && lastReportedPlaybackState == ExoPlayer.STATE_BUFFERING;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStreamType(int type) {
|
public void setStreamType(int type) {
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
player.setAudioAttributes(new AudioAttributes.Builder()
|
player.setAudioAttributes(new AudioAttributes.Builder()
|
||||||
.setUsage(type == AudioManager.STREAM_VOICE_CALL ? C.USAGE_VOICE_COMMUNICATION : C.USAGE_MEDIA)
|
.setUsage(type == AudioManager.STREAM_VOICE_CALL ? C.USAGE_VOICE_COMMUNICATION : C.USAGE_MEDIA)
|
||||||
|
|
|
@ -206,66 +206,64 @@ public class DefaultThemesPreviewCell extends LinearLayout {
|
||||||
pos[0] += dayNightCell.getImageView().getMeasuredWidth() / 2;
|
pos[0] += dayNightCell.getImageView().getMeasuredWidth() / 2;
|
||||||
pos[1] += dayNightCell.getImageView().getMeasuredHeight() / 2 + AndroidUtilities.dp(3);
|
pos[1] += dayNightCell.getImageView().getMeasuredHeight() / 2 + AndroidUtilities.dp(3);
|
||||||
|
|
||||||
Runnable then = () -> AndroidUtilities.runOnUIThread(() -> {
|
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.needSetDayNightTheme, themeInfo, false, pos, -1, toDark, dayNightCell.getImageView(), dayNightCell);
|
||||||
updateDayNightMode();
|
updateDayNightMode();
|
||||||
updateSelectedPosition();
|
updateSelectedPosition();
|
||||||
|
|
||||||
int iconNewColor = Theme.getColor(Theme.key_windowBackgroundWhiteBlueText4);
|
int iconNewColor = Theme.getColor(Theme.key_windowBackgroundWhiteBlueText4);
|
||||||
darkThemeDrawable.setColorFilter(new PorterDuffColorFilter(iconNewColor, PorterDuff.Mode.SRC_IN));
|
darkThemeDrawable.setColorFilter(new PorterDuffColorFilter(iconNewColor, PorterDuff.Mode.SRC_IN));
|
||||||
ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, 1f);
|
ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, 1f);
|
||||||
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationUpdate(ValueAnimator valueAnimator) {
|
public void onAnimationUpdate(ValueAnimator valueAnimator) {
|
||||||
int iconColor = ColorUtils.blendARGB(iconOldColor, iconNewColor, (float) valueAnimator.getAnimatedValue());
|
int iconColor = ColorUtils.blendARGB(iconOldColor, iconNewColor, (float) valueAnimator.getAnimatedValue());
|
||||||
darkThemeDrawable.setColorFilter(new PorterDuffColorFilter(iconColor, PorterDuff.Mode.SRC_IN));
|
darkThemeDrawable.setColorFilter(new PorterDuffColorFilter(iconColor, PorterDuff.Mode.SRC_IN));
|
||||||
}
|
|
||||||
});
|
|
||||||
valueAnimator.addListener(new AnimatorListenerAdapter() {
|
|
||||||
@Override
|
|
||||||
public void onAnimationEnd(Animator animation) {
|
|
||||||
darkThemeDrawable.setColorFilter(new PorterDuffColorFilter(iconNewColor, PorterDuff.Mode.SRC_IN));
|
|
||||||
super.onAnimationEnd(animation);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
valueAnimator.setDuration(350);
|
|
||||||
valueAnimator.start();
|
|
||||||
|
|
||||||
int navBarNewColor = Theme.getColor(Theme.key_windowBackgroundGray);
|
|
||||||
final Window window = context instanceof Activity ? ((Activity) context).getWindow() : null;
|
|
||||||
if (window != null) {
|
|
||||||
if (navBarAnimator != null && navBarAnimator.isRunning()) {
|
|
||||||
navBarAnimator.cancel();
|
|
||||||
}
|
|
||||||
final int navBarFromColor = navBarAnimator != null && navBarAnimator.isRunning() ? navBarColor : navBarOldColor;
|
|
||||||
navBarAnimator = ValueAnimator.ofFloat(0, 1);
|
|
||||||
final float startDelay = toDark ? 50 : 200, duration = 150, fullDuration = 350;
|
|
||||||
navBarAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
|
||||||
@Override
|
|
||||||
public void onAnimationUpdate(ValueAnimator valueAnimator) {
|
|
||||||
float t = Math.max(0, Math.min(1, ((float) valueAnimator.getAnimatedValue() * fullDuration - startDelay) / duration));
|
|
||||||
navBarColor = ColorUtils.blendARGB(navBarFromColor, navBarNewColor, t);
|
|
||||||
AndroidUtilities.setNavigationBarColor(window, navBarColor, false);
|
|
||||||
AndroidUtilities.setLightNavigationBar(window, AndroidUtilities.computePerceivedBrightness(navBarColor) >= 0.721f);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
navBarAnimator.addListener(new AnimatorListenerAdapter() {
|
|
||||||
@Override
|
|
||||||
public void onAnimationEnd(Animator animation) {
|
|
||||||
AndroidUtilities.setNavigationBarColor(window, navBarNewColor, false);
|
|
||||||
AndroidUtilities.setLightNavigationBar(window, AndroidUtilities.computePerceivedBrightness(navBarNewColor) >= 0.721f);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
navBarAnimator.setDuration((long) fullDuration);
|
|
||||||
navBarAnimator.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Theme.isCurrentThemeDay()) {
|
|
||||||
dayNightCell.setTextAndIcon(LocaleController.getString("SettingsSwitchToNightMode", R.string.SettingsSwitchToNightMode), darkThemeDrawable, true);
|
|
||||||
} else {
|
|
||||||
dayNightCell.setTextAndIcon(LocaleController.getString("SettingsSwitchToDayMode", R.string.SettingsSwitchToDayMode), darkThemeDrawable, true);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.needSetDayNightTheme, themeInfo, false, pos, -1, toDark, dayNightCell.getImageView(), dayNightCell, then);
|
valueAnimator.addListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
darkThemeDrawable.setColorFilter(new PorterDuffColorFilter(iconNewColor, PorterDuff.Mode.SRC_IN));
|
||||||
|
super.onAnimationEnd(animation);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
valueAnimator.setDuration(350);
|
||||||
|
valueAnimator.start();
|
||||||
|
|
||||||
|
int navBarNewColor = Theme.getColor(Theme.key_windowBackgroundGray);
|
||||||
|
final Window window = context instanceof Activity ? ((Activity) context).getWindow() : null;
|
||||||
|
if (window != null) {
|
||||||
|
if (navBarAnimator != null && navBarAnimator.isRunning()) {
|
||||||
|
navBarAnimator.cancel();
|
||||||
|
}
|
||||||
|
final int navBarFromColor = navBarAnimator != null && navBarAnimator.isRunning() ? navBarColor : navBarOldColor;
|
||||||
|
navBarAnimator = ValueAnimator.ofFloat(0, 1);
|
||||||
|
final float startDelay = toDark ? 50 : 200, duration = 150, fullDuration = 350;
|
||||||
|
navBarAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationUpdate(ValueAnimator valueAnimator) {
|
||||||
|
float t = Math.max(0, Math.min(1, ((float) valueAnimator.getAnimatedValue() * fullDuration - startDelay) / duration));
|
||||||
|
navBarColor = ColorUtils.blendARGB(navBarFromColor, navBarNewColor, t);
|
||||||
|
AndroidUtilities.setNavigationBarColor(window, navBarColor, false);
|
||||||
|
AndroidUtilities.setLightNavigationBar(window, AndroidUtilities.computePerceivedBrightness(navBarColor) >= 0.721f);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
navBarAnimator.addListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
AndroidUtilities.setNavigationBarColor(window, navBarNewColor, false);
|
||||||
|
AndroidUtilities.setLightNavigationBar(window, AndroidUtilities.computePerceivedBrightness(navBarNewColor) >= 0.721f);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
navBarAnimator.setDuration((long) fullDuration);
|
||||||
|
navBarAnimator.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Theme.isCurrentThemeDay()) {
|
||||||
|
dayNightCell.setTextAndIcon(LocaleController.getString("SettingsSwitchToNightMode", R.string.SettingsSwitchToNightMode), darkThemeDrawable, true);
|
||||||
|
} else {
|
||||||
|
dayNightCell.setTextAndIcon(LocaleController.getString("SettingsSwitchToDayMode", R.string.SettingsSwitchToDayMode), darkThemeDrawable, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -980,7 +980,7 @@ public class LNavigation extends FrameLayout implements INavigationLayout, Float
|
||||||
rebuildFragments(REBUILD_FLAG_REBUILD_LAST);
|
rebuildFragments(REBUILD_FLAG_REBUILD_LAST);
|
||||||
}
|
}
|
||||||
fragment.setParentLayout(this);
|
fragment.setParentLayout(this);
|
||||||
if (position == -1 || position >= fragmentStack.size()) {
|
if (position < 0 || position >= fragmentStack.size()) {
|
||||||
BaseFragment lastFragment = getLastFragment();
|
BaseFragment lastFragment = getLastFragment();
|
||||||
if (lastFragment != null) {
|
if (lastFragment != null) {
|
||||||
lastFragment.setPaused(true);
|
lastFragment.setPaused(true);
|
||||||
|
|
|
@ -13,12 +13,12 @@
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
# org.gradle.parallel=true
|
# org.gradle.parallel=true
|
||||||
#Sat Mar 12 05:53:50 MSK 2016
|
#Sat Mar 12 05:53:50 MSK 2016
|
||||||
APP_VERSION_NAME=9.4.8
|
APP_VERSION_NAME=9.4.9
|
||||||
APP_VERSION_CODE=3161
|
APP_VERSION_CODE=3164
|
||||||
APP_PACKAGE=org.telegram.messenger
|
APP_PACKAGE=org.telegram.messenger
|
||||||
RELEASE_KEY_PASSWORD=android
|
RELEASE_KEY_PASSWORD=TelegramAndroidPswd
|
||||||
RELEASE_KEY_ALIAS=androidkey
|
RELEASE_KEY_ALIAS=tmessages
|
||||||
RELEASE_STORE_PASSWORD=android
|
RELEASE_STORE_PASSWORD=TelegramAndroidPswd
|
||||||
org.gradle.jvmargs=-Xmx4096M -XX:MaxPermSize=4096m
|
org.gradle.jvmargs=-Xmx4096M -XX:MaxPermSize=4096m
|
||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
|
|
Loading…
Reference in a new issue