Skip to content

Commit

Permalink
Update to 6.2.0 (1988)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrKLO committed Jun 6, 2020
1 parent f424ea1 commit feba57c
Show file tree
Hide file tree
Showing 20 changed files with 263 additions and 98 deletions.
2 changes: 1 addition & 1 deletion TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ android {
}
}

defaultConfig.versionCode = 1986
defaultConfig.versionCode = 1988

def tgVoipDexFileName = "libtgvoip.dex"
def tgVoipDexClasses = ["AudioRecordJNI", "AudioTrackJNI", "NativeTgVoipDelegate", "NativeTgVoipInstance", "TgVoipNativeLoader", "Resampler", "VLog"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,16 @@ private void setAdapterInternal(@Nullable Adapter adapter, boolean compatibleWit
mState.mStructureChanged = true;
}

public void prepareForFastScroll() {
stopScroll();
removeAndRecycleViews();
mAdapterHelper.reset();
mRecycler.onAdapterChanged(mAdapter, mAdapter, false);
mState.mStructureChanged = true;
mChildHelper.removeAllViewsUnfiltered();
mRecycler.updateViewCacheSize();
}

/**
* Retrieves the previously set adapter or null if no adapter is set.
*
Expand Down Expand Up @@ -1562,7 +1572,7 @@ void setScrollState(int state) {
if (state == mScrollState) {
return;
}
if (DEBUG) {
if (false) {
Log.d(TAG, "setting scroll state to " + state + " from " + mScrollState,
new Exception());
}
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 TON_WALLET_STANDALONE = false;
public static int BUILD_VERSION = 1986;
public static int BUILD_VERSION = 1988;
public static String BUILD_VERSION_STRING = "6.2.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 @@ -257,8 +257,22 @@ public void requestReference(Object parentObject, Object... args) {
return;
}

String cacheKey = locationKey;
if (parentObject instanceof String) {
String string = (String) parentObject;
if ("wallpaper".equals(string)) {
cacheKey = "wallpaper";
} else if (string.startsWith("gif")) {
cacheKey = "gif";
} else if ("recent".equals(string)) {
cacheKey = "recent";
} else if ("fav".equals(string)) {
cacheKey = "fav";
}
}

cleanupCache();
CachedResult cachedResult = getCachedResponse(locationKey);
CachedResult cachedResult = getCachedResponse(cacheKey);
if (cachedResult != null) {
if (!onRequestComplete(locationKey, parentKey, cachedResult.response, false)) {
responseCache.remove(locationKey);
Expand Down Expand Up @@ -575,6 +589,16 @@ private void sendErrorToObject(Object[] args, int reason) {

private boolean onRequestComplete(String locationKey, String parentKey, TLObject response, boolean cache) {
boolean found = false;
String cacheKey = parentKey;
if (response instanceof TLRPC.TL_account_wallPapers) {
cacheKey = "wallpaper";
} else if (response instanceof TLRPC.TL_messages_savedGifs) {
cacheKey = "gif";
} else if (response instanceof TLRPC.TL_messages_recentStickers) {
cacheKey = "recent";
} else if (response instanceof TLRPC.TL_messages_favedStickers) {
cacheKey = "fav";
}
if (parentKey != null) {
ArrayList<Requester> arrayList = parentRequester.get(parentKey);
if (arrayList != null) {
Expand All @@ -588,7 +612,7 @@ private boolean onRequestComplete(String locationKey, String parentKey, TLObject
}
}
if (found) {
putReponseToCache(parentKey, response);
putReponseToCache(cacheKey, response);
}
parentRequester.remove(parentKey);
}
Expand All @@ -600,6 +624,7 @@ private boolean onRequestComplete(String locationKey, String parentKey, TLObject
if (arrayList == null) {
return found;
}
cacheKey = locationKey;
for (int q = 0, N = arrayList.size(); q < N; q++) {
Requester requester = arrayList.get(q);
if (requester.completed) {
Expand Down Expand Up @@ -793,7 +818,7 @@ private boolean onRequestComplete(String locationKey, String parentKey, TLObject
}
locationRequester.remove(locationKey);
if (found) {
putReponseToCache(locationKey, response);
putReponseToCache(cacheKey, response);
}
return found;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ public MediaDataController(int num) {
public static final int TYPE_FEATURED = 3;
public static final int TYPE_EMOJI = 4;

private ArrayList<TLRPC.TL_messages_stickerSet>[] stickerSets = new ArrayList[]{new ArrayList<>(), new ArrayList<>(), new ArrayList(0), new ArrayList(), new ArrayList()};
private LongSparseArray<TLRPC.Document>[] stickersByIds = new LongSparseArray[]{new LongSparseArray<>(), new LongSparseArray<>(), new LongSparseArray(), new LongSparseArray(), new LongSparseArray()};
private ArrayList<TLRPC.TL_messages_stickerSet>[] stickerSets = new ArrayList[]{new ArrayList<>(), new ArrayList<>(), new ArrayList<>(0), new ArrayList<>(), new ArrayList<>()};
private LongSparseArray<TLRPC.Document>[] stickersByIds = new LongSparseArray[]{new LongSparseArray<>(), new LongSparseArray<>(), new LongSparseArray<>(), new LongSparseArray<>(), new LongSparseArray<>()};
private LongSparseArray<TLRPC.TL_messages_stickerSet> stickerSetsById = new LongSparseArray<>();
private LongSparseArray<TLRPC.TL_messages_stickerSet> installedStickerSetsById = new LongSparseArray<>();
private LongSparseArray<TLRPC.TL_messages_stickerSet> groupStickerSets = new LongSparseArray<>();
Expand Down Expand Up @@ -681,7 +681,7 @@ public String getEmojiForSticker(long id) {
return value != null ? value : "";
}

private static int calcDocumentsHash(ArrayList<TLRPC.Document> arrayList) {
public static int calcDocumentsHash(ArrayList<TLRPC.Document> arrayList) {
if (arrayList == null) {
return 0;
}
Expand Down Expand Up @@ -5071,7 +5071,7 @@ public void getEmojiSuggestions(String[] langCodes, String keyword, boolean full
}
ArrayList<String> recentEmoji = new ArrayList<>(Emoji.recentEmoji);
getMessagesStorage().getStorageQueue().postRunnable(() -> {
ArrayList<KeywordResult> result = new ArrayList();
ArrayList<KeywordResult> result = new ArrayList<>();
HashMap<String, Boolean> resultMap = new HashMap<>();
String alias = null;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9220,7 +9220,7 @@ public boolean pinDialog(long did, boolean pin, TLRPC.InputPeer peer, long taskI
dialog.pinnedNum = 0;
}
sortDialogs(null);
if (!pin && dialogs.get(dialogs.size() - 1) == dialog && !dialogsEndReached.get(folderId)) {
if (!pin && !dialogs.isEmpty() && dialogs.get(dialogs.size() - 1) == dialog && !dialogsEndReached.get(folderId)) {
dialogs.remove(dialogs.size() - 1);
}
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ public void postNotificationNameInternal(int id, boolean allowDuringAnimation, O
ArrayList<NotificationCenterDelegate> objects = observers.get(id);
if (objects != null && !objects.isEmpty()) {
for (int a = 0; a < objects.size(); a++) {
NotificationCenterDelegate obj = objects.get(a);;
NotificationCenterDelegate obj = objects.get(a);
obj.didReceivedNotification(id, currentAccount, args);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,10 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
}
inLayout = false;
} else {
AndroidUtilities.displaySize.y = heightSize - AndroidUtilities.statusBarHeight;
int newSize = heightSize - AndroidUtilities.statusBarHeight;
if (newSize > 0 && newSize < 4096) {
AndroidUtilities.displaySize.y = newSize;
}
}

final boolean applyInsets = lastInsets != null && Build.VERSION.SDK_INT >= 21;
Expand Down
Loading

0 comments on commit feba57c

Please sign in to comment.