首次加载数据时的 SwipeRefreshLayout 或 ProgressBar

SwipeRefreshLayout or ProgressBar at first time data load

我目前在我的应用程序中使用 SwipeRefreshLayoutRecyclerView。一切正常。

我不确定的是,当第一次在屏幕上加载数据时,我是否应该使用 循环加载指示器 of SwipeRefreshLayout,如下所示。

swipeRefreshLayout.post(new Runnable() {
     @Override public void run() {
        swipeRefreshLayout.setRefreshing(true);
     }
});

或者我应该使用特定的 ProgressBar 作为 循环加载指示器 ,如下所示。

private ProgressBar spinner;

spinner = (ProgressBar) findViewById(R.id.progressBar1);
spinner.setVisibility(View.VISIBLE);

哪种方法更符合 Google Material 设计指南 因为它们在 SwipeRefreshLayout 和 [=15] 之间有很大的视觉差异=]指标。 (我已经用谷歌搜索了很多,但没有找到正确的答案。)

当然你应该为第一次数据加载你的进度条。

SwipeRefreshLayout 仅在您在同一屏幕中并想检查是否有新数据可用时使用