mirror of
https://github.com/NekoX-Dev/NekoX.git
synced 2025-01-19 10:10:01 +01:00
Merge upstream 7.4.2
This commit is contained in:
commit
db70486fae
@ -1,8 +1,8 @@
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
|
||||
def verName = "7.4.1-preview02"
|
||||
def verCode = 169
|
||||
def verName = "7.4.2-preview-2226"
|
||||
def verCode = 170
|
||||
|
||||
def serviceAccountCredentialsFile = rootProject.file("service_account_credentials.json")
|
||||
|
||||
|
@ -65,10 +65,6 @@ import android.text.TextUtils;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.text.style.URLSpan;
|
||||
import android.text.util.Linkify;
|
||||
import android.transition.ChangeBounds;
|
||||
import android.transition.TransitionSet;
|
||||
import android.transition.TransitionValues;
|
||||
import android.transition.Visibility;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.StateSet;
|
||||
import android.util.TypedValue;
|
||||
@ -110,14 +106,12 @@ import org.telegram.tgnet.RequestTimeDelegate;
|
||||
import org.telegram.tgnet.TLObject;
|
||||
import org.telegram.tgnet.TLRPC;
|
||||
import org.telegram.ui.ActionBar.ActionBarLayout;
|
||||
import org.telegram.ui.ActionBar.ActionBarMenuItem;
|
||||
import org.telegram.ui.ActionBar.AlertDialog;
|
||||
import org.telegram.ui.ActionBar.BaseFragment;
|
||||
import org.telegram.ui.ActionBar.BottomSheet;
|
||||
import org.telegram.ui.ActionBar.Theme;
|
||||
import org.telegram.ui.Cells.TextDetailSettingsCell;
|
||||
import org.telegram.ui.Components.BackgroundGradientDrawable;
|
||||
import org.telegram.ui.Components.CubicBezierInterpolator;
|
||||
import org.telegram.ui.Components.ForegroundColorSpanThemable;
|
||||
import org.telegram.ui.Components.ForegroundDetector;
|
||||
import org.telegram.ui.Components.LayoutHelper;
|
||||
|
@ -436,10 +436,16 @@ public class ChatObject {
|
||||
invitedUsers.remove(id);
|
||||
}
|
||||
if (oldParticipant != null) {
|
||||
oldParticipant.flags = participant.flags;
|
||||
oldParticipant.muted = participant.muted;
|
||||
oldParticipant.muted_by_you = participant.muted_by_you;
|
||||
oldParticipant.volume = participant.volume;
|
||||
if (!participant.min) {
|
||||
oldParticipant.volume = participant.volume;
|
||||
} else {
|
||||
if ((participant.flags & 128) != 0 && (oldParticipant.flags & 128) == 0) {
|
||||
participant.flags &=~ 128;
|
||||
}
|
||||
}
|
||||
oldParticipant.flags = participant.flags;
|
||||
oldParticipant.can_self_unmute = participant.can_self_unmute;
|
||||
oldParticipant.date = participant.date;
|
||||
oldParticipant.lastTypingDate = Math.max(oldParticipant.active_date, participant.active_date);
|
||||
|
@ -3056,7 +3056,7 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener,
|
||||
} else {
|
||||
cleanupPlayer(true, true, messageObject != null && messageObject.isVoice(), false);
|
||||
}
|
||||
} else if (seekToProgressPending != 0 && (playbackState == ExoPlayer.STATE_READY || playbackState == ExoPlayer.STATE_IDLE)) {
|
||||
} else if (audioPlayer != null && seekToProgressPending != 0 && (playbackState == ExoPlayer.STATE_READY || playbackState == ExoPlayer.STATE_IDLE)) {
|
||||
int seekTo = (int) (audioPlayer.getDuration() * seekToProgressPending);
|
||||
audioPlayer.seekTo(seekTo);
|
||||
lastProgress = seekTo;
|
||||
|
@ -1428,6 +1428,9 @@ public class MediaDataController extends BaseController {
|
||||
req.stickerset = inputStickerSetShortName;
|
||||
}
|
||||
getConnectionsManager().sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
|
||||
if (BuildConfig.DEBUG && error != null) { //supress test backend warning
|
||||
return;
|
||||
}
|
||||
if (response instanceof TLRPC.TL_messages_stickerSet) {
|
||||
processLoadedDiceStickers(name, isEmoji, (TLRPC.TL_messages_stickerSet) response, false, (int) (System.currentTimeMillis() / 1000));
|
||||
} else {
|
||||
|
@ -12634,7 +12634,8 @@ public class MessagesController extends BaseController implements NotificationCe
|
||||
}
|
||||
if ((update.notify_settings.flags & 4) != 0) {
|
||||
editor.putInt("EnableGroup2", update.notify_settings.mute_until);
|
||||
getNotificationsController().deleteNotificationChannelGlobal(NotificationsController.TYPE_GROUP);
|
||||
editor.putBoolean("overwrite_group", true);
|
||||
AndroidUtilities.runOnUIThread(() -> getNotificationsController().deleteNotificationChannelGlobal(NotificationsController.TYPE_GROUP));
|
||||
}
|
||||
} else if (update.peer instanceof TLRPC.TL_notifyUsers) {
|
||||
if ((update.notify_settings.flags & 1) != 0) {
|
||||
@ -12649,7 +12650,8 @@ public class MessagesController extends BaseController implements NotificationCe
|
||||
}
|
||||
if ((update.notify_settings.flags & 4) != 0) {
|
||||
editor.putInt("EnableAll2", update.notify_settings.mute_until);
|
||||
getNotificationsController().deleteNotificationChannelGlobal(NotificationsController.TYPE_PRIVATE);
|
||||
editor.putBoolean("overwrite_private", true);
|
||||
AndroidUtilities.runOnUIThread(() -> getNotificationsController().deleteNotificationChannelGlobal(NotificationsController.TYPE_PRIVATE));
|
||||
}
|
||||
} else if (update.peer instanceof TLRPC.TL_notifyBroadcasts) {
|
||||
if ((update.notify_settings.flags & 1) != 0) {
|
||||
@ -12664,7 +12666,8 @@ public class MessagesController extends BaseController implements NotificationCe
|
||||
}
|
||||
if ((update.notify_settings.flags & 4) != 0) {
|
||||
editor.putInt("EnableChannel2", update.notify_settings.mute_until);
|
||||
getNotificationsController().deleteNotificationChannelGlobal(NotificationsController.TYPE_CHANNEL);
|
||||
editor.putBoolean("overwrite_channel", true);
|
||||
AndroidUtilities.runOnUIThread(() -> getNotificationsController().deleteNotificationChannelGlobal(NotificationsController.TYPE_CHANNEL));
|
||||
}
|
||||
}
|
||||
getMessagesStorage().updateMutedDialogsFiltersCounters();
|
||||
|
@ -288,7 +288,14 @@ public class NotificationsController extends BaseController {
|
||||
NotificationChannel channel = list.get(a);
|
||||
String id = channel.getId();
|
||||
if (id.startsWith(keyStart)) {
|
||||
systemNotificationManager.deleteNotificationChannel(id);
|
||||
try {
|
||||
systemNotificationManager.deleteNotificationChannel(id);
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
if (BuildVars.LOGS_ENABLED) {
|
||||
FileLog.d("delete channel cleanup " + id);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
@ -2581,7 +2588,14 @@ public class NotificationsController extends BaseController {
|
||||
String channelId = preferences.getString(key, null);
|
||||
if (channelId != null) {
|
||||
editor.remove(key).remove(key + "_s");
|
||||
systemNotificationManager.deleteNotificationChannel(channelId);
|
||||
try {
|
||||
systemNotificationManager.deleteNotificationChannel(channelId);
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
if (BuildVars.LOGS_ENABLED) {
|
||||
FileLog.d("delete channel internal " + channelId);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (what == 1 || what == -1) {
|
||||
@ -2589,7 +2603,14 @@ public class NotificationsController extends BaseController {
|
||||
String channelId = preferences.getString(key, null);
|
||||
if (channelId != null) {
|
||||
editor.remove(key).remove(key + "_s");
|
||||
systemNotificationManager.deleteNotificationChannel(channelId);
|
||||
try {
|
||||
systemNotificationManager.deleteNotificationChannel(channelId);
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
if (BuildVars.LOGS_ENABLED) {
|
||||
FileLog.d("delete channel internal " + channelId);
|
||||
}
|
||||
}
|
||||
}
|
||||
editor.commit();
|
||||
@ -2628,7 +2649,14 @@ public class NotificationsController extends BaseController {
|
||||
String channelId = preferences.getString(key, null);
|
||||
if (channelId != null) {
|
||||
editor.remove(key).remove(key + "_s");
|
||||
systemNotificationManager.deleteNotificationChannel(channelId);
|
||||
try {
|
||||
systemNotificationManager.deleteNotificationChannel(channelId);
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
if (BuildVars.LOGS_ENABLED) {
|
||||
FileLog.d("delete channel global internal " + channelId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2644,9 +2672,25 @@ public class NotificationsController extends BaseController {
|
||||
String channelId = preferences.getString(key, null);
|
||||
if (channelId != null) {
|
||||
editor.remove(key).remove(key + "_s");
|
||||
systemNotificationManager.deleteNotificationChannel(channelId);
|
||||
try {
|
||||
systemNotificationManager.deleteNotificationChannel(channelId);
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
if (BuildVars.LOGS_ENABLED) {
|
||||
FileLog.d("delete channel global internal " + channelId);
|
||||
}
|
||||
}
|
||||
}
|
||||
String overwriteKey;
|
||||
if (type == TYPE_CHANNEL) {
|
||||
overwriteKey = "overwrite_channel";
|
||||
} else if (type == TYPE_GROUP) {
|
||||
overwriteKey = "overwrite_group";
|
||||
} else {
|
||||
overwriteKey = "overwrite_private";
|
||||
}
|
||||
editor.remove(overwriteKey);
|
||||
editor.commit();
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
@ -2673,7 +2717,11 @@ public class NotificationsController extends BaseController {
|
||||
String key = entry.getKey();
|
||||
if (key.startsWith("org.telegram.key")) {
|
||||
if (!key.endsWith("_s")) {
|
||||
systemNotificationManager.deleteNotificationChannel((String) entry.getValue());
|
||||
String id = (String) entry.getValue();
|
||||
systemNotificationManager.deleteNotificationChannel(id);
|
||||
if (BuildVars.LOGS_ENABLED) {
|
||||
FileLog.d("delete all channel " + id);
|
||||
}
|
||||
}
|
||||
editor.remove(key);
|
||||
}
|
||||
@ -2830,19 +2878,25 @@ public class NotificationsController extends BaseController {
|
||||
|
||||
String key;
|
||||
String groupId;
|
||||
String overwriteKey;
|
||||
if (isSilent) {
|
||||
groupId = "other" + currentAccount;
|
||||
overwriteKey = null;
|
||||
} else {
|
||||
if (type == TYPE_CHANNEL) {
|
||||
groupId = "channels" + currentAccount;
|
||||
overwriteKey = "overwrite_channel";
|
||||
} else if (type == TYPE_GROUP) {
|
||||
groupId = "groups" + currentAccount;
|
||||
overwriteKey = "overwrite_group";
|
||||
} else {
|
||||
groupId = "private" + currentAccount;
|
||||
overwriteKey = "overwrite_private";
|
||||
}
|
||||
}
|
||||
|
||||
boolean secretChat = !isDefault && (int) dialogId == 0;
|
||||
boolean shouldOverwrite = !isInApp && overwriteKey != null && preferences.getBoolean(overwriteKey, false);
|
||||
|
||||
if (isSilent) {
|
||||
name = LocaleController.getString("NotificationsSilent", R.string.NotificationsSilent);
|
||||
@ -2870,8 +2924,11 @@ public class NotificationsController extends BaseController {
|
||||
|
||||
if (channelId != null) {
|
||||
NotificationChannel existingChannel = systemNotificationManager.getNotificationChannel(channelId);
|
||||
if (BuildVars.LOGS_ENABLED) {
|
||||
FileLog.d("current channel for " + channelId + " = " + existingChannel);
|
||||
}
|
||||
if (existingChannel != null) {
|
||||
if (!isSilent) {
|
||||
if (!isSilent && !shouldOverwrite) {
|
||||
int channelImportance = existingChannel.getImportance();
|
||||
Uri channelSound = existingChannel.getSound();
|
||||
long[] channelVibrationPattern = existingChannel.getVibrationPattern();
|
||||
@ -2893,6 +2950,9 @@ public class NotificationsController extends BaseController {
|
||||
if (!isDefault && secretChat) {
|
||||
newSettings.append("secret");
|
||||
}
|
||||
if (BuildVars.LOGS_ENABLED) {
|
||||
FileLog.d("current channel settings for " + channelId + " = " + newSettings + " old = " + settings);
|
||||
}
|
||||
newSettingsHash = Utilities.MD5(newSettings.toString());
|
||||
newSettings.setLength(0);
|
||||
if (!newSettingsHash.equals(settings)) {
|
||||
@ -3053,7 +3113,10 @@ public class NotificationsController extends BaseController {
|
||||
|
||||
if (edited && newSettingsHash != null) {
|
||||
preferences.edit().putString(key, channelId).putString(key + "_s", newSettingsHash).commit();
|
||||
} else if (newSettingsHash == null || !isInApp || !isDefault) {
|
||||
if (BuildVars.LOGS_ENABLED) {
|
||||
FileLog.d("change edited channel " + channelId);
|
||||
}
|
||||
} else if (shouldOverwrite || newSettingsHash == null || !isInApp || !isDefault) {
|
||||
for (int a = 0; a < vibrationPattern.length; a++) {
|
||||
newSettings.append(vibrationPattern[a]);
|
||||
}
|
||||
@ -3067,8 +3130,15 @@ public class NotificationsController extends BaseController {
|
||||
}
|
||||
newSettingsHash = Utilities.MD5(newSettings.toString());
|
||||
|
||||
if (!isSilent && channelId != null && !settings.equals(newSettingsHash)) {
|
||||
systemNotificationManager.deleteNotificationChannel(channelId);
|
||||
if (!isSilent && channelId != null && (shouldOverwrite || !settings.equals(newSettingsHash))) {
|
||||
try {
|
||||
systemNotificationManager.deleteNotificationChannel(channelId);
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
if (BuildVars.LOGS_ENABLED) {
|
||||
FileLog.d("delete channel by settings change " + channelId);
|
||||
}
|
||||
channelId = null;
|
||||
}
|
||||
}
|
||||
@ -3108,6 +3178,10 @@ public class NotificationsController extends BaseController {
|
||||
notificationChannel.setGroup(keyGroup);
|
||||
systemNotificationManager.createNotificationChannelGroup(notificationChannelGroup);
|
||||
systemNotificationManager.createNotificationChannel(notificationChannel);
|
||||
if (BuildVars.LOGS_ENABLED) {
|
||||
FileLog.d("create new channel group " + keyGroup);
|
||||
FileLog.d("create new channel " + channelId);
|
||||
}
|
||||
preferences.edit().putString(key, channelId).putString(key + "_s", newSettingsHash).commit();
|
||||
}
|
||||
return channelId;
|
||||
|
@ -97,7 +97,6 @@ public class SendMessagesHelper extends BaseController implements NotificationCe
|
||||
public class ImportingHistory {
|
||||
public String historyPath;
|
||||
public ArrayList<Uri> mediaPaths = new ArrayList<>();
|
||||
public HashMap<String, TLRPC.InputFile> uploadedMedias = new HashMap<>();
|
||||
public HashSet<String> uploadSet = new HashSet<>();
|
||||
public HashMap<String, Float> uploadProgresses = new HashMap<>();
|
||||
public HashMap<String, Long> uploadSize = new HashMap<>();
|
||||
@ -149,6 +148,18 @@ public class SendMessagesHelper extends BaseController implements NotificationCe
|
||||
public long getTotalCount() {
|
||||
return totalSize;
|
||||
}
|
||||
|
||||
private void onFileFailedToUpload(String path) {
|
||||
if (path.equals(historyPath)) {
|
||||
importingHistoryMap.remove(dialogId);
|
||||
TLRPC.TL_error error = new TLRPC.TL_error();
|
||||
error.code = 400;
|
||||
error.text = "IMPORT_UPLOAD_FAILED";
|
||||
getNotificationCenter().postNotificationName(NotificationCenter.historyImportProgressChanged, dialogId, new TLRPC.TL_messages_initHistoryImport(), error);
|
||||
} else {
|
||||
uploadSet.remove(path);
|
||||
}
|
||||
}
|
||||
|
||||
private void addUploadProgress(String path, long sz, float progress) {
|
||||
uploadProgresses.put(path, progress);
|
||||
@ -181,7 +192,6 @@ public class SendMessagesHelper extends BaseController implements NotificationCe
|
||||
|
||||
private void onMediaImport(String path, long size, TLRPC.InputFile inputFile) {
|
||||
addUploadProgress(path, size, 1.0f);
|
||||
uploadedMedias.put(path, inputFile);
|
||||
TLRPC.TL_messages_uploadImportedMedia req = new TLRPC.TL_messages_uploadImportedMedia();
|
||||
req.peer = peer;
|
||||
req.import_id = importId;
|
||||
@ -754,6 +764,12 @@ public boolean retriedToSend;
|
||||
} else if (id == NotificationCenter.FileDidFailUpload) {
|
||||
final String location = (String) args[0];
|
||||
final boolean enc = (Boolean) args[1];
|
||||
|
||||
ImportingHistory importingHistory = importingHistoryFiles.get(location);
|
||||
if (importingHistory != null) {
|
||||
importingHistory.onFileFailedToUpload(location);
|
||||
}
|
||||
|
||||
ArrayList<DelayedMessage> arr = delayedMessages.get(location);
|
||||
if (arr != null) {
|
||||
for (int a = 0; a < arr.size(); a++) {
|
||||
|
@ -405,6 +405,7 @@ public class MediaCodecVideoConvertor {
|
||||
encoderOutputBuffers = encoder.getOutputBuffers();
|
||||
}
|
||||
|
||||
int maxBufferSize = 0;
|
||||
if (audioIndex >= 0) {
|
||||
MediaFormat audioFormat = extractor.getTrackFormat(audioIndex);
|
||||
copyAudioBuffer = audioFormat.getString(MediaFormat.KEY_MIME).equals(MediaController.AUIDO_MIME_TYPE) || audioFormat.getString(MediaFormat.KEY_MIME).equals("audio/mpeg");
|
||||
@ -417,7 +418,14 @@ public class MediaCodecVideoConvertor {
|
||||
if (copyAudioBuffer) {
|
||||
audioTrackIndex = mediaMuxer.addTrack(audioFormat, true);
|
||||
extractor.selectTrack(audioIndex);
|
||||
int maxBufferSize = audioFormat.getInteger(MediaFormat.KEY_MAX_INPUT_SIZE);
|
||||
try {
|
||||
maxBufferSize = audioFormat.getInteger(MediaFormat.KEY_MAX_INPUT_SIZE);
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e); //s20 ultra exception
|
||||
}
|
||||
if (maxBufferSize <= 0) {
|
||||
maxBufferSize = 16 * 1024;
|
||||
}
|
||||
audioBuffer = ByteBuffer.allocateDirect(maxBufferSize);
|
||||
|
||||
if (startTime > 0) {
|
||||
@ -479,6 +487,11 @@ public class MediaCodecVideoConvertor {
|
||||
}
|
||||
}
|
||||
} else if (copyAudioBuffer && audioIndex != -1 && index == audioIndex) {
|
||||
long size = extractor.getSampleSize();
|
||||
if (size > maxBufferSize) {
|
||||
maxBufferSize = (int) (size + 1024);
|
||||
audioBuffer = ByteBuffer.allocateDirect(maxBufferSize);
|
||||
}
|
||||
info.size = extractor.readSampleData(audioBuffer, 0);
|
||||
if (Build.VERSION.SDK_INT < 21) {
|
||||
audioBuffer.position(0);
|
||||
@ -788,7 +801,12 @@ public class MediaCodecVideoConvertor {
|
||||
extractor.selectTrack(videoTrackIndex);
|
||||
MediaFormat trackFormat = extractor.getTrackFormat(videoTrackIndex);
|
||||
muxerVideoTrackIndex = mediaMuxer.addTrack(trackFormat, false);
|
||||
maxBufferSize = trackFormat.getInteger(MediaFormat.KEY_MAX_INPUT_SIZE);
|
||||
try {
|
||||
maxBufferSize = trackFormat.getInteger(MediaFormat.KEY_MAX_INPUT_SIZE);
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e); //s20 ultra exception
|
||||
}
|
||||
|
||||
if (start > 0) {
|
||||
extractor.seekTo(start, MediaExtractor.SEEK_TO_PREVIOUS_SYNC);
|
||||
} else {
|
||||
@ -803,7 +821,11 @@ public class MediaCodecVideoConvertor {
|
||||
audioTrackIndex = -1;
|
||||
} else {
|
||||
muxerAudioTrackIndex = mediaMuxer.addTrack(trackFormat, true);
|
||||
maxBufferSize = Math.max(trackFormat.getInteger(MediaFormat.KEY_MAX_INPUT_SIZE), maxBufferSize);
|
||||
try {
|
||||
maxBufferSize = Math.max(trackFormat.getInteger(MediaFormat.KEY_MAX_INPUT_SIZE), maxBufferSize);
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e); //s20 ultra exception
|
||||
}
|
||||
if (start > 0) {
|
||||
extractor.seekTo(start, MediaExtractor.SEEK_TO_PREVIOUS_SYNC);
|
||||
} else {
|
||||
@ -811,6 +833,9 @@ public class MediaCodecVideoConvertor {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (maxBufferSize <= 0) {
|
||||
maxBufferSize = 16 * 1024;
|
||||
}
|
||||
ByteBuffer buffer = ByteBuffer.allocateDirect(maxBufferSize);
|
||||
if (audioTrackIndex >= 0 || videoTrackIndex >= 0) {
|
||||
long startTime = -1;
|
||||
@ -819,6 +844,11 @@ public class MediaCodecVideoConvertor {
|
||||
checkConversionCanceled();
|
||||
boolean eof = false;
|
||||
int muxerTrackIndex;
|
||||
long size = extractor.getSampleSize();
|
||||
if (size > maxBufferSize) {
|
||||
maxBufferSize = (int) (size + 1024);
|
||||
buffer = ByteBuffer.allocateDirect(maxBufferSize);
|
||||
}
|
||||
info.size = extractor.readSampleData(buffer, 0);
|
||||
int index = extractor.getSampleTrackIndex();
|
||||
if (index == videoTrackIndex) {
|
||||
|
@ -36987,6 +36987,7 @@ public class TLRPC {
|
||||
public boolean can_self_unmute;
|
||||
public boolean just_joined;
|
||||
public boolean versioned;
|
||||
public boolean min;
|
||||
public boolean muted_by_you;
|
||||
public int user_id;
|
||||
public int date;
|
||||
@ -37020,6 +37021,7 @@ public class TLRPC {
|
||||
can_self_unmute = (flags & 4) != 0;
|
||||
just_joined = (flags & 16) != 0;
|
||||
versioned = (flags & 32) != 0;
|
||||
min = (flags & 256) != 0;
|
||||
muted_by_you = (flags & 512) != 0;
|
||||
user_id = stream.readInt32(exception);
|
||||
date = stream.readInt32(exception);
|
||||
@ -37039,6 +37041,7 @@ public class TLRPC {
|
||||
flags = can_self_unmute ? (flags | 4) : (flags &~ 4);
|
||||
flags = just_joined ? (flags | 16) : (flags &~ 16);
|
||||
flags = versioned ? (flags | 32) : (flags &~ 32);
|
||||
flags = min ? (flags | 256) : (flags &~ 256);
|
||||
flags = muted_by_you ? (flags | 512) : (flags &~ 512);
|
||||
stream.writeInt32(flags);
|
||||
stream.writeInt32(user_id);
|
||||
@ -45282,6 +45285,8 @@ public class TLRPC {
|
||||
id = stream.readInt32(exception);
|
||||
if ((flags & 1) != 0) {
|
||||
peer_id = Peer.TLdeserialize(stream, stream.readInt32(exception), exception);
|
||||
} else {
|
||||
peer_id = new TL_peerUser();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -201,7 +201,7 @@ public class DialogsAdapter extends RecyclerListView.SelectionAdapter {
|
||||
boolean hasContacts = false;
|
||||
if (hasHints) {
|
||||
count += 2 + messagesController.hintDialogs.size();
|
||||
} else if (dialogsType == 0 && dialogsCount <= 10 && folderId == 0 && messagesController.isDialogsEndReached(folderId)) {
|
||||
} else if (dialogsType == 0 && messagesController.dialogs_dict.size() <= 10 && folderId == 0 && messagesController.isDialogsEndReached(folderId)) {
|
||||
if (ContactsController.getInstance(currentAccount).contacts.isEmpty() && ContactsController.getInstance(currentAccount).isLoadingContacts()) {
|
||||
onlineContacts = null;
|
||||
return (currentCount = 0);
|
||||
|
@ -355,7 +355,7 @@ public class StickersSearchAdapter extends RecyclerListView.SelectionAdapter {
|
||||
((FeaturedStickerSetInfoCell) view).setAddOnClickListener(v -> {
|
||||
final FeaturedStickerSetInfoCell cell = (FeaturedStickerSetInfoCell) v.getParent();
|
||||
TLRPC.StickerSetCovered pack = cell.getStickerSet();
|
||||
if (installingStickerSets.indexOfKey(pack.set.id) >= 0 || removingStickerSets.indexOfKey(pack.set.id) >= 0) {
|
||||
if (pack == null || installingStickerSets.indexOfKey(pack.set.id) >= 0 || removingStickerSets.indexOfKey(pack.set.id) >= 0) {
|
||||
return;
|
||||
}
|
||||
if (cell.isInstalled()) {
|
||||
@ -439,11 +439,14 @@ public class StickersSearchAdapter extends RecyclerListView.SelectionAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position, @NonNull List payloads) {
|
||||
if (payloads.contains(PAYLOAD_ANIMATED)) {
|
||||
if (holder.getItemViewType() == 3) {
|
||||
bindFeaturedStickerSetInfoCell((FeaturedStickerSetInfoCell) holder.itemView, position, true);
|
||||
} else {
|
||||
super.onBindViewHolder(holder, position, payloads);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -215,14 +215,16 @@ public class StickerEmojiCell extends FrameLayout {
|
||||
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
|
||||
super.onInitializeAccessibilityNodeInfo(info);
|
||||
String descr = LocaleController.getString("AttachSticker", R.string.AttachSticker);
|
||||
for (int a = 0; a < sticker.attributes.size(); a++) {
|
||||
TLRPC.DocumentAttribute attribute = sticker.attributes.get(a);
|
||||
if (attribute instanceof TLRPC.TL_documentAttributeSticker) {
|
||||
if (attribute.alt != null && attribute.alt.length() > 0) {
|
||||
emojiTextView.setText(Emoji.replaceEmoji(attribute.alt, emojiTextView.getPaint().getFontMetricsInt(), AndroidUtilities.dp(16), false));
|
||||
descr = attribute.alt + " " + descr;
|
||||
if (sticker != null) {
|
||||
for (int a = 0; a < sticker.attributes.size(); a++) {
|
||||
TLRPC.DocumentAttribute attribute = sticker.attributes.get(a);
|
||||
if (attribute instanceof TLRPC.TL_documentAttributeSticker) {
|
||||
if (attribute.alt != null && attribute.alt.length() > 0) {
|
||||
emojiTextView.setText(Emoji.replaceEmoji(attribute.alt, emojiTextView.getPaint().getFontMetricsInt(), AndroidUtilities.dp(16), false));
|
||||
descr = attribute.alt + " " + descr;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
info.setContentDescription(descr);
|
||||
|
@ -756,7 +756,18 @@ public class ChannelCreateActivity extends BaseFragment implements NotificationC
|
||||
return;
|
||||
}
|
||||
loadingInvite = true;
|
||||
TLRPC.TL_messages_getExportedChatInvites req = new TLRPC.TL_messages_getExportedChatInvites();
|
||||
TLRPC.TL_messages_exportChatInvite req = new TLRPC.TL_messages_exportChatInvite();
|
||||
req.peer = getMessagesController().getInputPeer(-chatId);
|
||||
final int reqId = getConnectionsManager().sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
|
||||
if (error == null) {
|
||||
invite = (TLRPC.TL_chatInviteExported) response;
|
||||
}
|
||||
loadingInvite = false;
|
||||
permanentLinkView.setLink(invite != null ? invite.link : null);
|
||||
}));
|
||||
getConnectionsManager().bindRequestToGuid(reqId, classGuid);
|
||||
|
||||
/*TLRPC.TL_messages_getExportedChatInvites req = new TLRPC.TL_messages_getExportedChatInvites(); TODO layer 124
|
||||
req.peer = getMessagesController().getInputPeer(-chatId);
|
||||
req.admin_id = getMessagesController().getInputUser(getUserConfig().getCurrentUser());
|
||||
req.limit = 1;
|
||||
@ -768,7 +779,7 @@ public class ChannelCreateActivity extends BaseFragment implements NotificationC
|
||||
}
|
||||
loadingInvite = false;
|
||||
permanentLinkView.setLink(invite != null ? invite.link : null);
|
||||
}));
|
||||
}));*/
|
||||
}
|
||||
|
||||
private void updatePrivatePublic() {
|
||||
|
@ -8179,6 +8179,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
return dialog_id;
|
||||
}
|
||||
|
||||
public UndoView getUndoView() {
|
||||
return undoView;
|
||||
}
|
||||
|
||||
public long getMergeDialogId() {
|
||||
return mergeDialogId;
|
||||
}
|
||||
@ -20647,7 +20651,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
if (editTextItem != null) {
|
||||
editTextItem.setVisibility(View.GONE);
|
||||
}
|
||||
if (threadMessageId == 0) {
|
||||
if (threadMessageId == 0 && searchItem != null) {
|
||||
searchItem.setVisibility(View.VISIBLE);
|
||||
}
|
||||
searchItemVisible = true;
|
||||
@ -20656,10 +20660,14 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
}
|
||||
if (threadMessageId == 0 && !UserObject.isReplyUser(currentUser)) {
|
||||
openSearchKeyboard = text == null;
|
||||
searchItem.openSearch(openSearchKeyboard);
|
||||
if (searchItem != null) {
|
||||
searchItem.openSearch(openSearchKeyboard);
|
||||
}
|
||||
}
|
||||
if (text != null) {
|
||||
searchItem.setSearchFieldText(text, false);
|
||||
if (searchItem != null) {
|
||||
searchItem.setSearchFieldText(text, false);
|
||||
}
|
||||
getMediaDataController().searchMessagesInChat(text, dialog_id, mergeDialogId, classGuid, 0, threadMessageId, searchingUserMessages, searchingChatMessages);
|
||||
}
|
||||
updatePinnedMessageView(true);
|
||||
|
@ -2243,7 +2243,14 @@ public class ChatUsersActivity extends BaseFragment implements NotificationCente
|
||||
}
|
||||
if (type == TYPE_USERS) {
|
||||
for (int a = 0, N = participants.size(); a < N; a++) {
|
||||
TLRPC.ChannelParticipant participant = (TLRPC.ChannelParticipant) participants.get(a);
|
||||
TLObject object = participants.get(a);
|
||||
if (!(object instanceof TLRPC.ChannelParticipant)) {
|
||||
participants.remove(a);
|
||||
a--;
|
||||
N--;
|
||||
continue;
|
||||
}
|
||||
TLRPC.ChannelParticipant participant = (TLRPC.ChannelParticipant) object;
|
||||
boolean remove = false;
|
||||
if (contactsMap.get(participant.user_id) != null || botsMap.get(participant.user_id) != null) {
|
||||
remove = true;
|
||||
|
@ -142,6 +142,8 @@ public class AlertsCreator {
|
||||
showSimpleAlert(fragment, LocaleController.getString("ImportErrorTitle", R.string.ImportErrorTitle), LocaleController.getString("ImportErrorFileFormatInvalid", R.string.ImportErrorFileFormatInvalid));
|
||||
} else if (error.text.contains("IMPORT_LANG_NOT_FOUND")) {
|
||||
showSimpleAlert(fragment, LocaleController.getString("ImportErrorTitle", R.string.ImportErrorTitle), LocaleController.getString("ImportErrorFileLang", R.string.ImportErrorFileLang));
|
||||
} else if (error.text.contains("IMPORT_UPLOAD_FAILED")) {
|
||||
showSimpleAlert(fragment, LocaleController.getString("ImportErrorTitle", R.string.ImportErrorTitle), LocaleController.getString("ImportFailedToUpload", R.string.ImportFailedToUpload));
|
||||
} else {
|
||||
showSimpleAlert(fragment, LocaleController.getString("ImportErrorTitle", R.string.ImportErrorTitle), LocaleController.getString("ErrorOccurred", R.string.ErrorOccurred) + "\n" + error.text);
|
||||
}
|
||||
@ -1265,15 +1267,19 @@ public class AlertsCreator {
|
||||
}
|
||||
boolean canDeleteInbox = !secret && user != null && canRevokeInbox && revokeTimeLimit == 0x7fffffff;
|
||||
final boolean[] deleteForAll = {true};
|
||||
boolean deleteGroupForAll = false;
|
||||
boolean deleteChatForAll = false;
|
||||
|
||||
if (!second && (secret || canDeleteInbox) && !UserObject.isDeleted(user) || (deleteGroupForAll = checkDeleteForAll && !clear && chat != null && chat.creator && (!ChatObject.isChannel(chat) || chat.megagroup))) {
|
||||
if (!second && (secret || canDeleteInbox) && !UserObject.isDeleted(user) || (deleteChatForAll = checkDeleteForAll && !clear && chat != null && chat.creator)) {
|
||||
cell[0] = new CheckBoxCell(context, 1);
|
||||
cell[0].setBackgroundDrawable(Theme.getSelectorDrawable(false));
|
||||
if (secret) {
|
||||
cell[0].setText(LocaleController.formatString("DeleteForUser", R.string.DeleteForUser, UserObject.getFirstName(user)), "", false, false);
|
||||
} else if (deleteGroupForAll) {
|
||||
cell[0].setText(LocaleController.getString("DeleteGroupForAll", R.string.DeleteGroupForAll), "", false, false);
|
||||
} else if (deleteChatForAll) {
|
||||
if (ChatObject.isChannel(chat) && !chat.megagroup) {
|
||||
cell[0].setText(LocaleController.getString("DeleteChannelForAll", R.string.DeleteChannelForAll), "", false, false);
|
||||
} else {
|
||||
cell[0].setText(LocaleController.getString("DeleteGroupForAll", R.string.DeleteGroupForAll), "", false, false);
|
||||
}
|
||||
} else if (clear) {
|
||||
cell[0].setText(LocaleController.formatString("ClearHistoryOptionAlso", R.string.ClearHistoryOptionAlso, UserObject.getFirstName(user)), "", true, false);
|
||||
} else {
|
||||
@ -1340,7 +1346,7 @@ public class AlertsCreator {
|
||||
if (chat.megagroup) {
|
||||
messageTextView.setText(LocaleController.getString("AreYouSureDeleteAndExit", R.string.AreYouSureDeleteAndExit));
|
||||
} else {
|
||||
messageTextView.setText(LocaleController.getString("ChannelDeleteAlert", R.string.ChannelDeleteAlert));
|
||||
messageTextView.setText(LocaleController.getString("AreYouSureDeleteAndExitChannel", R.string.AreYouSureDeleteAndExitChannel));
|
||||
}
|
||||
} else {
|
||||
messageTextView.setText(LocaleController.getString("AreYouSureDeleteAndExit", R.string.AreYouSureDeleteAndExit));
|
||||
|
@ -3,7 +3,6 @@ package org.telegram.ui.Components;
|
||||
import android.content.Context;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.CheckResult;
|
||||
|
||||
@ -27,20 +26,6 @@ public final class BulletinFactory {
|
||||
return fragment != null && fragment.getParentActivity() != null && fragment.getLayoutContainer() != null;
|
||||
}
|
||||
|
||||
public Bulletin createMembersNotifyInfo(boolean on) {
|
||||
if (on) {
|
||||
final Bulletin.LottieLayout layout = new Bulletin.LottieLayout(getContext());
|
||||
layout.setAnimation(R.raw.silent_unmute, 36, 36, "NULL BODY", "BODY", "Waves R", "Waves L", "Bottom");
|
||||
layout.textView.setText(LocaleController.getString("ChannelNotifyMembersInfoOn", R.string.ChannelNotifyMembersInfoOn));
|
||||
return create(layout, Bulletin.DURATION_SHORT);
|
||||
} else {
|
||||
final Bulletin.LottieLayout layout = new Bulletin.LottieLayout(getContext());
|
||||
layout.setAnimation(R.raw.silent_mute, 36, 36, "NULL BODY", "BODY", "Pieces", "Line Cross", "Bottom");
|
||||
layout.textView.setText(LocaleController.getString("ChannelNotifyMembersInfoOff", R.string.ChannelNotifyMembersInfoOff));
|
||||
return create(layout, Bulletin.DURATION_SHORT);
|
||||
}
|
||||
}
|
||||
|
||||
public enum FileType {
|
||||
|
||||
PHOTO("PhotoSavedHint", R.string.PhotoSavedHint, Icon.SAVED_TO_GALLERY),
|
||||
@ -243,6 +228,12 @@ public final class BulletinFactory {
|
||||
|
||||
@CheckResult
|
||||
public static Bulletin createUnpinAllMessagesBulletin(BaseFragment fragment, int count, boolean hide, Runnable undoAction, Runnable delayedAction) {
|
||||
if (fragment.getParentActivity() == null) {
|
||||
if (delayedAction != null) {
|
||||
delayedAction.run();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Bulletin.ButtonLayout buttonLayout;
|
||||
if (hide) {
|
||||
final Bulletin.TwoLineLottieLayout layout = new Bulletin.TwoLineLottieLayout(fragment.getParentActivity());
|
||||
|
@ -2136,7 +2136,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
BulletinFactory.of(fragment).createMembersNotifyInfo(!silent).show();
|
||||
fragment.getUndoView().showWithAction(0, !silent ? UndoView.ACTION_NOTIFY_ON : UndoView.ACTION_NOTIFY_OFF, null);
|
||||
notifyButton.setContentDescription(silent ? LocaleController.getString("AccDescrChanSilentOn", R.string.AccDescrChanSilentOn) : LocaleController.getString("AccDescrChanSilentOff", R.string.AccDescrChanSilentOff));
|
||||
updateFieldHint(true);
|
||||
}
|
||||
|
@ -66,8 +66,6 @@ import tw.nekomimi.nekogram.NekoConfig;
|
||||
|
||||
public class FilterTabsView extends FrameLayout {
|
||||
|
||||
private final ItemTouchHelper itemTouchHelper;
|
||||
|
||||
public interface FilterTabsViewDelegate {
|
||||
void onPageSelected(int page, boolean forward);
|
||||
|
||||
@ -195,6 +193,24 @@ public class FilterTabsView extends FrameLayout {
|
||||
return currentTab.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
animateChange = false;
|
||||
animateTabCounter = false;
|
||||
animateCounterChange = false;
|
||||
animateTextChange = false;
|
||||
animateTextX = false;
|
||||
animateTabWidth = false;
|
||||
if (changeAnimator != null) {
|
||||
changeAnimator.removeAllListeners();
|
||||
changeAnimator.removeAllUpdateListeners();
|
||||
changeAnimator.cancel();
|
||||
changeAnimator = null;
|
||||
}
|
||||
invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
int w = currentTab.getWidth(false) + AndroidUtilities.dp(32) + additionalTabWidth;
|
||||
@ -803,6 +819,7 @@ public class FilterTabsView extends FrameLayout {
|
||||
if (tabView.animateChange) {
|
||||
if (tabView.changeAnimator != null) {
|
||||
tabView.changeAnimator.removeAllListeners();
|
||||
tabView.changeAnimator.removeAllUpdateListeners();
|
||||
tabView.changeAnimator.cancel();
|
||||
}
|
||||
ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, 1f);
|
||||
@ -879,7 +896,7 @@ public class FilterTabsView extends FrameLayout {
|
||||
return super.scrollHorizontallyBy(dx, recycler, state);
|
||||
}
|
||||
});
|
||||
itemTouchHelper = new ItemTouchHelper(new TouchHelperCallback());
|
||||
ItemTouchHelper itemTouchHelper = new ItemTouchHelper(new TouchHelperCallback());
|
||||
itemTouchHelper.attachToRecyclerView(listView);
|
||||
listView.setPadding(AndroidUtilities.dp(7), 0, AndroidUtilities.dp(7), 0);
|
||||
listView.setClipToPadding(false);
|
||||
|
@ -1259,10 +1259,14 @@ public class RecyclerListView extends RecyclerView {
|
||||
}
|
||||
} else {
|
||||
emptyViewAnimateToVisibility = -1;
|
||||
checkIfEmpty(isAttachedToWindow());
|
||||
checkIfEmpty(updateEmptyViewAnimated());
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean updateEmptyViewAnimated() {
|
||||
return isAttachedToWindow();
|
||||
}
|
||||
|
||||
public View getEmptyView() {
|
||||
return emptyView;
|
||||
}
|
||||
|
@ -132,6 +132,8 @@ public class UndoView extends FrameLayout {
|
||||
public final static int ACTION_PLAYBACK_SPEED_DISABLED = 51;
|
||||
public final static int ACTION_TEXT_COPIED = 52;
|
||||
public final static int ACTION_FWD_MESSAGES = 53;
|
||||
public final static int ACTION_NOTIFY_ON = 54;
|
||||
public final static int ACTION_NOTIFY_OFF = 55;
|
||||
|
||||
public final static int ACTION_NEED_RESATRT = 100;
|
||||
|
||||
@ -620,41 +622,56 @@ public class UndoView extends FrameLayout {
|
||||
undoButton.setVisibility(GONE);
|
||||
} else if (currentAction == ACTION_IMPORT_NOT_MUTUAL || currentAction == ACTION_IMPORT_GROUP_NOT_ADMIN || currentAction == ACTION_IMPORT_INFO ||
|
||||
currentAction == ACTION_PLAYBACK_SPEED_DISABLED || currentAction == ACTION_PLAYBACK_SPEED_ENABLED || currentAction == ACTION_TEXT_COPIED ||
|
||||
currentAction == ACTION_FWD_MESSAGES) {
|
||||
currentAction == ACTION_FWD_MESSAGES || currentAction == ACTION_NOTIFY_ON || currentAction == ACTION_NOTIFY_OFF) {
|
||||
undoImageView.setVisibility(GONE);
|
||||
leftImageView.setVisibility(VISIBLE);
|
||||
|
||||
infoTextView.setTypeface(Typeface.DEFAULT);
|
||||
infoTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13);
|
||||
|
||||
if (currentAction == ACTION_IMPORT_NOT_MUTUAL) {
|
||||
infoTextView.setText(LocaleController.getString("ImportMutualError", R.string.ImportMutualError));
|
||||
leftImageView.setAnimation(R.raw.error, 36, 36);
|
||||
infoOnly = true;
|
||||
layoutParams.topMargin = AndroidUtilities.dp(10);
|
||||
infoTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
|
||||
} else if (currentAction == ACTION_IMPORT_GROUP_NOT_ADMIN) {
|
||||
infoTextView.setText(LocaleController.getString("ImportNotAdmin", R.string.ImportNotAdmin));
|
||||
leftImageView.setAnimation(R.raw.error, 36, 36);
|
||||
infoOnly = true;
|
||||
layoutParams.topMargin = AndroidUtilities.dp(10);
|
||||
infoTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
|
||||
} else if (currentAction == ACTION_IMPORT_INFO) {
|
||||
infoTextView.setText(LocaleController.getString("ImportedInfo", R.string.ImportedInfo));
|
||||
leftImageView.setAnimation(R.raw.imported, 36, 36);
|
||||
leftImageView.setPadding(0, 0, 0, AndroidUtilities.dp(5));
|
||||
infoOnly = true;
|
||||
layoutParams.topMargin = AndroidUtilities.dp(10);
|
||||
infoTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
|
||||
} else if (currentAction == ACTION_PLAYBACK_SPEED_DISABLED) {
|
||||
infoTextView.setText(LocaleController.getString("AudioSpeedNormal", R.string.AudioSpeedNormal));
|
||||
leftImageView.setAnimation(R.raw.audio_stop_speed, 36, 36);
|
||||
timeLeft = 3000;
|
||||
infoTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15);
|
||||
} else if (currentAction == ACTION_PLAYBACK_SPEED_ENABLED) {
|
||||
infoTextView.setText(LocaleController.getString("AudioSpeedFast", R.string.AudioSpeedFast));
|
||||
leftImageView.setAnimation(R.raw.audio_speed, 36, 36);
|
||||
timeLeft = 3000;
|
||||
infoTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15);
|
||||
} else if (currentAction == ACTION_TEXT_COPIED) {
|
||||
infoTextView.setText(LocaleController.getString("MessageCopied", R.string.MessageCopied));
|
||||
leftImageView.setAnimation(R.raw.copy, 30, 30);
|
||||
timeLeft = 3000;
|
||||
infoTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15);
|
||||
} else if (currentAction == ACTION_NOTIFY_ON) {
|
||||
infoTextView.setText(LocaleController.getString("ChannelNotifyMembersInfoOn", R.string.ChannelNotifyMembersInfoOn));
|
||||
leftImageView.setAnimation(R.raw.silent_unmute, 30, 30);
|
||||
timeLeft = 3000;
|
||||
infoTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15);
|
||||
} else if (currentAction == ACTION_NOTIFY_OFF) {
|
||||
infoTextView.setText(LocaleController.getString("ChannelNotifyMembersInfoOff", R.string.ChannelNotifyMembersInfoOff));
|
||||
leftImageView.setAnimation(R.raw.silent_mute, 30, 30);
|
||||
timeLeft = 3000;
|
||||
infoTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15);
|
||||
} else if (currentAction == ACTION_FWD_MESSAGES) {
|
||||
Integer count = (Integer) infoObject;
|
||||
if (infoObject2 == null) {
|
||||
|
@ -41,6 +41,7 @@ import android.os.Bundle;
|
||||
import android.os.Vibrator;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Property;
|
||||
import android.util.SparseArray;
|
||||
import android.util.StateSet;
|
||||
import android.view.Gravity;
|
||||
import android.view.HapticFeedbackConstants;
|
||||
@ -404,6 +405,7 @@ private int lastMeasuredTopPadding;
|
||||
private float filterTabsMoveFrom;
|
||||
private float tabsYOffset;
|
||||
private float scrollAdditionalOffset;
|
||||
private SparseArray<Float> listAlphaItems = new SparseArray<>();
|
||||
|
||||
public final Property<DialogsActivity, Float> SCROLL_Y = new AnimationProperties.FloatProperty<DialogsActivity>("animationValue") {
|
||||
@Override
|
||||
@ -1089,6 +1091,11 @@ private int lastMeasuredTopPadding;
|
||||
parentPage = page;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean updateEmptyViewAnimated() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setViewsOffset(float viewOffset) {
|
||||
DialogsActivity.viewOffset = viewOffset;
|
||||
int n = getChildCount();
|
||||
@ -1114,12 +1121,20 @@ private int lastMeasuredTopPadding;
|
||||
public void addView(View child, int index, ViewGroup.LayoutParams params) {
|
||||
super.addView(child, index, params);
|
||||
child.setTranslationY(viewOffset);
|
||||
int position = getChildAdapterPosition(child);
|
||||
Float alpha = listAlphaItems.get(position);
|
||||
if (alpha != null) {
|
||||
child.setAlpha(alpha);
|
||||
} else {
|
||||
child.setAlpha(1f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeView(View view) {
|
||||
super.removeView(view);
|
||||
view.setTranslationY(0);
|
||||
view.setAlpha(1f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1145,7 +1160,6 @@ private int lastMeasuredTopPadding;
|
||||
if (slidingView != null && pacmanAnimation != null) {
|
||||
pacmanAnimation.draw(canvas, slidingView.getTop() + slidingView.getMeasuredHeight() / 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1456,16 +1470,19 @@ private int lastMeasuredTopPadding;
|
||||
parentPage.listView.toggleArchiveHidden(false, dialogCell);
|
||||
return;
|
||||
}
|
||||
TLRPC.Dialog dialog = getMessagesController().dialogs_dict.get(dialogId);
|
||||
if (dialog == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
slidingView = dialogCell;
|
||||
int position = viewHolder.getAdapterPosition();
|
||||
int dialogIndex = parentPage.dialogsAdapter.fixPosition(position);
|
||||
int count = parentPage.dialogsAdapter.getItemCount();
|
||||
Runnable finishRunnable = () -> {
|
||||
if (frozenDialogsList == null) {
|
||||
return;
|
||||
}
|
||||
TLRPC.Dialog dialog = frozenDialogsList.remove(dialogIndex);
|
||||
frozenDialogsList.remove(dialog);
|
||||
int pinnedNum = dialog.pinnedNum;
|
||||
slidingView = null;
|
||||
parentPage.listView.invalidate();
|
||||
@ -5990,13 +6007,44 @@ private int lastMeasuredTopPadding;
|
||||
listView.getViewTreeObserver().removeOnPreDrawListener(this);
|
||||
int n = listView.getChildCount();
|
||||
AnimatorSet animatorSet = new AnimatorSet();
|
||||
boolean animated = false;
|
||||
for (int i = 0; i < n; i++) {
|
||||
View child = listView.getChildAt(i);
|
||||
if (child != finalProgressView && listView.getChildAdapterPosition(child) >= finalFrom - 1) {
|
||||
int position = listView.getChildAdapterPosition(child);
|
||||
if (child != finalProgressView && position >= finalFrom - 1 && listAlphaItems.get(position, null) == null) {
|
||||
listAlphaItems.put(position, 0f);
|
||||
child.setAlpha(0);
|
||||
int s = Math.min(listView.getMeasuredHeight(), Math.max(0, child.getTop()));
|
||||
int delay = (int) ((s / (float) listView.getMeasuredHeight()) * 100);
|
||||
ObjectAnimator a = ObjectAnimator.ofFloat(child, View.ALPHA, 0, 1f);
|
||||
ValueAnimator a = ValueAnimator.ofFloat(0, 1f);
|
||||
a.addUpdateListener(valueAnimator -> {
|
||||
Float alpha = (Float) valueAnimator.getAnimatedValue();
|
||||
listAlphaItems.put(position, alpha);
|
||||
if (listView.getChildAdapterPosition(child) == position) {
|
||||
child.setAlpha(alpha);
|
||||
} else {
|
||||
RecyclerView.ViewHolder vh = listView.findViewHolderForAdapterPosition(position);
|
||||
if (vh != null) {
|
||||
vh.itemView.setAlpha(1f);
|
||||
}
|
||||
}
|
||||
});
|
||||
a.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
listAlphaItems.remove(position);
|
||||
if (listAlphaItems.size() == 0) {
|
||||
for (int i = 0; i < listView.getChildCount(); i++) {
|
||||
listView.getChildAt(i).setAlpha(1f);
|
||||
}
|
||||
} else {
|
||||
RecyclerView.ViewHolder vh = listView.findViewHolderForAdapterPosition(position);
|
||||
if (vh != null) {
|
||||
vh.itemView.setAlpha(1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
a.setStartDelay(delay);
|
||||
a.setDuration(200);
|
||||
animatorSet.playTogether(a);
|
||||
@ -6020,7 +6068,6 @@ private int lastMeasuredTopPadding;
|
||||
animator.start();
|
||||
}
|
||||
}
|
||||
|
||||
animatorSet.start();
|
||||
return true;
|
||||
}
|
||||
|
@ -148,6 +148,8 @@ import org.telegram.ui.Components.IdenticonDrawable;
|
||||
import org.telegram.ui.Components.ImageUpdater;
|
||||
import org.telegram.ui.Components.LayoutHelper;
|
||||
import org.telegram.ui.Components.ProfileGalleryView;
|
||||
import org.telegram.ui.Components.RLottieDrawable;
|
||||
import org.telegram.ui.Components.RLottieImageView;
|
||||
import org.telegram.ui.Components.RadialProgressView;
|
||||
import org.telegram.ui.Components.RecyclerListView;
|
||||
import org.telegram.ui.Components.ScamDrawable;
|
||||
@ -199,7 +201,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
private SimpleTextView[] onlineTextView = new SimpleTextView[2];
|
||||
private AudioPlayerAlert.ClippingTextViewSwitcher mediaCounterTextView;
|
||||
private SimpleTextView idTextView;
|
||||
private ImageView writeButton;
|
||||
private RLottieImageView writeButton;
|
||||
private AnimatorSet writeButtonAnimation;
|
||||
private Drawable lockIconDrawable;
|
||||
private Drawable verifiedDrawable;
|
||||
@ -213,6 +215,8 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
private boolean sharedMediaLayoutAttached;
|
||||
private SharedMediaLayout.SharedMediaPreloader sharedMediaPreloader;
|
||||
|
||||
private RLottieDrawable cameraDrawable;
|
||||
|
||||
private FrameLayout avatarContainer;
|
||||
private AvatarImageView avatarImage;
|
||||
private View avatarOverlay;
|
||||
@ -3273,7 +3277,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
frameLayout.addView(mediaCounterTextView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.LEFT | Gravity.TOP, 118, 0, 8, 0));
|
||||
updateProfileData();
|
||||
|
||||
writeButton = new ImageView(context);
|
||||
writeButton = new RLottieImageView(context);
|
||||
Drawable drawable = Theme.createSimpleSelectorCircleDrawable(AndroidUtilities.dp(56), Theme.getColor(Theme.key_profile_actionBackground), Theme.getColor(Theme.key_profile_actionPressedBackground));
|
||||
if (Build.VERSION.SDK_INT < 21) {
|
||||
Drawable shadowDrawable = context.getResources().getDrawable(R.drawable.floating_shadow_profile).mutate();
|
||||
@ -3287,7 +3291,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
if (imageUpdater != null) {
|
||||
writeButton.setImageResource(R.drawable.baseline_edit_24);
|
||||
writeButton.setContentDescription(LocaleController.getString("AccDescrChangeProfilePicture", R.string.AccDescrChangeProfilePicture));
|
||||
writeButton.setPadding(AndroidUtilities.dp(2), AndroidUtilities.dp(2), 0, 0);
|
||||
writeButton.setPadding(AndroidUtilities.dp(2), 0, 0, AndroidUtilities.dp(2));
|
||||
} else {
|
||||
writeButton.setImageResource(R.drawable.profile_newmsg);
|
||||
writeButton.setContentDescription(LocaleController.getString("AccDescrOpenChat", R.string.AccDescrOpenChat));
|
||||
@ -5152,7 +5156,12 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
}
|
||||
|
||||
if (notify && listAdapter != null && membersStartRow > 0) {
|
||||
listAdapter.notifyItemRangeChanged(membersStartRow, sortedUsers.size());
|
||||
try {
|
||||
listAdapter.notifyItemRangeChanged(membersStartRow, sortedUsers.size());
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
listAdapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
if (sharedMediaLayout != null && sharedMediaRow != -1 && (sortedUsers.size() > 5 || usersForceShowingIn == 2) && usersForceShowingIn != 1) {
|
||||
sharedMediaLayout.setChatUsers(sortedUsers, chatInfo);
|
||||
|
@ -7,6 +7,7 @@ import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
import org.telegram.messenger.FileLog;
|
||||
import org.telegram.messenger.voip.VoIPService;
|
||||
import org.telegram.ui.Components.voip.VoIPHelper;
|
||||
|
||||
@ -29,7 +30,11 @@ public class VoIPPermissionActivity extends Activity {
|
||||
permissions.add(Manifest.permission.CAMERA);
|
||||
}
|
||||
if (permissions.isEmpty()) {
|
||||
requestPermissions(permissions.toArray(new String[0]), isVideoCall ? 102 : 101);
|
||||
try {
|
||||
requestPermissions(permissions.toArray(new String[0]), isVideoCall ? 102 : 101);
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
1
TMessagesProj/src/main/res/raw/camera_outline.json
Normal file
1
TMessagesProj/src/main/res/raw/camera_outline.json
Normal file
File diff suppressed because one or more lines are too long
@ -292,6 +292,7 @@
|
||||
<string name="MegaAdminsInfo">You can add administrators to help you manage your group. Tap and hold to remove them.</string>
|
||||
<string name="MegaDeleteAlert">Wait! Deleting this group will remove all members and all messages will be lost. Delete the group anyway?</string>
|
||||
<string name="DeleteGroupForAll">Delete the group for all members</string>
|
||||
<string name="DeleteChannelForAll">Delete for all subscribers</string>
|
||||
<string name="ActionCreateMega">Group created</string>
|
||||
<string name="MegaAddedBy">un1 added you to this group</string>
|
||||
<string name="MegaLeaveAlert">Are you sure you want to leave the group?</string>
|
||||
@ -1124,6 +1125,7 @@
|
||||
<string name="PinnedMessagesHiddenInfo">You will see the bar with pinned messages only if a new message is pinned.</string>
|
||||
<string name="ImportedMessage">Imported</string>
|
||||
<string name="ImportFileTooLarge">Importing file is too large.</string>
|
||||
<string name="ImportFailedToUpload">Failed to upload file.</string>
|
||||
<string name="AudioSpeedNormal">Audio will play at normal speed.</string>
|
||||
<string name="AudioSpeedFast">Audio will play two times faster.</string>
|
||||
<string name="MessageCopied">Message copied to clipboard.</string>
|
||||
@ -3029,6 +3031,7 @@
|
||||
<string name="AreYouSureClearHistoryFewChats">Are you sure you want to clear history in selected chats?</string>
|
||||
<string name="AreYouSureClearHistoryCacheFewChats">Delete all cached text and media from selected chats?</string>
|
||||
<string name="AreYouSureDeleteAndExit">Are you sure you want to delete and leave the group?</string>
|
||||
<string name="AreYouSureDeleteAndExitChannel">Are you sure you want to delete and leave the channel?</string>
|
||||
<string name="AreYouSureDeleteAndExitName">Are you sure you want to delete and leave the group **%1$s**?</string>
|
||||
<string name="AreYouSureDeleteThisChat">Are you sure you want to delete this chat?</string>
|
||||
<string name="AreYouSureDeleteThisChatWithUser">Are you sure you want to delete the chat with **%1$s**?</string>
|
||||
|
@ -1,5 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
function flavor() {
|
||||
for f in "$@"; do
|
||||
./gradlew TMessagesProj:assemble${1}Release || exit 1
|
||||
./gradlew TMessagesProj:assemble${1}ReleaseNoGcm || exit 1
|
||||
done
|
||||
}
|
||||
|
||||
source bin/app/build.sh
|
||||
|
||||
flavor Full
|
||||
flavor Mini &
|
||||
upload full/release
|
||||
upload full/releaseNoGcm
|
||||
upload full/releaseNoGcm
|
||||
|
||||
for job in $(jobs -p); do
|
||||
wait $job || exit 1
|
||||
done
|
||||
|
||||
upload mini/release
|
||||
upload mini/releaseNoGcm
|
||||
|
Loading…
x
Reference in New Issue
Block a user