小编Nor*_*ert的帖子

颤振实现粘性标题和捕捉项目效果

在过去的几天里,我一直在阅读颤动的框架文档,特别是条子部分,但我不太清楚从哪里开始.我正在尝试实现粘性标题和捕捉效果.RenderSliv​​erList可能是一个好的开始吗?我需要重新布局吗?我需要做额外的绘图吗?如果是这样的话?

任何帮助,从哪里开始将是一个巨大的帮助,提前感谢!

编辑:我想我现在理解了布局部分,但我无法找到绘画应该发生的地方.

编辑2:为了澄清,这是所需的"粘性标题效果":

如何在RecyclerView中制作粘性标题?(没有外部库)

这是"快照"效果:

https://rubensousa.github.io/2016/08/recyclerviewsnap

dart flutter flutter-sliver

12
推荐指数
3
解决办法
1万
查看次数

Android,在检测模式下运行常规应用程序(仅限 adb + debug)

我想以一种可以InstrumentationRegistry.getInstrumentation()在运行时访问的方式运行 Android 应用程序。

这仅适用于调试版本,通过 ADB 安装应用程序就足够了。因为我不想使用仪器测试套件,所以我不想使用InstrumentationTestRunner但直接启动MainActivity应用程序。

这怎么可能?

我尝试过的:

  1. 添加了对测试包的常规实现依赖(而不是仅测试依赖) - 有效
    implementation 'androidx.test.uiautomator:uiautomator:2.2.0'
    implementation 'androidx.test:runner:1.1.0'
Run Code Online (Sandbox Code Playgroud)
  1. 添加了检测清单
    <instrumentation android:name=".MainActivity"
        android:targetPackage="com.android.shell"
        android:label="App" />
Run Code Online (Sandbox Code Playgroud)

(不确定这是否真的正确。)

  1. 使用运行应用程序(应用程序已安装在设备上)
adb shell am instrument -w com.example.app/.MainActivity         
Run Code Online (Sandbox Code Playgroud)

这导致:

android.util.AndroidException: INSTRUMENTATION_FAILED: com.example.app/com.example.app.MainActivity
    at com.android.commands.am.Instrument.run(Instrument.java:519)
    at com.android.commands.am.Am.runInstrument(Am.java:202)
    at com.android.commands.am.Am.onRun(Am.java:80)
    at com.android.internal.os.BaseCommand.run(BaseCommand.java:60)
    at com.android.commands.am.Am.main(Am.java:50)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:399)
Run Code Online (Sandbox Code Playgroud)

UiAutomator所以本质上我的问题是,如何以我可以在运行时使用的方式运行应用程序?

提前致谢!

android android-testing android-instrumentation android-uiautomator

5
推荐指数
1
解决办法
756
查看次数