Skip to content

Commit

Permalink
Update to 7.1.0 (2092)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrKLO committed Sep 30, 2020
1 parent 1139e12 commit 2eeca37
Show file tree
Hide file tree
Showing 21 changed files with 185 additions and 114 deletions.
2 changes: 1 addition & 1 deletion TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ android {
}
}

defaultConfig.versionCode = 2090
defaultConfig.versionCode = 2092

applicationVariants.all { variant ->
variant.outputs.all { output ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public static CharSequence ellipsizeCenterEnd(CharSequence str, String query, in
x = staticLayout.getPrimaryHorizontal(startHighlightedIndex + 1) - availableWidth * 0.3f;
sub = str.subSequence(staticLayout.getOffsetForHorizontal(0, x), str.length());
} else {
if (Character.isWhitespace(str.charAt(charOf))) {
if (charOf > 0 && charOf < str.length() - 1 && Character.isWhitespace(str.charAt(charOf))) {
charOf--;
}
sub = str.subSequence(charOf, str.length());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class BuildVars {
public static boolean LOGS_ENABLED = false;
public static boolean USE_CLOUD_STRINGS = true;
public static boolean CHECK_UPDATES = true;
public static int BUILD_VERSION = 2090;
public static int BUILD_VERSION = 2092;
public static String BUILD_VERSION_STRING = "7.1.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 @@ -1951,7 +1951,7 @@ public void loadMoreMusic() {
loadingPlaylist = true;
ConnectionsManager.getInstance(currentAccount).sendRequest(request, (response, error) -> {
AndroidUtilities.runOnUIThread(() -> {
if (playlistClassGuid != finalPlaylistGuid || playlistGlobalSearchParams == null) {
if (playlistClassGuid != finalPlaylistGuid || playlistGlobalSearchParams == null || playingMessageObject == null) {
return;
}
if (error != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5580,10 +5580,10 @@ public void setQuery(String query) {
if (startIndex < 0) {
continue;
}
int l = Math.max(currentQuery.length(), word.length());
if (startIndex != 0) {
word = word.substring(startIndex);
}
int l = Math.max(currentQuery.length(), word.length());
int min = Math.min(currentQuery.length(), word.length());
int count = 0;
for (int j = 0; j < min; j++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10771,7 +10771,7 @@ public TLRPC.EncryptedChat getEncryptedChat(final int chat_id) {
}


public void localSearch(int dialogsType, String query, ArrayList<TLObject> resultArray, ArrayList<CharSequence> resultArrayNames, ArrayList<TLRPC.User> encUsers) {
public void localSearch(int dialogsType, String query, ArrayList<TLObject> resultArray, ArrayList<CharSequence> resultArrayNames, ArrayList<TLRPC.User> encUsers, int folderId) {
int selfUserId = UserConfig.getInstance(currentAccount).getClientUserId();
try {
String savedMessages = LocaleController.getString("SavedMessages", R.string.SavedMessages).toLowerCase();
Expand All @@ -10792,7 +10792,12 @@ public void localSearch(int dialogsType, String query, ArrayList<TLObject> resul
int resultCount = 0;

LongSparseArray<DialogsSearchAdapter.DialogSearchResult> dialogsResult = new LongSparseArray<>();
SQLiteCursor cursor = getDatabase().queryFinalized("SELECT did, date FROM dialogs ORDER BY date DESC LIMIT 600");
SQLiteCursor cursor = null;
if (folderId >= 0) {
cursor = getDatabase().queryFinalized("SELECT did, date FROM dialogs WHERE folder_id = ? ORDER BY date DESC LIMIT 600", folderId);
} else {
cursor = getDatabase().queryFinalized("SELECT did, date FROM dialogs ORDER BY date DESC LIMIT 600");
}
while (cursor.next()) {
long id = cursor.longValue(0);
DialogsSearchAdapter.DialogSearchResult dialogSearchResult = new DialogsSearchAdapter.DialogSearchResult();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1384,9 +1384,8 @@ private String getShortStringForMessage(MessageObject messageObject, String[] us
return messageObject.messageOwner.message;
}
if (fromId == 0) {
if (messageObject.isFromUser() || messageObject.getId() < 0) {
fromId = messageObject.getFromChatId();
} else {
fromId = messageObject.getFromChatId();
if (fromId == 0) {
fromId = -chat_id;
}
} else if (fromId == getUserConfig().getClientUserId()) {
Expand Down Expand Up @@ -1823,9 +1822,8 @@ private String getStringForMessage(MessageObject messageObject, boolean shortMes
}
int selfUsedId = getUserConfig().getClientUserId();
if (from_id == 0) {
if (messageObject.isFromUser() || messageObject.getId() < 0) {
from_id = messageObject.getFromChatId();
} else {
from_id = messageObject.getFromChatId();
if (from_id == 0) {
from_id = -chat_id;
}
} else if (from_id == selfUsedId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public boolean canOpenMenu() {
protected BaseFragment parentFragment;
public ActionBarMenuOnItemClick actionBarMenuOnItemClick;
private int titleColorToSet = 0;
private boolean ovelayTitleAnimation = true;
private boolean overlayTitleAnimation;
private boolean titleAnimationRunning;
private boolean fromBottom;

Expand Down Expand Up @@ -285,6 +285,7 @@ public void setSubtitle(CharSequence value) {
}
if (subtitleTextView != null) {
subtitleTextView.setVisibility(!TextUtils.isEmpty(value) && !isSearchFieldVisible ? VISIBLE : GONE);
subtitleTextView.setAlpha(1f);
subtitleTextView.setText(value);
}
}
Expand Down Expand Up @@ -317,6 +318,7 @@ public void setTitle(CharSequence value) {
titleTextView[0].setVisibility(value != null && !isSearchFieldVisible ? VISIBLE : INVISIBLE);
titleTextView[0].setText(value);
}
fromBottom = false;
}

public void setTitleColor(int color) {
Expand Down Expand Up @@ -779,7 +781,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (titleTextView[0] != null && titleTextView[0].getVisibility() != GONE || subtitleTextView != null && subtitleTextView.getVisibility() != GONE) {
int availableWidth = width - (menu != null ? menu.getMeasuredWidth() : 0) - AndroidUtilities.dp(16) - textLeft - titleRightMargin;

if (((fromBottom && i == 0) || (!fromBottom && i == 1)) && ovelayTitleAnimation && titleAnimationRunning) {
if (((fromBottom && i == 0) || (!fromBottom && i == 1)) && overlayTitleAnimation && titleAnimationRunning) {
titleTextView[i].setTextSize(!AndroidUtilities.isTablet() && getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ? 18 : 20);
} else {
if (titleTextView[0] != null && titleTextView[0].getVisibility() != GONE && subtitleTextView != null && subtitleTextView.getVisibility() != GONE) {
Expand Down Expand Up @@ -839,7 +841,7 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto
for (int i = 0; i < 2; i++) {
if (titleTextView[i] != null && titleTextView[i].getVisibility() != GONE) {
int textTop;
if (((fromBottom && i == 0) || (!fromBottom && i == 1)) && ovelayTitleAnimation && titleAnimationRunning) {
if (((fromBottom && i == 0) || (!fromBottom && i == 1)) && overlayTitleAnimation && titleAnimationRunning) {
textTop = (getCurrentActionBarHeight() - titleTextView[i].getTextHeight()) / 2;
} else {
if ((subtitleTextView != null && subtitleTextView.getVisibility() != GONE)) {
Expand Down Expand Up @@ -1107,12 +1109,11 @@ public static int getCurrentActionBarHeight() {
}

public void setTitleAnimated(CharSequence title, boolean fromBottom, long duration) {
if (titleTextView[0] == null) {
if (titleTextView[0] == null || title == null) {
setTitle(title);
return;
}
this.fromBottom = fromBottom;
boolean crossfade = ovelayTitleAnimation && !TextUtils.isEmpty(subtitleTextView.getText());
boolean crossfade = overlayTitleAnimation && !TextUtils.isEmpty(subtitleTextView.getText());
if (crossfade) {
if (subtitleTextView.getVisibility() != View.VISIBLE) {
subtitleTextView.setVisibility(View.VISIBLE);
Expand All @@ -1130,6 +1131,7 @@ public void setTitleAnimated(CharSequence title, boolean fromBottom, long durati
titleTextView[1] = titleTextView[0];
titleTextView[0] = null;
setTitle(title);
this.fromBottom = fromBottom;
titleTextView[0].setAlpha(0);
if (!crossfade) {
titleTextView[0].setTranslationY(fromBottom ? AndroidUtilities.dp(20) : -AndroidUtilities.dp(20));
Expand Down Expand Up @@ -1181,4 +1183,8 @@ protected void onDetachedFromWindow() {
public ActionBarMenu getActionMode() {
return actionMode;
}

public void setOverlayTitleAnimation(boolean ovelayTitleAnimation) {
this.overlayTitleAnimation = ovelayTitleAnimation;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ public boolean toggleSearch(boolean openKeyboard) {
return false;
} else {
searchContainer.setVisibility(VISIBLE);
searchContainer.setAlpha(1f);
setVisibility(GONE);
searchField.setText("");
searchField.requestFocus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ private void searchDialogsInternal(final String query, final int searchId) {
ArrayList<TLObject> resultArray = new ArrayList<>();
ArrayList<CharSequence> resultArrayNames = new ArrayList<>();
ArrayList<TLRPC.User> encUsers = new ArrayList<>();
MessagesStorage.getInstance(currentAccount).localSearch(dialogsType, q, resultArray, resultArrayNames, encUsers);
MessagesStorage.getInstance(currentAccount).localSearch(dialogsType, q, resultArray, resultArrayNames, encUsers, -1);
updateSearchResults(resultArray, resultArrayNames, encUsers, searchId);
FiltersView.fillTipDates(q, localTipDates);
AndroidUtilities.runOnUIThread(() -> {
Expand Down
Loading

0 comments on commit 2eeca37

Please sign in to comment.