Update to 5.15.0 (1867)

This commit is contained in:
DrKLO 2020-02-14 05:26:25 +03:00
parent 071d511494
commit 08a8e007eb
13 changed files with 263 additions and 225 deletions

View file

@ -283,7 +283,7 @@ android {
}
}
defaultConfig.versionCode = 1866
defaultConfig.versionCode = 1867
applicationVariants.all { variant ->
variant.outputs.all { output ->

View file

@ -19,7 +19,7 @@ public class BuildVars {
public static boolean USE_CLOUD_STRINGS = true;
public static boolean CHECK_UPDATES = true;
public static boolean TON_WALLET_STANDALONE = false;
public static int BUILD_VERSION = 1866;
public static int BUILD_VERSION = 1867;
public static String BUILD_VERSION_STRING = "5.15.0";
public static int APP_ID = 4;
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";

View file

@ -7421,7 +7421,7 @@ public class Theme {
File wallpaperFile;
boolean wallpaperMotion;
ThemeAccent accent = currentTheme.getAccent(false);
if (accent != null && previousTheme == null) {
if (accent != null && !hasPreviousTheme) {
wallpaperFile = accent.getPathToWallpaper();
wallpaperMotion = accent.patternMotion;
} else {

View file

@ -3632,10 +3632,8 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
drawName = true;
drawForwardedName = true;
drawPhotoImage = false;
int maxWidth = availableTimeWidth = Math.min(AndroidUtilities.dp(500), messageObject.getMaxMessageTextWidth());
int maxWidth = Math.min(AndroidUtilities.dp(500), messageObject.getMaxMessageTextWidth());
backgroundWidth = maxWidth + AndroidUtilities.dp(31);
availableTimeWidth = AndroidUtilities.dp(120);
measureTime(messageObject);
TLRPC.TL_messageMediaPoll media = (TLRPC.TL_messageMediaPoll) messageObject.messageOwner.media;
@ -3680,7 +3678,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
docTitleOffsetX = 0;
}
}
int w = maxWidth - timeWidth - AndroidUtilities.dp(messageObject.isOutOwner() ? 28 : 8);
int w = maxWidth - AndroidUtilities.dp(messageObject.isOutOwner() ? 28 : 8);
TextPaint textPaint = !media.poll.public_voters && !media.poll.multiple_choice ? Theme.chat_livePaint : Theme.chat_locationAddressPaint;
CharSequence votes;
@ -3693,10 +3691,13 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
if (infoLayout != null) {
if (!media.poll.public_voters && !media.poll.multiple_choice) {
infoX = (int) Math.ceil(infoLayout.getLineCount() > 0 ? -infoLayout.getLineLeft(0) : 0);
availableTimeWidth = (int) (maxWidth - infoLayout.getLineWidth(0) - AndroidUtilities.dp(16));
} else {
infoX = (int) ((backgroundWidth - AndroidUtilities.dp(28) - Math.ceil(infoLayout.getLineWidth(0))) / 2 - infoLayout.getLineLeft(0));
availableTimeWidth = maxWidth;
}
}
measureTime(messageObject);
lastPoll = media.poll;
lastPollResults = media.results.results;
@ -3958,9 +3959,11 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
backgroundWidth = maxTextWidth;
maxWidth = maxTextWidth - AndroidUtilities.dp(31);
}
availableTimeWidth = maxWidth;
if (drawPhotoImage) {
photoWidth = AndroidUtilities.dp(86);
photoHeight = AndroidUtilities.dp(86);
availableTimeWidth -= photoWidth;
} else {
photoWidth = AndroidUtilities.dp(56);
photoHeight = AndroidUtilities.dp(56);
@ -3968,7 +3971,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
photoHeight += (docTitleLayout.getLineCount() - 1) * AndroidUtilities.dp(16);
}
}
availableTimeWidth = maxWidth;
if (!drawPhotoImage && TextUtils.isEmpty(messageObject.caption) && infoLayout != null) {
int lineCount = infoLayout.getLineCount();
measureTime(messageObject);
@ -7784,8 +7787,12 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
viewsTextWidth = (int) Math.ceil(Theme.chat_timePaint.measureText(currentViewsString));
timeWidth += viewsTextWidth + Theme.chat_msgInViewsDrawable.getIntrinsicWidth() + AndroidUtilities.dp(10);
}
if (messageObject.scheduled && messageObject.isSendError()) {
timeWidth += AndroidUtilities.dp(18);
if (messageObject.scheduled) {
if (messageObject.isSendError()) {
timeWidth += AndroidUtilities.dp(18);
} else if (messageObject.isSending() && messageObject.messageOwner.to_id.channel_id != 0 && !messageObject.isMegagroup()) {
timeWidth += AndroidUtilities.dp(18);
}
}
if (signString != null) {
if (availableTimeWidth == 0) {

View file

@ -406,7 +406,6 @@ public class AdminLogFilterAlert extends BottomSheet {
switch (viewType) {
case 0:
view = new CheckBoxCell(context, 1, 21);
view.setBackgroundDrawable(Theme.getSelectorDrawable(false));
break;
case 1:
ShadowSectionCell shadowSectionCell = new ShadowSectionCell(context, 18);

View file

@ -24,6 +24,7 @@ import org.telegram.messenger.LocaleController;
import org.telegram.messenger.MessagesController;
import org.telegram.messenger.NotificationCenter;
import org.telegram.messenger.R;
import org.telegram.messenger.SharedConfig;
import org.telegram.ui.ActionBar.AlertDialog;
import org.telegram.ui.ActionBar.BaseFragment;
import org.telegram.ui.ActionBar.Theme;
@ -104,7 +105,9 @@ public class EditTextEmoji extends FrameLayout implements NotificationCenter.Not
@Override
public boolean requestRectangleOnScreen(Rect rectangle) {
rectangle.bottom += AndroidUtilities.dp(1000);
if (SharedConfig.smoothKeyboard) {
rectangle.bottom += AndroidUtilities.dp(1000);
}
return super.requestRectangleOnScreen(rectangle);
}
};

View file

@ -34,6 +34,9 @@ public class GestureDetector2 {
boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY);
void onLongPress(MotionEvent e);
boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY);
default int getDoubleTapTimeout(MotionEvent e) {
return DOUBLE_TAP_TIMEOUT;
}
}
/**
@ -145,7 +148,7 @@ public class GestureDetector2 {
private static final int LONGPRESS_TIMEOUT = ViewConfiguration.getLongPressTimeout();
private static final int TAP_TIMEOUT = ViewConfiguration.getTapTimeout();
private static final int DOUBLE_TAP_TIMEOUT = 200;
public static final int DOUBLE_TAP_TIMEOUT = ViewConfiguration.getDoubleTapTimeout();
private static final int DOUBLE_TAP_MIN_TIME = 40;
private static final int SHOW_PRESS = 1;
@ -364,7 +367,7 @@ public class GestureDetector2 {
handled |= mDoubleTapListener.onDoubleTapEvent(ev);
} else {
// This is a first tap
mHandler.sendEmptyMessageDelayed(TAP, DOUBLE_TAP_TIMEOUT);
mHandler.sendEmptyMessageDelayed(TAP, mListener.getDoubleTapTimeout(ev));
}
}
@ -531,7 +534,7 @@ public class GestureDetector2 {
}
final long deltaTime = secondDown.getEventTime() - firstUp.getEventTime();
if (deltaTime > DOUBLE_TAP_TIMEOUT || deltaTime < DOUBLE_TAP_MIN_TIME) {
if (deltaTime > mListener.getDoubleTapTimeout(firstDown) || deltaTime < DOUBLE_TAP_MIN_TIME) {
return false;
}

View file

@ -1484,7 +1484,7 @@ public class SharedMediaLayout extends FrameLayout implements NotificationCenter
@Override
public boolean onTouchEvent(MotionEvent ev) {
if (!profileActivity.getParentLayout().checkTransitionAnimation() && !checkTabsAnimationInProgress()) {
if (profileActivity.getParentLayout() != null && !profileActivity.getParentLayout().checkTransitionAnimation() && !checkTabsAnimationInProgress()) {
if (ev != null && ev.getAction() == MotionEvent.ACTION_DOWN && !startedTracking && !maybeStartTracking && ev.getY() >= AndroidUtilities.dp(48)) {
startedTrackingPointerId = ev.getPointerId(0);
maybeStartTracking = true;

View file

@ -268,14 +268,16 @@ public class PeopleNearbyActivity extends BaseFragment implements NotificationCe
return;
}
if (position >= usersStartRow && position < usersEndRow) {
ManageChatUserCell cell = (ManageChatUserCell) view;
TLRPC.TL_peerLocated peerLocated = users.get(position - usersStartRow);
Bundle args1 = new Bundle();
args1.putInt("user_id", peerLocated.peer.user_id);
if (cell.hasAvatarSet()) {
args1.putBoolean("expandPhoto", true);
if (view instanceof ManageChatUserCell) {
ManageChatUserCell cell = (ManageChatUserCell) view;
TLRPC.TL_peerLocated peerLocated = users.get(position - usersStartRow);
Bundle args1 = new Bundle();
args1.putInt("user_id", peerLocated.peer.user_id);
if (cell.hasAvatarSet()) {
args1.putBoolean("expandPhoto", true);
}
presentFragment(new ProfileActivity(args1));
}
presentFragment(new ProfileActivity(args1));
} else if (position >= chatsStartRow && position < chatsEndRow) {
TLRPC.TL_peerLocated peerLocated = chats.get(position - chatsStartRow);
Bundle args1 = new Bundle();

View file

@ -8804,7 +8804,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
@Override
public boolean onDown(MotionEvent e) {
if (checkImageView.getVisibility() != View.VISIBLE && !drawPressedDrawable[0] && !drawPressedDrawable[1]) {
if (!doubleTap && checkImageView.getVisibility() != View.VISIBLE && !drawPressedDrawable[0] && !drawPressedDrawable[1]) {
float x = e.getX();
int side = containerView.getMeasuredWidth() / 5;
if (x < side) {
@ -8822,6 +8822,18 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
return false;
}
@Override
public int getDoubleTapTimeout(MotionEvent e) {
if (checkImageView.getVisibility() != View.VISIBLE && !drawPressedDrawable[0] && !drawPressedDrawable[1]) {
float x = e.getX();
int side = containerView.getMeasuredWidth() / 5;
if (x < side || x > containerView.getMeasuredWidth() - side) {
return 200;
}
}
return GestureDetector2.DOUBLE_TAP_TIMEOUT;
}
private void hidePressedDrawables() {
drawPressedDrawable[0] = drawPressedDrawable[1] = false;
containerView.invalidate();
@ -8989,6 +9001,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
animateTo(1.0f, 0, 0, true);
}
doubleTap = true;
hidePressedDrawables();
return true;
}

View file

@ -895,6 +895,9 @@ public class PollCreateActivity extends BaseFragment {
String from = answers[idx1];
answers[idx1] = answers[idx2];
answers[idx2] = from;
boolean temp = answersChecks[idx1];
answersChecks[idx1] = answersChecks[idx2];
answersChecks[idx2] = temp;
notifyItemMoved(fromIndex, toIndex);
}
}

View file

@ -1849,12 +1849,14 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
openingAvatar = true;
allowPullingDown = true;
View child = listView.getChildAt(0);
RecyclerView.ViewHolder holder = listView.findContainingViewHolder(child);
if (holder != null) {
Integer offset = positionToOffset.get(holder.getAdapterPosition());
if (offset != null) {
listView.smoothScrollBy(0, -(offset + (listView.getPaddingTop() - child.getTop() - actionBar.getMeasuredHeight())), CubicBezierInterpolator.EASE_OUT_QUINT);
return;
if (child != null) {
RecyclerView.ViewHolder holder = listView.findContainingViewHolder(child);
if (holder != null) {
Integer offset = positionToOffset.get(holder.getAdapterPosition());
if (offset != null) {
listView.smoothScrollBy(0, -(offset + (listView.getPaddingTop() - child.getTop() - actionBar.getMeasuredHeight())), CubicBezierInterpolator.EASE_OUT_QUINT);
return;
}
}
}
}
@ -3142,7 +3144,11 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
}
updateRowsIds();
if (listAdapter != null) {
listAdapter.notifyDataSetChanged();
try {
listAdapter.notifyDataSetChanged();
} catch (Exception e) {
FileLog.e(e);
}
}
sharedMediaLayout.setCommonGroupsCount(userInfo.common_chats_count);
updateSelectedMediaTabText();
@ -4069,6 +4075,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
}
private void createActionBarMenu() {
if (actionBar == null || otherItem == null) {
return;
}
ActionBarMenu menu = actionBar.createMenu();
otherItem.removeAllSubItems();
animatingItem = null;