Update to 5.14.0 (1850)

This commit is contained in:
DrKLO 2020-01-23 19:54:36 +03:00
parent c623952aa2
commit 049932d52c
6 changed files with 51 additions and 14 deletions

View file

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

View file

@ -19,7 +19,7 @@ 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 TON_WALLET_STANDALONE = false; public static boolean TON_WALLET_STANDALONE = false;
public static int BUILD_VERSION = 1849; public static int BUILD_VERSION = 1850;
public static String BUILD_VERSION_STRING = "5.14.0"; public static String BUILD_VERSION_STRING = "5.14.0";
public static int APP_ID = 4; public static int APP_ID = 4;
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103"; public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";

View file

@ -1789,25 +1789,43 @@ public class MessageObject {
return; return;
} }
if ((results.flags & 2) != 0) { if ((results.flags & 2) != 0) {
byte[] chosen = null; ArrayList<byte[]> chosen = null;
boolean correct = false; byte[] correct = null;
if (results.min && media.results.results != null) { if (results.min && media.results.results != null) {
for (int b = 0, N2 = media.results.results.size(); b < N2; b++) { for (int b = 0, N2 = media.results.results.size(); b < N2; b++) {
TLRPC.TL_pollAnswerVoters answerVoters = media.results.results.get(b); TLRPC.TL_pollAnswerVoters answerVoters = media.results.results.get(b);
if (answerVoters.chosen) { if (answerVoters.chosen) {
chosen = answerVoters.option; if (chosen == null) {
correct = answerVoters.correct; chosen = new ArrayList<>();
break; }
chosen.add(answerVoters.option);
}
if (answerVoters.correct) {
correct = answerVoters.option;
} }
} }
} }
media.results.results = results.results; media.results.results = results.results;
if (chosen != null) { if (chosen != null || correct != null) {
for (int b = 0, N2 = media.results.results.size(); b < N2; b++) { for (int b = 0, N2 = media.results.results.size(); b < N2; b++) {
TLRPC.TL_pollAnswerVoters answerVoters = media.results.results.get(b); TLRPC.TL_pollAnswerVoters answerVoters = media.results.results.get(b);
if (Arrays.equals(answerVoters.option, chosen)) { if (chosen != null) {
answerVoters.chosen = true; for (int a = 0, N = chosen.size(); a < N; a++) {
answerVoters.correct = correct; if (Arrays.equals(answerVoters.option, chosen.get(a))) {
answerVoters.chosen = true;
chosen.remove(a);
break;
}
}
if (chosen.isEmpty()) {
chosen = null;
}
}
if (correct != null && Arrays.equals(answerVoters.option, correct)) {
answerVoters.correct = true;
correct = null;
}
if (chosen == null && correct == null) {
break; break;
} }
} }

View file

@ -2304,6 +2304,11 @@ public class Theme {
public static final String key_chat_attachPermissionText = "chat_attachPermissionText"; public static final String key_chat_attachPermissionText = "chat_attachPermissionText";
public static final String key_chat_attachEmptyImage = "chat_attachEmptyImage"; public static final String key_chat_attachEmptyImage = "chat_attachEmptyImage";
public static final String key_chat_inPollCorrectAnswer = "chat_inPollCorrectAnswer";
public static final String key_chat_outPollCorrectAnswer = "chat_outPollCorrectAnswer";
public static final String key_chat_inPollWrongAnswer = "chat_inPollWrongAnswer";
public static final String key_chat_outPollWrongAnswer = "chat_outPollWrongAnswer";
public static final String key_chat_attachGalleryBackground = "chat_attachGalleryBackground"; public static final String key_chat_attachGalleryBackground = "chat_attachGalleryBackground";
public static final String key_chat_attachGalleryIcon = "chat_attachGalleryIcon"; public static final String key_chat_attachGalleryIcon = "chat_attachGalleryIcon";
public static final String key_chat_attachAudioBackground = "chat_attachAudioBackground"; public static final String key_chat_attachAudioBackground = "chat_attachAudioBackground";
@ -2993,6 +2998,10 @@ public class Theme {
defaultColors.put(key_chat_attachPollBackground, 0xfff2c04b); defaultColors.put(key_chat_attachPollBackground, 0xfff2c04b);
defaultColors.put(key_chat_attachPollIcon, 0xffffffff); defaultColors.put(key_chat_attachPollIcon, 0xffffffff);
defaultColors.put(key_chat_inPollCorrectAnswer, 0xff60c255);
defaultColors.put(key_chat_outPollCorrectAnswer, 0xff60c255);
defaultColors.put(key_chat_inPollWrongAnswer, 0xffeb6060);
defaultColors.put(key_chat_outPollWrongAnswer, 0xffeb6060);
defaultColors.put(key_chat_status, 0xffd5e8f7); defaultColors.put(key_chat_status, 0xffd5e8f7);
defaultColors.put(key_chat_inGreenCall, 0xff00c853); defaultColors.put(key_chat_inGreenCall, 0xff00c853);
@ -3503,6 +3512,10 @@ public class Theme {
fallbackKeys.put(key_chat_outTextSelectionHighlight, key_chat_textSelectBackground); fallbackKeys.put(key_chat_outTextSelectionHighlight, key_chat_textSelectBackground);
fallbackKeys.put(key_chat_inTextSelectionHighlight, key_chat_textSelectBackground); fallbackKeys.put(key_chat_inTextSelectionHighlight, key_chat_textSelectBackground);
fallbackKeys.put(key_chat_TextSelectionCursor, key_chat_messagePanelCursor); fallbackKeys.put(key_chat_TextSelectionCursor, key_chat_messagePanelCursor);
fallbackKeys.put(key_chat_inPollCorrectAnswer, key_chat_attachLocationBackground);
fallbackKeys.put(key_chat_outPollCorrectAnswer, key_chat_attachLocationBackground);
fallbackKeys.put(key_chat_inPollWrongAnswer, key_chat_attachAudioBackground);
fallbackKeys.put(key_chat_outPollWrongAnswer, key_chat_attachAudioBackground);
themeAccentExclusionKeys.addAll(Arrays.asList(keys_avatar_background)); themeAccentExclusionKeys.addAll(Arrays.asList(keys_avatar_background));
themeAccentExclusionKeys.addAll(Arrays.asList(keys_avatar_nameInMessage)); themeAccentExclusionKeys.addAll(Arrays.asList(keys_avatar_nameInMessage));

View file

@ -1836,7 +1836,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
return textSelectionHelper.onTouchEvent(event); return textSelectionHelper.onTouchEvent(event);
} else { } else {
event.offsetLocation(this.getLeft() - cell.getLeft(), this.getTop() - cell.getTop()); event.offsetLocation(this.getLeft() - cell.getLeft(), this.getTop() - cell.getTop());
return textSelectionHelper.onTouchEvent(event); boolean result = textSelectionHelper.onTouchEvent(event);
event.offsetLocation(-(this.getLeft() - cell.getLeft()), -(this.getTop() - cell.getTop()));
return result;
} }
} }
} }
@ -9566,9 +9568,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
if (pollVoted || pollClosed || animatePollAnswerAlpha) { if (pollVoted || pollClosed || animatePollAnswerAlpha) {
if (lastPoll.quiz && pollVoted && button.chosen && !currentBackgroundDrawable.hasGradient()) { if (lastPoll.quiz && pollVoted && button.chosen && !currentBackgroundDrawable.hasGradient()) {
if (button.correct) { if (button.correct) {
Theme.chat_docBackPaint.setColor(Theme.getColor(Theme.key_chat_attachLocationBackground)); Theme.chat_docBackPaint.setColor(Theme.getColor(currentMessageObject.isOutOwner() ? Theme.key_chat_outPollCorrectAnswer : Theme.key_chat_inPollCorrectAnswer));
} else { } else {
Theme.chat_docBackPaint.setColor(Theme.getColor(Theme.key_chat_attachAudioBackground)); Theme.chat_docBackPaint.setColor(Theme.getColor(currentMessageObject.isOutOwner() ? Theme.key_chat_outPollWrongAnswer : Theme.key_chat_inPollWrongAnswer));
} }
} else { } else {
Theme.chat_docBackPaint.setColor(Theme.getColor(currentMessageObject.isOutOwner() ? Theme.key_chat_outAudioSeekbarFill : Theme.key_chat_inAudioSeekbarFill)); Theme.chat_docBackPaint.setColor(Theme.getColor(currentMessageObject.isOutOwner() ? Theme.key_chat_outAudioSeekbarFill : Theme.key_chat_inAudioSeekbarFill));

View file

@ -16821,6 +16821,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
new ThemeDescription(chatListView, 0, new Class[]{ChatMessageCell.class}, null, new Drawable[]{Theme.chat_locationDrawable[0]}, null, Theme.key_chat_inLocationIcon), new ThemeDescription(chatListView, 0, new Class[]{ChatMessageCell.class}, null, new Drawable[]{Theme.chat_locationDrawable[0]}, null, Theme.key_chat_inLocationIcon),
new ThemeDescription(chatListView, 0, new Class[]{ChatMessageCell.class}, null, null, null, Theme.key_chat_outLocationBackground), new ThemeDescription(chatListView, 0, new Class[]{ChatMessageCell.class}, null, null, null, Theme.key_chat_outLocationBackground),
new ThemeDescription(chatListView, 0, new Class[]{ChatMessageCell.class}, null, new Drawable[]{Theme.chat_locationDrawable[1]}, null, Theme.key_chat_outLocationIcon), new ThemeDescription(chatListView, 0, new Class[]{ChatMessageCell.class}, null, new Drawable[]{Theme.chat_locationDrawable[1]}, null, Theme.key_chat_outLocationIcon),
new ThemeDescription(chatListView, 0, new Class[]{ChatMessageCell.class}, null, null, null, Theme.key_chat_inPollCorrectAnswer),
new ThemeDescription(chatListView, 0, new Class[]{ChatMessageCell.class}, null, null, null, Theme.key_chat_outPollCorrectAnswer),
new ThemeDescription(chatListView, 0, new Class[]{ChatMessageCell.class}, null, null, null, Theme.key_chat_inPollWrongAnswer),
new ThemeDescription(chatListView, 0, new Class[]{ChatMessageCell.class}, null, null, null, Theme.key_chat_outPollWrongAnswer),
new ThemeDescription(messagesSearchListView, 0, new Class[]{DialogCell.class}, null, new Drawable[]{Theme.avatar_savedDrawable}, null, Theme.key_avatar_text), new ThemeDescription(messagesSearchListView, 0, new Class[]{DialogCell.class}, null, new Drawable[]{Theme.avatar_savedDrawable}, null, Theme.key_avatar_text),
new ThemeDescription(messagesSearchListView, 0, new Class[]{DialogCell.class}, Theme.dialogs_countPaint, null, null, Theme.key_chats_unreadCounter), new ThemeDescription(messagesSearchListView, 0, new Class[]{DialogCell.class}, Theme.dialogs_countPaint, null, null, Theme.key_chats_unreadCounter),