在调用微调器setVisibility
时是否显示微调器,我需要编写espresso测试。这是代码
MainActivity.kt
doAsync {
try {
activityIndicator!!.setVisibility(View.VISIBLE);
appList = getAppList(requestBody, LAUNCHER_BASE_URL)
Log.d("App list =", appList.toString())
appInfoList = populateList()
}
catch (e: Exception) {
Log.e("Exception-launcher", e.toString())
}
uiThread {
adapter = Adapter(applicationContext, appInfoList!!,contentResolver,packageManager,applicationContext)
recyclerView!!.adapter = adapter
recyclerView!!.layoutManager = GridLayoutManager(applicationContext, 3)
activityIndicator!!.setVisibility(View.INVISIBLE)
}
activity_main.xml
<com.wang.avi.AVLoadingIndicatorView
android:id="@+id/avi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/AVLoadingIndicatorView"
android:visibility="visible"
app:indicatorName="LineSpinFadeLoaderIndicator"
app:indicatorColor="@color/colorPrimary"
android:gravity="center"/>