update to 9.2.2

This commit is contained in:
xaxtix 2022-12-09 11:34:00 +04:00
parent 03e899e4ec
commit 2c71f6c92b
7 changed files with 38 additions and 30 deletions

View File

@ -24,8 +24,8 @@ 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 NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29; public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29;
public static int BUILD_VERSION = 2962; public static int BUILD_VERSION = 2965;
public static String BUILD_VERSION_STRING = "9.2.1"; public static String BUILD_VERSION_STRING = "9.2.2";
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

@ -366,12 +366,12 @@ public class DialogsAdapter extends RecyclerListView.SelectionAdapter implements
hasHints = folderId == 0 && dialogsType == 0 && !isOnlySelect && !MessagesController.getInstance(currentAccount).hintDialogs.isEmpty(); hasHints = folderId == 0 && dialogsType == 0 && !isOnlySelect && !MessagesController.getInstance(currentAccount).hintDialogs.isEmpty();
} }
public void updateList(RecyclerListView recyclerListView) { public void updateList(RecyclerListView recyclerListView, boolean hasHiddenArchive) {
oldItems.clear(); oldItems.clear();
oldItems.addAll(itemInternals); oldItems.addAll(itemInternals);
updateItemList(); updateItemList();
if (recyclerListView != null && recyclerListView.getChildCount() > 0) { if (recyclerListView != null && recyclerListView.getChildCount() > 0 && recyclerListView.getLayoutManager() != null) {
LinearLayoutManager layoutManager = ((LinearLayoutManager) recyclerListView.getLayoutManager()); LinearLayoutManager layoutManager = ((LinearLayoutManager) recyclerListView.getLayoutManager());
View view = null; View view = null;
int position = -1; int position = -1;
@ -386,7 +386,12 @@ public class DialogsAdapter extends RecyclerListView.SelectionAdapter implements
} }
} }
if (view != null) { if (view != null) {
layoutManager.scrollToPositionWithOffset(position, view.getTop() - recyclerListView.getPaddingTop()); int offset = view.getTop() - recyclerListView.getPaddingTop();
if (hasHiddenArchive && position == 0 && view.getTop() - recyclerListView.getPaddingTop() < AndroidUtilities.dp(SharedConfig.useThreeLinesLayout ? 78 : 72)) {
position = 1;
offset = 0;
}
layoutManager.scrollToPositionWithOffset(position, offset);
} }
} }
@ -820,7 +825,7 @@ public class DialogsAdapter extends RecyclerListView.SelectionAdapter implements
toDialog.pinnedNum = oldNum; toDialog.pinnedNum = oldNum;
} }
Collections.swap(dialogs, fromIndex, toIndex); Collections.swap(dialogs, fromIndex, toIndex);
updateList(recyclerView); updateList(recyclerView, false);
} }
@Override @Override
public void notifyItemMoved(int fromPosition, int toPosition) { public void notifyItemMoved(int fromPosition, int toPosition) {

View File

@ -4044,8 +4044,8 @@ public class DialogCell extends BaseCell {
int x = countLeftLocal - AndroidUtilities.dp(5.5f); int x = countLeftLocal - AndroidUtilities.dp(5.5f);
rect.set(x, countTop, x + countWidth + AndroidUtilities.dp(11), countTop + AndroidUtilities.dp(23)); rect.set(x, countTop, x + countWidth + AndroidUtilities.dp(11), countTop + AndroidUtilities.dp(23));
int restoreToCount = canvas.save();
if (globalScale != 1f) { if (globalScale != 1f) {
canvas.save();
canvas.scale(globalScale, globalScale, rect.centerX(), rect.centerY()); canvas.scale(globalScale, globalScale, rect.centerX(), rect.centerY());
} }
if (progressFinal != 1f) { if (progressFinal != 1f) {
@ -4057,7 +4057,6 @@ public class DialogCell extends BaseCell {
Theme.dialogs_pinnedDrawable.draw(canvas); Theme.dialogs_pinnedDrawable.draw(canvas);
canvas.restore(); canvas.restore();
} }
canvas.save();
canvas.scale(progressFinal, progressFinal, rect.centerX(), rect.centerY()); canvas.scale(progressFinal, progressFinal, rect.centerX(), rect.centerY());
} }
@ -4072,12 +4071,7 @@ public class DialogCell extends BaseCell {
canvas.restore(); canvas.restore();
} }
if (progressFinal != 1f) { canvas.restoreToCount(restoreToCount);
canvas.restore();
}
if (globalScale != 1f) {
canvas.restore();
}
} else { } else {
paint.setAlpha((int) ((1.0f - reorderIconProgress) * fillPaintAlpha)); paint.setAlpha((int) ((1.0f - reorderIconProgress) * fillPaintAlpha));
Theme.dialogs_countTextPaint.setAlpha((int) ((1.0f - reorderIconProgress) * 255)); Theme.dialogs_countTextPaint.setAlpha((int) ((1.0f - reorderIconProgress) * 255));

View File

@ -14499,7 +14499,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
entry.reset(); entry.reset();
} }
fillEditingMediaWithCaption(photos.get(0).caption, photos.get(0).entities); fillEditingMediaWithCaption(photos.get(0).caption, photos.get(0).entities);
SendMessagesHelper.prepareSendingMedia(getAccountInstance(), photos, dialog_id, null, getThreadMessage(), null, forceDocument, true, null, notify, scheduleDate, photos.get(0).updateStickersOrder); SendMessagesHelper.prepareSendingMedia(getAccountInstance(), photos, dialog_id, replyingMessageObject, getThreadMessage(), null, forceDocument, true, null, notify, scheduleDate, photos.get(0).updateStickersOrder);
afterMessageSend(); afterMessageSend();
chatActivityEnterView.setFieldText(""); chatActivityEnterView.setFieldText("");
} }

