Skip to the latest message when double tap under Tablet mode (#749) (#798)

This commit is contained in:
NatsumeMio 2022-03-29 15:34:28 +08:00 committed by NextAlone
parent 60a96d9378
commit 744fbdec66
No known key found for this signature in database
GPG Key ID: DBA7B0AEF8C1CD2C
2 changed files with 13 additions and 1 deletions

View File

@ -12493,7 +12493,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
}
private void scrollToLastMessage(boolean skipSponsored) {
public void scrollToLastMessage(boolean skipSponsored) {
if (chatListView.isFastScrollAnimationRunning()) {
return;
}

View File

@ -110,6 +110,7 @@ import org.telegram.tgnet.ConnectionsManager;
import org.telegram.tgnet.TLObject;
import org.telegram.tgnet.TLRPC;
import org.telegram.ui.ActionBar.ActionBar;
import org.telegram.ui.ActionBar.ActionBarLayout;
import org.telegram.ui.ActionBar.ActionBarMenu;
import org.telegram.ui.ActionBar.ActionBarMenuItem;
import org.telegram.ui.ActionBar.ActionBarMenuSubItem;
@ -5100,6 +5101,17 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
args.putInt("dialog_filter_id", filterId);
if (AndroidUtilities.isTablet()) {
if (openedDialogId == dialogId && adapter != searchViewPager.dialogsSearchAdapter) {
if (getParentActivity() instanceof LaunchActivity) {
ActionBarLayout rightActionBarLayout = ((LaunchActivity) getParentActivity()).getRightActionBarLayout();
if (rightActionBarLayout != null && rightActionBarLayout.fragmentsStack.size() > 0) {
BaseFragment baseFragment = rightActionBarLayout.fragmentsStack.get(rightActionBarLayout.fragmentsStack.size() - 1);
if (baseFragment instanceof ChatActivity) {
ChatActivity chatActivity = (ChatActivity) baseFragment;
if (chatActivity != null && chatActivity.getDialogId() == openedDialogId)
chatActivity.scrollToLastMessage(false);
}
}
}
return;
}
if (viewPages != null) {