sunhapper / spedittool Goto Github PK
View Code? Open in Web Editor NEWAn efficient and scalable library for inputing and displaying gif or @mention on graph-text mixed TextView/EditText
License: MIT License
An efficient and scalable library for inputing and displaying gif or @mention on graph-text mixed TextView/EditText
License: MIT License
你好,我添加依赖之后,编译无法通过,但是把你的libary下载下来加到项目中,让app添加这个libary是么问题的编译也正常通过,原因貌似是我项目中用的Glide是3.7的而你的是用的4.0的,我猜想添加你的依赖之后可能把你的demo的gradle也添加过来了,导致编译无法通过
感谢您的开源,我在项目中使用了您的工程,现在我有个问题当我在聊天页面有@信息时,使用是正常,但是当我把@信息保存为草稿时,再次进入取出草稿里的@信息时,这时就是一个普通的字符串了,此时我应当怎么做。如果有时间请您回复下。谢谢!
没太理解 EmojiSpannableStringBuilder 在这里的作用,看上去类似 androidx emoji 库 中SpannableBuilder。能帮忙解答下吗
选中@XX 显示背景后, 后面输入文字 或者光标插入 应该要再次执行下 取消选中背景色; 这样体验就会微博一样了哈
override fun getSize(paint: Paint, text: CharSequence,
start: Int, end: Int, fm: FontMetricsInt?): Int {
if (fm != null && paint.fontMetricsInt != null) {
//paint.getFontMetricsInt() 和 参数中FontMetricsInt不是同一个对象,数据不同
// FontMetricsInt会变化,paint.getFontMetricsInt()会和TextView的文字大小保持一致
val paintFontMetricsInt = paint.fontMetricsInt
drawableHeight = paintFontMetricsInt.descent - paintFontMetricsInt.ascent
}
val drawable = getResizedDrawable()
val bounds = drawable.bounds
return bounds.right
}
此处方法入参的fm在部分手机上为null,导致drawableHeight为0,最终导致getSize()方法获取不到宽度。
在nexus 6P中删除 @xxx 无法整体删除
Nexus 6P 8.1.0
是否可以支持@的换行
类库不错。
但无法解决 copy paste表情
换了一个demo也一样
ERROR: Failed to resolve: com.github.sunhapper:SpEditTool:SpEditText
首先感谢作者的开源库,不过我遇到了一个问题
比如我想实现类似朋友圈列表那样的文字和gif表情展示,后台可能返回这样一串文本
“今天天气很好[emt]3[/emt]”,客户端需要使用正则表达式去动态匹配并显示gif,但是我看了demo并尝试按照上面的规则显示gif,却没有显示出来
不知道有没有考虑过 复制粘贴的功能,尤其是自定义的表情 ,如果有对应的TextView最好
因为我的项目依赖的包是v7 25.3.1 没有android.support.annotation.GuardedBy这一个包
Caused by: java.lang.IllegalArgumentException: PrecomputedText's Parameters don't match the parameters of this TextView.Consider using setTextMetricsParams(precomputedText.getParams()) to override the settings of this TextView: PrecomputedText: {textSize=45.0, textScaleX=1.0, textSkewX=0.0, letterSpacing=0.0, textLocale=[zh_CN], typeface=android.graphics.Typeface@5cb73da, variationSettings=null, elegantTextHeight=false, textDir=android.text.TextDirectionHeuristics$TextDirectionHeuristicInternal@a4e222a, breakStrategy=0, hyphenationFrequency=0, lineBreakStyle=0, lineBreakWordStyle=0}TextView: {textSize=45.0, textScaleX=1.0, textSkewX=0.0, letterSpacing=0.0, textLocale=[zh_CN], typeface=android.graphics.Typeface@5cb73da, variationSettings=null, elegantTextHeight=false, textDir=android.text.TextDirectionHeuristics$TextDirectionHeuristicInternal@a4e222a, breakStrategy=0, hyphenationFrequency=0, lineBreakStyle=0, lineBreakWordStyle=0}
2.at android.widget.TextView.setText(TextView.java:6554)
3.at android.widget.TextView.setText(TextView.java:6472)
4.at com.sunhapper.x.spedit.view.SpXTextView.setText(SpXTextView.java:36)
5.at android.widget.TextView.setText(TextView.java:6424)
在onSpanAdded回调时,向GifDrawable添加一个RefreshListener,当界面销毁时,View没有销毁,onRefresh还是一直被调用。
demo点击表情之后选择#topic#然后删除会闪退
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.