View File

@ -246,7 +246,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
boolean updating; boolean updating;
Runnable updateListRunnable = () -> { Runnable updateListRunnable = () -> {
dialogsAdapter.updateList(listView); dialogsAdapter.updateList(listView, dialogsType == 0 && hasHiddenArchive());
listView.updateDialogsOnNextDraw = true; listView.updateDialogsOnNextDraw = true;
updating = false; updating = false;
}; };
@ -1664,7 +1664,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
if (parentPage.dialogsType == 0 && hasHiddenArchive()) { if (parentPage.dialogsType == 0 && hasHiddenArchive()) {
ignoreLayout = true; ignoreLayout = true;
LinearLayoutManager layoutManager = (LinearLayoutManager) getLayoutManager(); LinearLayoutManager layoutManager = (LinearLayoutManager) getLayoutManager();
layoutManager.scrollToPositionWithOffset(1, (int) actionBar.getTranslationY()); layoutManager.scrollToPositionWithOffset(1, 0);
ignoreLayout = false; ignoreLayout = false;
} }
firstLayout = false; firstLayout = false;
@ -1905,9 +1905,6 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
DialogsAdapter adapter = (DialogsAdapter) getAdapter(); DialogsAdapter adapter = (DialogsAdapter) getAdapter();
int p = adapter.findDialogPosition(anchorView.getDialogId()); int p = adapter.findDialogPosition(anchorView.getDialogId());
int offset = (int) (anchorView.getTop() - getPaddingTop()); int offset = (int) (anchorView.getTop() - getPaddingTop());
// if (!opened && offset > (getMeasuredHeight() - getPaddingTop()) / 2) {
// offset -= AndroidUtilities.dp(44);
// }
if (p >= 0) { if (p >= 0) {
((LinearLayoutManager) getLayoutManager()).scrollToPositionWithOffset(p, offset); ((LinearLayoutManager) getLayoutManager()).scrollToPositionWithOffset(p, offset);
} }
@ -1929,7 +1926,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
@Override @Override
public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) { public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
if (waitingForDialogsAnimationEnd(parentPage) || parentLayout != null && parentLayout.isInPreviewMode()) { if (waitingForDialogsAnimationEnd(parentPage) || parentLayout != null && parentLayout.isInPreviewMode() || rightSlidingDialogContainer.hasFragment()) {
return 0; return 0;
} }
if (swipingFolder && swipeFolderBack) { if (swipingFolder && swipeFolderBack) {
@ -4436,6 +4433,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
transitionPage.listView.setClipChildren(false); transitionPage.listView.setClipChildren(false);
actionBar.setAllowOverlayTitle(false); actionBar.setAllowOverlayTitle(false);
transitionPage.listView.stopScroll(); transitionPage.listView.stopScroll();
updateDrawerSwipeEnabled();
} }
@Override @Override
@ -4459,6 +4457,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
transitionPage.layoutManager.setNeedFixEndGap(!hasFragment()); transitionPage.layoutManager.setNeedFixEndGap(!hasFragment());
DialogsActivity.this.setScrollY(0); DialogsActivity.this.setScrollY(0);
searchViewPager.updateTabs(); searchViewPager.updateTabs();
updateDrawerSwipeEnabled();
} }
@Override @Override
@ -6250,7 +6249,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
if (!validateSlowModeDialog(dialogId)) { if (!validateSlowModeDialog(dialogId)) {
return; return;
} }
if (!selectedDialogs.isEmpty() || (initialDialogsType == 3 && selectAlertString != null)) { if (!getMessagesController().isForum(dialogId) && (!selectedDialogs.isEmpty() || (initialDialogsType == 3 && selectAlertString != null))) {
if (!selectedDialogs.contains(dialogId) && !checkCanWrite(dialogId)) { if (!selectedDialogs.contains(dialogId) && !checkCanWrite(dialogId)) {
return; return;
} }
@ -9161,19 +9160,27 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
if (chat == null) { if (chat == null) {
return; return;
} }
CharSequence chatTitle = chat.title;
if (topicId != 0) {
TLRPC.TL_forumTopic topic = getMessagesController().getTopicsController().findTopic(chat.id, topicId);
if (topic != null) {
chatTitle += " " + topic.title;
}
}
if (addToGroupAlertString != null) { if (addToGroupAlertString != null) {
title = LocaleController.getString("AddToTheGroupAlertTitle", R.string.AddToTheGroupAlertTitle); title = LocaleController.getString("AddToTheGroupAlertTitle", R.string.AddToTheGroupAlertTitle);
message = LocaleController.formatStringSimple(addToGroupAlertString, chat.title); message = LocaleController.formatStringSimple(addToGroupAlertString, chatTitle);
buttonText = LocaleController.getString("Add", R.string.Add); buttonText = LocaleController.getString("Add", R.string.Add);
} else { } else {
title = LocaleController.getString("SendMessageTitle", R.string.SendMessageTitle); title = LocaleController.getString("SendMessageTitle", R.string.SendMessageTitle);
message = LocaleController.formatStringSimple(selectAlertStringGroup, chat.title); message = LocaleController.formatStringSimple(selectAlertStringGroup, chatTitle);
buttonText = LocaleController.getString("Send", R.string.Send); buttonText = LocaleController.getString("Send", R.string.Send);
} }
} }
builder.setTitle(title); builder.setTitle(title);
builder.setMessage(AndroidUtilities.replaceTags(message)); builder.setMessage(AndroidUtilities.replaceTags(message));
builder.setPositiveButton(buttonText, (dialogInterface, i) -> didSelectResult(dialogId, 0,false, false)); builder.setPositiveButton(buttonText, (dialogInterface, i) -> didSelectResult(dialogId, topicId,false, false));
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
showDialog(builder.create()); showDialog(builder.create());
} else { } else {
@ -9877,17 +9884,17 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
} }
if (sliding) { if (sliding) {
if (viewPages != null && viewPages[0] != null) { if (viewPages != null && viewPages[0] != null) {
viewPages[0].setLayerType(View.LAYER_TYPE_HARDWARE, null); // viewPages[0].setLayerType(View.LAYER_TYPE_HARDWARE, null);
viewPages[0].setClipChildren(false); viewPages[0].setClipChildren(false);
viewPages[0].setClipToPadding(false); viewPages[0].setClipToPadding(false);
viewPages[0].listView.setClipChildren(false); viewPages[0].listView.setClipChildren(false);
} }
if (actionBar != null) { if (actionBar != null) {
actionBar.setLayerType(View.LAYER_TYPE_HARDWARE, null); // actionBar.setLayerType(View.LAYER_TYPE_HARDWARE, null);
} }
if (filterTabsView != null) { if (filterTabsView != null) {
filterTabsView.getListView().setLayerType(View.LAYER_TYPE_HARDWARE, null); // filterTabsView.getListView().setLayerType(View.LAYER_TYPE_HARDWARE, null);
} }
if (fragmentView != null) { if (fragmentView != null) {
((ViewGroup) fragmentView).setClipChildren(false); ((ViewGroup) fragmentView).setClipChildren(false);

View File

@ -4851,6 +4851,7 @@ public class LaunchActivity extends BasePermissionsActivity implements INavigati
final ChatActivity fragment; final ChatActivity fragment;
if (dids.size() <= 1) { if (dids.size() <= 1) {
final long did = dids.get(0).dialogId; final long did = dids.get(0).dialogId;
final int topicId = dids.get(0).topicId;
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putBoolean("scrollToTopOnResume", true); args.putBoolean("scrollToTopOnResume", true);
@ -4868,6 +4869,7 @@ public class LaunchActivity extends BasePermissionsActivity implements INavigati
return; return;
} }
fragment = new ChatActivity(args); fragment = new ChatActivity(args);
ForumUtilities.applyTopic(fragment, dids.get(0));
} else { } else {
fragment = null; fragment = null;
} }

View File

@ -13,8 +13,8 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true # org.gradle.parallel=true
#Sat Mar 12 05:53:50 MSK 2016 #Sat Mar 12 05:53:50 MSK 2016
APP_VERSION_NAME=9.2.1 APP_VERSION_NAME=9.2.2
APP_VERSION_CODE=2962 APP_VERSION_CODE=2965
APP_PACKAGE=org.telegram.messenger APP_PACKAGE=org.telegram.messenger
RELEASE_KEY_PASSWORD=TelegramAndroidPswd RELEASE_KEY_PASSWORD=TelegramAndroidPswd
RELEASE_KEY_ALIAS=tmessages RELEASE_KEY_ALIAS=tmessages