クラッシュレポート対応

This commit is contained in:
tateisu 2019-03-14 15:55:01 +09:00
parent 150381be7a
commit 7436c82819
1 changed files with 9 additions and 6 deletions

View File

@ -138,7 +138,7 @@ internal class PopupAutoCompleteAcct(
if(acct[0] == ' ') { if(acct[0] == ' ') {
// 絵文字ショートコード // 絵文字ショートコード
if(! EmojiDecoder.canStartShortCode(sb, start)) sb.append(' ') if(! EmojiDecoder.canStartShortCode(sb, start)) sb.append(' ')
sb.append( findShortCode(acct.toString())) sb.append(findShortCode(acct.toString()))
} else { } else {
// @user@host, #hashtag // @user@host, #hashtag
// 直後に空白を付与する // 直後に空白を付与する
@ -162,8 +162,6 @@ internal class PopupAutoCompleteAcct(
updatePosition() updatePosition()
} }
private fun findShortCode(acct : String) : String { private fun findShortCode(acct : String) : String {
val m = reLastShortCode.matcher(acct) val m = reLastShortCode.matcher(acct)
if(m.find()) return m.group(0) if(m.find()) return m.group(0)
@ -195,9 +193,14 @@ internal class PopupAutoCompleteAcct(
val layout = etContent.layout val layout = etContent.layout
popup_top = (text_top popup_top = try {
(text_top
+ etContent.totalPaddingTop + etContent.totalPaddingTop
+ layout.getLineBottom(layout.lineCount - 1)) - etContent.scrollY + layout.getLineBottom(layout.lineCount - 1)) - etContent.scrollY
} catch(ex : Throwable) {
// java.lang.IllegalStateException
0
}
if(popup_top < form_top) popup_top = form_top if(popup_top < form_top) popup_top = form_top