我正在尝试使用 Jetpack Compose 复制一些基于视图的选定文本行为。在这两种情况下,我都长按了 URL 的中间。
基于视图:
<TextView ... android:textIsSelectable="true" />
Run Code Online (Sandbox Code Playgroud)
撰写:
SelectionContainer {
Text(...)
}
Run Code Online (Sandbox Code Playgroud)
正如您在屏幕截图中看到的, Compose布局中缺少一些选项。有办法添加这个吗?是的,我知道我可以使用AndroidView,但是有没有更复杂的方法来做到这一点?以下是View布局中的内容,但Compose布局中缺少的内容:
编辑:我不是在要求一个自定义工具栏,我是在要求 Google 在 TextView 中提供的工具栏。
我想自动(即来自Jenkins)合并GitHub拉取请求,该请求已经由一个人批准并且已经过成功测试; 换句话说,当所有这三个复选标记都是绿色时:
这可能吗?我没有找到任何有关GitHub新的"已批准更改"代码审查功能的API文档.
那么,有人可以解释一下我的测试中尾部斜杠发生了什么吗?还是 WEB_URL 模式的错误?
@Test
public void testWebUrl() {
String url = "http://www.google.com/foo/";
String test = "A string that fails is this: " + url + " <-- see that?";
Matcher m = Patterns.WEB_URL.matcher(test);
while (m.find()) {
assertTrue(Patterns.WEB_URL.matcher(url).matches()); // PASSES
assertEquals(m.group(), url); // FAILS
// Here, m.group() == "http://www.google.com/foo", without the trailing "/"
}
}
Run Code Online (Sandbox Code Playgroud)