Merge branch 'master' of github.com:DrKLO/Telegram

This commit is contained in:
NekoInverter 2020-01-28 14:22:20 +08:00
commit bc9865f2f1
6 changed files with 58 additions and 15 deletions

View File

@ -290,7 +290,7 @@ android {
}
}
defaultConfig.versionCode = 10 * 1849
defaultConfig.versionCode = 10 * 1851
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 = 1849;
public static int BUILD_VERSION = 1851;
public static String BUILD_VERSION_STRING = "5.14.0";
public static int APP_ID = 336779; //obtain your own APP_ID at https://core.telegram.org/api/obtaining_api_id
public static String APP_HASH = "b91eefacc86747c068c8d8a16b41500d"; //obtain your own APP_HASH at https://core.telegram.org/api/obtaining_api_id

View File

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

View File

@ -2306,6 +2306,11 @@ public class Theme {
public static final String key_chat_attachPermissionText = "chat_attachPermissionText";
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_attachGalleryIcon = "chat_attachGalleryIcon";
public static final String key_chat_attachAudioBackground = "chat_attachAudioBackground";
@ -2995,6 +3000,10 @@ public class Theme {
defaultColors.put(key_chat_attachPollBackground, 0xfff2c04b);
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_inGreenCall, 0xff00c853);
@ -3505,6 +3514,10 @@ public class Theme {
fallbackKeys.put(key_chat_outTextSelectionHighlight, key_chat_textSelectBackground);
fallbackKeys.put(key_chat_inTextSelectionHighlight, key_chat_textSelectBackground);
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_nameInMessage));

View File

@ -1843,7 +1843,9 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
return textSelectionHelper.onTouchEvent(event);
} else {
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;
}
}
}
@ -9568,11 +9570,17 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
button.title.draw(canvas);
int alpha = (int) (animatePollAnswerAlpha ? 255 * Math.min((pollUnvoteInProgress ? 1.0f - pollAnimationProgress : pollAnimationProgress) / 0.3f, 1.0f) : 255);
if (pollVoted || pollClosed || animatePollAnswerAlpha) {
if (lastPoll.quiz && pollVoted && button.chosen && !currentBackgroundDrawable.hasGradient()) {
if (lastPoll.quiz && pollVoted && button.chosen) {
String key;
if (button.correct) {
Theme.chat_docBackPaint.setColor(Theme.getColor(Theme.key_chat_attachLocationBackground));
key = currentMessageObject.isOutOwner() ? Theme.key_chat_outPollCorrectAnswer : Theme.key_chat_inPollCorrectAnswer;
} else {
Theme.chat_docBackPaint.setColor(Theme.getColor(Theme.key_chat_attachAudioBackground));
key = currentMessageObject.isOutOwner() ? Theme.key_chat_outPollWrongAnswer : Theme.key_chat_inPollWrongAnswer;
}
if (!currentBackgroundDrawable.hasGradient() || Theme.hasThemeKey(key)) {
Theme.chat_docBackPaint.setColor(Theme.getColor(key));
} else {
Theme.chat_docBackPaint.setColor(Theme.getColor(currentMessageObject.isOutOwner() ? Theme.key_chat_outAudioSeekbarFill : Theme.key_chat_inAudioSeekbarFill));
}
} else {
Theme.chat_docBackPaint.setColor(Theme.getColor(currentMessageObject.isOutOwner() ? Theme.key_chat_outAudioSeekbarFill : Theme.key_chat_inAudioSeekbarFill));

View File

@ -17165,6 +17165,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, 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, 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}, Theme.dialogs_countPaint, null, null, Theme.key_chats_unreadCounter),