絵文字ピッカーでカテゴリ開閉した後のスクロール動作を微妙に改善。NoteStock検索のメンションの扱いの改善。
This commit is contained in:
parent
615c57db53
commit
5de2c73dd9
|
@ -48,8 +48,8 @@ class APTag(parser: TootParser, jsonArray: JsonArray?) {
|
||||||
"Hashtag" -> hashtags.add(TootTag.parse(parser, it))
|
"Hashtag" -> hashtags.add(TootTag.parse(parser, it))
|
||||||
|
|
||||||
"Mention" ->
|
"Mention" ->
|
||||||
Acct.parse(it.string("name")!!)
|
it.string("name")?.trimStart('@')?.let { rawAcct ->
|
||||||
.let { acct ->
|
val acct = Acct.parse(rawAcct)
|
||||||
mentions.add(
|
mentions.add(
|
||||||
TootMention(
|
TootMention(
|
||||||
id = EntityId.DEFAULT,
|
id = EntityId.DEFAULT,
|
||||||
|
|
|
@ -619,7 +619,7 @@ private class EmojiPicker(
|
||||||
this.canCollapse =
|
this.canCollapse =
|
||||||
keywordLower.isNullOrEmpty() && (selectedCategory == null || selectedCategory == EmojiCategory.Custom)
|
keywordLower.isNullOrEmpty() && (selectedCategory == null || selectedCategory == EmojiCategory.Custom)
|
||||||
|
|
||||||
val list = buildList {
|
adapter.list = buildList {
|
||||||
val filteredCategories = pickerCategries.filter {
|
val filteredCategories = pickerCategries.filter {
|
||||||
selectedCategory == null || it.category == selectedCategory
|
selectedCategory == null || it.category == selectedCategory
|
||||||
}.mapNotNull { category ->
|
}.mapNotNull { category ->
|
||||||
|
@ -648,13 +648,14 @@ private class EmojiPicker(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
adapter.list = list
|
|
||||||
if (scrollToCategory) {
|
val targetCategory = lastExpandCategory
|
||||||
val idx =
|
if (scrollToCategory && targetCategory != null) {
|
||||||
list.indexOfFirst { (it as? PickerItemCategory)?.original == lastExpandCategory }
|
views.root.handler?.postDelayed({
|
||||||
if (idx != -1) {
|
adapter.list.indexOfFirst { (it as? PickerItemCategory)?.original == targetCategory }
|
||||||
views.rvGrid.smoothScrollToPosition(idx)
|
.takeIf { it != -1 }
|
||||||
}
|
?.let { views.rvGrid.smoothScrollToPosition(it) }
|
||||||
|
}, 100L)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (it in views.llCategories.children) {
|
for (it in views.llCategories.children) {
|
||||||
|
|
Loading…
Reference in New Issue