Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mention文字在前後移動游標後,輸入的文字會套用到mention的span style #7

Closed
ench0812 opened this issue Feb 13, 2019 · 8 comments
Labels
bug Something isn't working fixed

Comments

@ench0812
Copy link

image

@sunhapper
Copy link
Owner

你好,能详细描述下“前後移動游標”这个操作吗?我试了下没有出现你图中的情况
方便的话能提供下系统版本,输入法以及操作路径,谢谢

@sunhapper sunhapper added the question Further information is requested label Feb 16, 2019
@sunhapper sunhapper added fixed bug Something isn't working and removed question Further information is requested labels Feb 19, 2019
@ench0812
Copy link
Author

ench0812 commented Feb 20, 2019

@sunhapper sunhapper reopened this Feb 20, 2019
@sunhapper
Copy link
Owner

请问下用的是什么输入法

@ench0812
Copy link
Author

使用的輸入法採用預設的三星鍵盤,版本: 3.0.23.63
image

@sunhapper
Copy link
Owner

sunhapper commented Feb 21, 2019

我这没有三星的设备,下载的三星输入法在其他设备上也不能用。。。
先更新下代码,看看58634af 这个commit解没解决问题
如果还没有的话看下EmojiSpannableStringBuilder.replace方法,问题应该是出在这里,解决方案应该也是在这里,如果可以自行解决的话欢迎解决之后给我提pr
解决不了的话在replace的地方打下log发给我

        if (tb instanceof Spanned) {
            IntegratedSpan[] spans = ((Spanned) tb).getSpans(0, tb.length(), IntegratedSpan.class);
            if (spans != null && spans.length > 0) {
                int spanStart = ((Spanned) tb).getSpanStart(spans[0]);
                int spanEnd = ((Spanned) tb).getSpanEnd(spans[0]);
                Log.i(TAG, "replace: origin:" + this + "  start:" + start + "  end:" + end + "  CharSequence:" + tb
                        + "  spanRange:[" + spanStart + "," + spanEnd + "]");
            }
        }

@ench0812
Copy link
Author

pull 最新版本後的結果
image

操作畫面: https://drive.google.com/file/d/1n8DKc-WSFDNbhnR1vJQt-0Rf5CPp8JI6/view?usp=sharing

sunhapper pushed a commit that referenced this issue Feb 22, 2019
@sunhapper
Copy link
Owner

我在dev分支修改了一下demo,麻烦切换到dev,pull一下代码看看是什么效果

@ench0812
Copy link
Author

Cool, 基本上已經滿足操作的狀態,請參考dev版的操作結果
https://drive.google.com/file/d/1IYMwrSKZAdT0Wo1u66bURnm2MAagMVoa/view?usp=sharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

2 participants