在使用Turbolinks 5的Android上,我没有获得经典的Turbolinks转换(没有任何中间白页并且顶部有水平进度条)。所以我想我需要我自己progressView,但我可能是错在Android Turbolinks上,如何创建自定义progressView以替换默认微调器?
我在MainActivity.java
progressView = new ProgressBar(turbolinksView.getContext());
TurbolinksSession.getDefault(this)
.activity(this)
.adapter(this)
.view(turbolinksView)
.progressView(progressView, R.id.indeterminateBar, 300)
.visit(location);
有这个和这个,我activity_main.xml中
<ProgressBar
android:id="@+id/indeterminateBar"
android:layout_width="wrap_content"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_height="wrap_content"
/>
gradle设置为
compileSdkVersion 26
minSdkVersion 19
targetSdkVersion 22
当我运行上面我得到IllegalArgumentException "A progress indicator view must be provided in your custom progressView."
所以我试图
.progressView(progressView, progressView.getId(), 300)
,但我仍然得到IllegalArgumentException "A progress indicator view must be provided in your custom progressView."
显然我不能实例正确progressView
,我的问题是什么我该怎么办获得/创建合适的progressView
??
道歉提前为跨从Turbolinks-Android张贴问题我张贴在这里的唯一原因也就是我一直停留在好几天
这一工作的感谢。 – daya