fix: 表情面板显示与实际输入不符
This commit is contained in:
parent
0e55b13d90
commit
fe24fe1aca
|
|
@ -6,6 +6,7 @@ import android.content.pm.PackageManager
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||||
|
|
@ -80,6 +81,7 @@ import androidx.compose.ui.viewinterop.AndroidView
|
||||||
import androidx.core.widget.addTextChangedListener
|
import androidx.core.widget.addTextChangedListener
|
||||||
import com.effective.android.panel.utils.PanelUtil
|
import com.effective.android.panel.utils.PanelUtil
|
||||||
import com.github.panpf.sketch.compose.AsyncImage
|
import com.github.panpf.sketch.compose.AsyncImage
|
||||||
|
import com.google.accompanist.drawablepainter.rememberDrawablePainter
|
||||||
import com.huanchengfly.tieba.post.R
|
import com.huanchengfly.tieba.post.R
|
||||||
import com.huanchengfly.tieba.post.arch.GlobalEvent
|
import com.huanchengfly.tieba.post.arch.GlobalEvent
|
||||||
import com.huanchengfly.tieba.post.arch.collectPartialAsState
|
import com.huanchengfly.tieba.post.arch.collectPartialAsState
|
||||||
|
|
@ -691,7 +693,10 @@ private fun EmoticonPanel(
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
onEmoticonClick: (Emoticon) -> Unit,
|
onEmoticonClick: (Emoticon) -> Unit,
|
||||||
) {
|
) {
|
||||||
val emoticons = remember { EmoticonManager.getAllEmoticon() }
|
val emoticons = remember {
|
||||||
|
EmoticonManager.getAllEmoticon()
|
||||||
|
.filter { it.name.isNotEmpty() }
|
||||||
|
}
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
|
|
@ -703,13 +708,18 @@ private fun EmoticonPanel(
|
||||||
.padding(top = 16.dp)
|
.padding(top = 16.dp)
|
||||||
) {
|
) {
|
||||||
items(emoticons) { emoticon ->
|
items(emoticons) { emoticon ->
|
||||||
AsyncImage(
|
Image(
|
||||||
imageUri = EmoticonManager.rememberEmoticonUri(id = emoticon.id),
|
painter = rememberDrawablePainter(
|
||||||
|
drawable = EmoticonManager.getEmoticonDrawable(
|
||||||
|
LocalContext.current,
|
||||||
|
emoticon.id
|
||||||
|
)
|
||||||
|
),
|
||||||
contentDescription = stringResource(
|
contentDescription = stringResource(
|
||||||
id = R.string.emoticon,
|
id = R.string.emoticon,
|
||||||
emoticon.name
|
emoticon.name
|
||||||
),
|
),
|
||||||
contentScale = ContentScale.Crop,
|
contentScale = ContentScale.Fit,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(48.dp)
|
.size(48.dp)
|
||||||
.padding(8.dp)
|
.padding(8.dp)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue