feat: jump to the beginning

This commit is contained in:
luvletter2333 2021-05-05 23:13:13 +08:00
parent b47d649861
commit 1c6a86b164
No known key found for this signature in database
GPG Key ID: BFD68B892BECC1D8
2 changed files with 14 additions and 0 deletions

View File

@ -391,6 +391,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
private ImageView searchUserButton;
private ImageView searchUpButton;
private ImageView searchDownButton;
private ImageView searchGoToBeginningButton;
private SearchCounterView searchCountText;
private ChatActionCell floatingDateView;
private ChatActionCell infoTopView;
@ -7207,6 +7208,18 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
});
searchCalendarButton.setContentDescription(LocaleController.getString("JumpToDate", R.string.JumpToDate));
searchGoToBeginningButton = new ImageView(context);
searchGoToBeginningButton.setScaleType(ImageView.ScaleType.CENTER);
searchGoToBeginningButton.setImageResource(R.drawable.baseline_arrow_upward_24);
searchGoToBeginningButton.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_chat_searchPanelIcons), PorterDuff.Mode.SRC_IN));
searchGoToBeginningButton.setBackgroundDrawable(Theme.createSelectorDrawable(Theme.getColor(Theme.key_actionBarActionModeDefaultSelector), 1));
boolean showSearchUserButton = currentChat != null && (!ChatObject.isChannel(currentChat) || currentChat.megagroup);
searchContainer.addView(searchGoToBeginningButton, LayoutHelper.createFrame(48, 48, Gravity.LEFT | Gravity.TOP, showSearchUserButton ? 48 * 2 : 48, 0, 0, 0));
searchGoToBeginningButton.setOnClickListener(view -> {
scrollToMessageId(1, 0, false, 0, true, 0);
});
searchGoToBeginningButton.setContentDescription(LocaleController.getString("GoToBeginning", R.string.GoToBeginning));
searchCountText = new SearchCounterView(context);
// searchCountText.setTextColor(Theme.getColor(Theme.key_chat_searchPanelText));
// searchCountText.setTextSize(15);

View File

@ -4409,4 +4409,5 @@
<string name="YourNameChanged">Name updated.</string>
<string name="ChannelTitleChanged">Channel title updated.</string>
<string name="ChannelDescriptionChanged">Channel description updated.</string>
<string name="GoToBeginning">Go to Beginning</string>
</resources>