mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-22 22:45:18 +01:00
Hide emoji popup by pressing text message area, fixed that some links were untouchable
https://github.com/DrKLO/Telegram/pull/272 https://github.com/DrKLO/Telegram/issues/392
This commit is contained in:
parent
5ebe60a00d
commit
0065ca64f5
2 changed files with 10 additions and 1 deletions
|
@ -40,8 +40,8 @@ public class ChatMessageCell extends ChatBaseCell {
|
||||||
int x = (int)event.getX();
|
int x = (int)event.getX();
|
||||||
int y = (int)event.getY();
|
int y = (int)event.getY();
|
||||||
if (x >= textX && y >= textY && x <= textX + currentMessageObject.textWidth && y <= textY + currentMessageObject.textHeight) {
|
if (x >= textX && y >= textY && x <= textX + currentMessageObject.textWidth && y <= textY + currentMessageObject.textHeight) {
|
||||||
y -= textY;
|
|
||||||
int blockNum = Math.max(0, y / currentMessageObject.blockHeight);
|
int blockNum = Math.max(0, y / currentMessageObject.blockHeight);
|
||||||
|
y -= textY;
|
||||||
if (blockNum < currentMessageObject.textLayoutBlocks.size()) {
|
if (blockNum < currentMessageObject.textLayoutBlocks.size()) {
|
||||||
MessageObject.TextLayoutBlock block = currentMessageObject.textLayoutBlocks.get(blockNum);
|
MessageObject.TextLayoutBlock block = currentMessageObject.textLayoutBlocks.get(blockNum);
|
||||||
x -= textX - (int)Math.ceil(block.textXOffset);
|
x -= textX - (int)Math.ceil(block.textXOffset);
|
||||||
|
|
|
@ -753,6 +753,15 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
messsageEditText.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
if (emojiPopup != null && emojiPopup.isShowing()) {
|
||||||
|
showEmojiPopup(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
messsageEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
messsageEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
|
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
|
||||||
|
|
Loading…
Reference in a new issue