qwwuyu

qwwuyu

V2EX 第 351325 号会员,加入于 2018-09-21 16:28:04 +08:00
今日活跃度排名 1619
根据 qwwuyu 的设置,主题列表被隐藏
二手交易 相关的信息,包括已关闭的交易,不会被隐藏
qwwuyu 最近回复了
@lixyz 还是 7L 方案靠谱,试了加 LastItem,效果很好,也不用写那么多额外代码了,奶茶还是让给 7L 吧~
试了一下,可以一直保持在底部,不会上下跳动,我这里没有去计算 TextView 改变后的高度,有需要可以自己监听控件高度变化,再去 scrollToPositionWithOffset.
代码图片 https://imgur.com/a/HU30yph
```
new Thread(() -> {
while (!isFinishing() && run) {
try {
Thread.sleep(200);
} catch (InterruptedException ignored) {
}
runOnUiThread(() -> {
if (textTv != null) {
textTv.setText(textTv.getText() + "asdasdasdasdasdasdasd");
int targetPosition = adapter.getItemCount() - 1;
View targetView = linearLayoutManager.findViewByPosition(targetPosition);
int offset = recyclerView.getHeight() - targetView.getHeight();
linearLayoutManager.scrollToPositionWithOffset(targetPosition, offset);
}
});
}
}).start();
```
const val compileSdkVersion = 34
const val minSdkVersion = 21
const val targetSdkVersion = 30
RelativeContainer() {
Column() {
Row() {
Text("Test1111")
.fontSize(14)
.fontWeight(FontWeight.Lighter)
.fontStyle(FontStyle.Italic)
.foregroundColor('#DDDDDD')
.flexGrow(1)
Button() {
Text("button")
.width(30)
.height(30)
}
.width(30)
.height(30)
.backgroundColor(Color.Transparent)
.foregroundColor('#DDDDDD')
}
.width('100%')
.alignItems(VerticalAlign.Top)

Text("long text long text long text long text long text long text long text long text long text long text")
.fontSize(14)
.fontWeight(FontWeight.Lighter)
.foregroundColor('#DDDDDD')
.width('100%')
.margin({ top: 2 })
}
.id('viewRight')
.backgroundColor(0xff0000)
.margin({ left: 10 })
.alignRules({
left: { anchor: '__container__', align: HorizontalAlign.Start },
right: { anchor: '__container__', align: HorizontalAlign.End },
})

Row()
.id('viewLine')
.width(3)
.backgroundColor(0x00ff00)
.alignRules({
top: { anchor: 'viewRight', align: VerticalAlign.Top },
bottom: { anchor: 'viewRight', align: VerticalAlign.Bottom },
})
}
.size({ width: '100%', height: 'auto' })
.margin({ top: 10 })
.backgroundColor(0x0000ff)

//RelativeContainer 可以做到,但是稍微用错容易出不明所以的 BUG
34 天前
回复了 magic3584 创建的主题 Android 如何入门 Android 开发
初学难点估计还是熟悉 API,刚开始可以避开依赖注入路由这些不必要的.
找简单的开源项目跑起来,读下流程,照着写,拷贝一些工具和组件到自己项目.
快速入手就找一个基础框架,直接删删改改去写代码.
很多问题 AI 大部分都可以解决,难点还是经验 UI 业务那些...
@dandycheung 最近审核确实很迷,其它平台都过了,vivo 先提示获取 ssid 频繁,再提示隐私政策不对,最后全修复了又告诉我 WebView 获取剪切板,不一次性测完...
@lw0x1 你那 WebView 加载隐私政策会调用 webSetting.setJavaScriptEnabled(true)吗?
@paopjian 这块内容多,有很多链接,本地链接到服务器的服务条款和隐私政策,隐私政策会依赖第三方 SDK,会提供 h5 链接,最后依旧避免不了使用 WebView.
@MozzieW 第一条正在尝试,但是虽然是系统行为,估计也要 APP 买单,之前查出 WebView 获取定位信息,那个是可以 API 关闭的.
第二条没办法,因为用的 WebView 加载的隐私政策,没同意之前就触发了系统剪切板行为
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3190 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 10ms · UTC 12:22 · PVG 20:22 · LAX 04:22 · JFK 07:22
Developed with CodeLauncher
♥ Do have faith in what you're doing.