Skip to content

Commit

Permalink
Update to 7.8.0 (2360)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrKLO committed Jun 25, 2021
1 parent e8d88e5 commit dd2b001
Show file tree
Hide file tree
Showing 18 changed files with 1,869 additions and 675 deletions.
2 changes: 1 addition & 1 deletion TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ android {
}
}

defaultConfig.versionCode = 2359
defaultConfig.versionCode = 2360

applicationVariants.all { variant ->
variant.outputs.all { output ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class BuildVars {
public static boolean USE_CLOUD_STRINGS = true;
public static boolean CHECK_UPDATES = true;
public static boolean NO_SCOPED_STORAGE = true/* || Build.VERSION.SDK_INT <= 28*/;
public static int BUILD_VERSION = 2359;
public static int BUILD_VERSION = 2360;
public static String BUILD_VERSION_STRING = "7.8.0";
public static int APP_ID = 4;
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4012,7 +4012,7 @@ public static String getStickerExt(Uri uri) {
inputStream = ApplicationLoader.applicationContext.getContentResolver().openInputStream(uri);
byte[] header = new byte[12];
if (inputStream.read(header, 0, 12) == 12) {
if (header[0] == 0x89 && header[1] == 0x50 && header[2] == 0x4E && header[3] == 0x47 && header[4] == 0x0D && header[5] == 0x0A && header[6] == 0x1A && header[7] == 0x0A) {
if (header[0] == (byte) 0x89 && header[1] == (byte) 0x50 && header[2] == (byte) 0x4E && header[3] == (byte) 0x47 && header[4] == (byte) 0x0D && header[5] == (byte) 0x0A && header[6] == (byte) 0x1A && header[7] == (byte) 0x0A) {
return "png";
}
if (header[0] == 0x1f && header[1] == (byte) 0x8b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2480,12 +2480,15 @@ private void updateMessageText(AbstractMap<Integer, TLRPC.User> users, AbstractM
}
messageText = LocaleController.formatString("ActionGroupCallEnded", R.string.ActionGroupCallEnded, time);
} else {
messageText = LocaleController.getString("ActionGroupCallJustStarted", R.string.ActionGroupCallJustStarted);
/*if (isOut()) {
messageText = LocaleController.getString("ActionGroupCallStartedByYou", R.string.ActionGroupCallStartedByYou);
if (isSupergroup()) {
if (isOut()) {
messageText = LocaleController.getString("ActionGroupCallStartedByYou", R.string.ActionGroupCallStartedByYou);
} else {
messageText = replaceWithLink(LocaleController.getString("ActionGroupCallStarted", R.string.ActionGroupCallStarted), "un1", fromObject);
}
} else {
messageText = replaceWithLink(LocaleController.getString("ActionGroupCallStarted", R.string.ActionGroupCallStarted), "un1", fromObject);
}*/
messageText = LocaleController.getString("ActionGroupCallJustStarted", R.string.ActionGroupCallJustStarted);
}
}
} else if (messageOwner.action instanceof TLRPC.TL_messageActionInviteToGroupCall) {
int singleUserId = messageOwner.action.user_id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8210,7 +8210,8 @@ public static int getColor(String key, boolean[] isDefault, boolean ignoreAnimat
return color;
}
}
if (serviceBitmapShader != null && (key_chat_serviceText.equals(key) || key_chat_serviceLink.equals(key) || key_chat_serviceIcon.equals(key))) {
if (serviceBitmapShader != null && (key_chat_serviceText.equals(key) || key_chat_serviceLink.equals(key) || key_chat_serviceIcon.equals(key)
|| key_chat_stickerReplyLine.equals(key) || key_chat_stickerReplyNameText.equals(key) || key_chat_stickerReplyMessageText.equals(key))) {
return 0xffffffff;
}
if (currentTheme == defaultTheme) {
Expand Down
17 changes: 12 additions & 5 deletions TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -15097,10 +15097,6 @@ private void processNewMessages(ArrayList<MessageObject> arr) {
messageObject.localGroupId = localId;
}
if (messageObject.isOut()) {
Drawable wallpaper = Theme.getCachedWallpaperNonBlocking();
if (wallpaper instanceof MotionBackgroundDrawable) {
((MotionBackgroundDrawable) wallpaper).switchToNextPosition();
}
if (!notifiedSearch) {
notifiedSearch = true;
NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.closeSearchByActiveAction);
Expand Down Expand Up @@ -15179,6 +15175,12 @@ private void processNewMessages(ArrayList<MessageObject> arr) {

for (int a = 0; a < arr.size(); a++) {
MessageObject obj = arr.get(a);
if (obj.isOut()) {
Drawable wallpaper = Theme.getCachedWallpaperNonBlocking();
if (wallpaper instanceof MotionBackgroundDrawable) {
((MotionBackgroundDrawable) wallpaper).switchToNextPosition();
}
}
if (threadMessageId != 0 && threadMessageId != obj.getReplyTopMsgId() && threadMessageId != obj.getReplyMsgId()) {
continue;
}
Expand Down Expand Up @@ -15274,6 +15276,12 @@ private void processNewMessages(ArrayList<MessageObject> arr) {
if (obj.scheduled != (chatMode == MODE_SCHEDULED) || threadMessageId != 0 && threadMessageId != obj.getReplyTopMsgId() && threadMessageId != obj.getReplyMsgId()) {
continue;
}
if (obj.isOut()) {
Drawable wallpaper = Theme.getCachedWallpaperNonBlocking();
if (wallpaper instanceof MotionBackgroundDrawable) {
((MotionBackgroundDrawable) wallpaper).switchToNextPosition();
}
}
int placeToPaste = -1;
int messageId = obj.getId();
if (chatMode == MODE_SCHEDULED && messagesDict[0].indexOfKey(messageId) >= 0) {
Expand Down Expand Up @@ -15613,7 +15621,6 @@ private void processNewMessages(ArrayList<MessageObject> arr) {
AndroidUtilities.runOnUIThread(() -> scrollToMessageId(mid, 0, false, 0, true, 0));
}
}

}
}
if (!messages.isEmpty() && botUser != null && botUser.length() == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,7 @@ private void searchGlobal(long dialogId, long minDate, long maxDate, FiltersView
localTipDates.clear();
localTipChats.clear();
updateFiltersView(false, null, null, true);
return;
}
requestIndex++;
final int requestId = requestIndex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,21 +254,23 @@ protected void dispatchDraw(Canvas canvas) {
if (animateToFullscreen || showingInFullscreen) {
size += (AndroidUtilities.dp(10) + AndroidUtilities.dp(39) * parentContainer.progressToFullscreenMode);
} else {
size += AndroidUtilities.dp(10) * (1.0f - progressToFullscreen);
size += AndroidUtilities.dp(10) * (1.0f - parentContainer.progressToFullscreenMode);
}

int x = (getMeasuredWidth() - size) / 2;
float smallProgress;
float scrimProgress = (showingAsScrimView || animateToScrimView ? parentContainer.progressToScrimView : 0);

smallProgress = (showingAsScrimView || animateToScrimView) ? scrimProgress : progressToFullscreen;

int y = (int) ((getMeasuredHeight() - size) / 2 - AndroidUtilities.dp(11) - (AndroidUtilities.dp(17) + AndroidUtilities.dp(74) * progressToFullscreen) * smallProgress);
if (showingInFullscreen) {
smallProgress = progressToFullscreen;
} else {
smallProgress = animateToFullscreen ? parentContainer.progressToFullscreenMode : scrimProgress;
}
int y = (int) ((getMeasuredHeight() - size) / 2 - AndroidUtilities.dp(11) - (AndroidUtilities.dp(17) + AndroidUtilities.dp(74) * parentContainer.progressToFullscreenMode) * smallProgress);
castingScreenDrawable.setBounds(x, y, x + size, y + size);
castingScreenDrawable.draw(canvas);

if (parentContainer.progressToFullscreenMode > 0 || scrimProgress > 0) {
float alpha = Math.max(progressToFullscreen, scrimProgress) * smallProgress;
float alpha = Math.max(parentContainer.progressToFullscreenMode, scrimProgress) * smallProgress;
textPaint2.setAlpha((int) (255 * alpha));
if (animateToFullscreen || showingInFullscreen) {
stopSharingTextView.setAlpha(alpha * (1.0f - scrimProgress));
Expand All @@ -281,8 +283,8 @@ protected void dispatchDraw(Canvas canvas) {
}
stopSharingTextView.setTranslationY(y + size + AndroidUtilities.dp(72) + swipeToBackDy - currentClipVertical);
stopSharingTextView.setTranslationX((getMeasuredWidth() - stopSharingTextView.getMeasuredWidth()) / 2 - currentClipHorizontal);
if (progressToFullscreen < 1 && scrimProgress < 1) {
textPaint.setAlpha((int) (255 * (1.0 - Math.max(progressToFullscreen, scrimProgress))));
if (parentContainer.progressToFullscreenMode < 1 && scrimProgress < 1) {
textPaint.setAlpha((int) (255 * (1.0 - Math.max(parentContainer.progressToFullscreenMode, scrimProgress))));
canvas.save();
canvas.translate(x - AndroidUtilities.dp(400) / 2f + size / 2f, y + size + AndroidUtilities.dp(10));
staticLayout.draw(canvas);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,14 @@ public void requestFullscreen(ChatObject.VideoParticipant videoParticipant) {
if ((videoParticipant == null && fullscreenParticipant == null) || (videoParticipant != null && videoParticipant.equals(fullscreenParticipant))) {
return;
}
// if (videoParticipant != null && fullscreenParticipant != null && fullscreenTextureView != null) {
// if (!fullscreenTextureView.hasVideo && MessageObject.getPeerId(fullscreenParticipant.participant.peer) == MessageObject.getPeerId(videoParticipant.participant.peer)) {
// fullscreenTextureView.participant = videoParticipant;
// fullscreenParticipant = videoParticipant;
// fullscreenTextureView.updateAttachState(true);
// return;
// }
// }
int peerId = videoParticipant == null ? 0 : MessageObject.getPeerId(videoParticipant.participant.peer);
if (fullscreenTextureView != null) {
fullscreenTextureView.runDelayedAnimations();
Expand Down Expand Up @@ -939,6 +947,18 @@ public boolean onInterceptTouchEvent(MotionEvent ev) {

@Override
public boolean onTouchEvent(MotionEvent ev) {
if ((maybeSwipeToBackGesture || swipeToBackGesture) && (ev.getActionMasked() == MotionEvent.ACTION_UP || ev.getActionMasked() == MotionEvent.ACTION_CANCEL)) {
maybeSwipeToBackGesture = false;
if (swipeToBackGesture) {
if (ev.getActionMasked() == MotionEvent.ACTION_UP && Math.abs(swipeToBackDy) > AndroidUtilities.dp(120)) {
groupCallActivity.fullscreenFor(null);
} else {
animateSwipeToBack(false);
}
}
invalidate();
}

if (!inFullscreenMode || (!maybeSwipeToBackGesture && !swipeToBackGesture && !tapGesture && !canZoomGesture && !isInPinchToZoomTouchMode && !zoomStarted && ev.getActionMasked() != MotionEvent.ACTION_DOWN) || fullscreenTextureView == null) {
finishZoom();
return false;
Expand Down Expand Up @@ -1021,18 +1041,6 @@ public boolean onTouchEvent(MotionEvent ev) {
invalidate();
}

if ((maybeSwipeToBackGesture || swipeToBackGesture) && ev.getActionMasked() == MotionEvent.ACTION_UP || ev.getActionMasked() == MotionEvent.ACTION_CANCEL) {
maybeSwipeToBackGesture = false;
if (swipeToBackGesture) {
if (ev.getActionMasked() == MotionEvent.ACTION_UP && Math.abs(swipeToBackDy) > AndroidUtilities.dp(120)) {
groupCallActivity.fullscreenFor(null);
} else {
animateSwipeToBack(false);
}
}
invalidate();
}

if (!fullscreenTextureView.hasVideo || swipeToBackGesture) {
finishZoom();
return tapGesture || swipeToBackGesture || maybeSwipeToBackGesture;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public void run() {
});
visibleDialog.show();
containerView.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
if (delegate.needRemove()) {
if (delegate != null && delegate.needRemove()) {
BottomSheet.BottomSheetCell cell = visibleDialog.getItemViews().get(0);
cell.setTextColor(Theme.getColor(Theme.key_dialogTextRed));
cell.setIconColor(Theme.getColor(Theme.key_dialogRedIcon));
Expand Down
Loading

5 comments on commit dd2b001

@behnejad
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can u write an instruction for how to build this repo to have a telegram client with fewer restrictions.

@jelni
Copy link

@jelni jelni commented on dd2b001 Jun 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@behnejad just download the APK from https://telegram.org/android

@behnejad
Copy link

@behnejad behnejad commented on dd2b001 Jun 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i have a modified version of app based on this repo and it is has google play restrictions.

@vivabelarus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to build standalone apk instead of release.

@tnr-tanjimul
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How I can change themes?? I want to set my own themes

Please sign in to comment.