android.support.v4.widget.SwipeRefreshLayout.setProgressBackgroundColorSchemeResource()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(155)

本文整理了Java中android.support.v4.widget.SwipeRefreshLayout.setProgressBackgroundColorSchemeResource()方法的一些代码示例,展示了SwipeRefreshLayout.setProgressBackgroundColorSchemeResource()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SwipeRefreshLayout.setProgressBackgroundColorSchemeResource()方法的具体详情如下:
包路径:android.support.v4.widget.SwipeRefreshLayout
类名称:SwipeRefreshLayout
方法名:setProgressBackgroundColorSchemeResource

SwipeRefreshLayout.setProgressBackgroundColorSchemeResource介绍

暂无

代码示例

代码示例来源:origin: hidroh/materialistic

@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
             @Nullable Bundle savedInstanceState) {
  final View view = inflater.inflate(R.layout.fragment_list, container, false);
  mErrorView = view.findViewById(R.id.empty);
  mEmptyView = view.findViewById(R.id.empty_search);
  mRecyclerView = view.findViewById(R.id.recycler_view);
  mSwipeRefreshLayout = view.findViewById(R.id.swipe_layout);
  mSwipeRefreshLayout.setColorSchemeResources(R.color.white);
  mSwipeRefreshLayout.setProgressBackgroundColorSchemeResource(
      AppUtils.getThemedResId(getActivity(), R.attr.colorAccent));
  if (savedInstanceState == null) {
    mSwipeRefreshLayout.setRefreshing(true);
  }
  mSwipeRefreshLayout.setOnRefreshListener(() -> {
    mCacheMode = ItemManager.MODE_NETWORK;
    getAdapter().setCacheMode(mCacheMode);
    refresh();
  });
  return view;
}

代码示例来源:origin: hidroh/materialistic

@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable final Bundle savedInstanceState) {
  if (isNewInstance()) {
    mFragmentView = inflater.inflate(R.layout.fragment_item, container, false);
    mEmptyView = mFragmentView.findViewById(R.id.empty);
    mRecyclerView = (RecyclerView) mFragmentView.findViewById(R.id.recycler_view);
    mRecyclerView.setLayoutManager(new SnappyLinearLayoutManager(getActivity(), true));
    mItemDecoration = new CommentItemDecoration(getActivity());
    mRecyclerView.addItemDecoration(mItemDecoration);
    mSwipeRefreshLayout = (SwipeRefreshLayout) mFragmentView.findViewById(R.id.swipe_layout);
    mSwipeRefreshLayout.setColorSchemeResources(R.color.white);
    mSwipeRefreshLayout.setProgressBackgroundColorSchemeResource(R.color.redA200);
    mSwipeRefreshLayout.setOnRefreshListener(() -> {
      if (TextUtils.isEmpty(mItemId)) {
        return;
      }
      mCacheMode = ItemManager.MODE_NETWORK;
      if (mAdapter != null) {
        mAdapter.setCacheMode(mCacheMode);
      }
      loadKidData();
    });
  }
  return mFragmentView;
}

代码示例来源:origin: jiangqqlmj/FastDev4Android

demo_recycler=(RecyclerView)this.findViewById(R.id.demo_recycler);
demo_swiperefreshlayout.setProgressBackgroundColorSchemeResource(android.R.color.white);
demo_swiperefreshlayout.setColorSchemeResources(android.R.color.holo_blue_light,
    android.R.color.holo_red_light, android.R.color.holo_orange_light,

代码示例来源:origin: jiangqqlmj/FastDev4Android

demo_recycler=(RecyclerView)this.findViewById(R.id.demo_recycler);
demo_swiperefreshlayout.setProgressBackgroundColorSchemeResource(android.R.color.white);
demo_swiperefreshlayout.setColorSchemeResources(android.R.color.holo_blue_light,
    android.R.color.holo_red_light, android.R.color.holo_orange_light,

代码示例来源:origin: jiangqqlmj/FastDev4Android

instance_swiperefreshlayout=(SwipeRefreshLayout)this.findViewById(R.id.instance_swiperefreshlayout);
instance_swiperefreshlayout.setProgressBackgroundColorSchemeResource(android.R.color.white);
instance_swiperefreshlayout.setColorSchemeResources(android.R.color.holo_blue_light,
    android.R.color.holo_red_light, android.R.color.holo_orange_light,

代码示例来源:origin: jiangqqlmj/FastDev4Android

instance_swiperefreshlayout=(SwipeRefreshLayout)this.findViewById(R.id.instance_swiperefreshlayout);
instance_swiperefreshlayout.setProgressBackgroundColorSchemeResource(android.R.color.white);
instance_swiperefreshlayout.setColorSchemeResources(android.R.color.holo_blue_light,
    android.R.color.holo_red_light, android.R.color.holo_orange_light,

代码示例来源:origin: pinguo-zhouwei/CustomAdapter

/**
 * 设置刷新进度条背景色
 *  see{@link SwipeRefreshLayout#setProgressBackgroundColorSchemeResource(int)} (int)}
 * @param colorRes
 */
public void setProgressBackgroundColorSchemeResource(@ColorRes int colorRes) {
   if(mSwipeRefreshLayout!=null){
     mSwipeRefreshLayout.setProgressBackgroundColorSchemeResource(colorRes);
   }
}

代码示例来源:origin: moz1q1/WalleLibrary

/**
   *
   * @param swipeRefreshLayout
   * @param onRefreshListener
   * @param colorResIds
   */
  public static void setBase(SwipeRefreshLayout swipeRefreshLayout, SwipeRefreshLayout.OnRefreshListener onRefreshListener, @ColorRes int... colorResIds) {
    // 设置下拉进度的背景颜色,默认就是白色的
    swipeRefreshLayout.setProgressBackgroundColorSchemeResource(android.R.color.white);
    // 设置下拉进度的主题颜色
    swipeRefreshLayout.setColorSchemeResources(colorResIds);
    swipeRefreshLayout.setOnRefreshListener(onRefreshListener);
  }
}

代码示例来源:origin: tiandawu/IotXmpp

@Override
protected View initView(LayoutInflater inflater, ViewGroup container) {
  View view = inflater.inflate(R.layout.frag_message, container, false);
  mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.session_SwipeRefreshLayout);
  mRecyclerView = (RecyclerView) view.findViewById(R.id.session_RecyclerVeiw);
  mSwipeRefreshLayout.setColorSchemeResources(R.color.text_color);
  mSwipeRefreshLayout.setProgressBackgroundColorSchemeResource(R.color.colorPrimary);
  mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
  mSwipeRefreshLayout.setRefreshing(true);
  mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
    @Override
    public void onRefresh() {
      refreshData();
    }
  });
  return view;
}

代码示例来源:origin: ahmclishihao/gankS

@Override
protected View initView(Context context, LayoutInflater inflater, ViewGroup container) {
  // 添加ListDataFragment
  if (mRootView == null) {
    mRootView = inflater.inflate(R.layout.layout_simple_swipe_list, null);
    ButterKnife.bind(this, mRootView);
    mSrlRefresh.setColorSchemeResources(R.color.colorPrimary);
    // 当黑色主题时转换为黑色,因为不知道如何用XML来指定其下拉刷新的颜色。。。。
    if (MainActivity.getThemeId() == R.style.AppTheme_black) {
      mSrlRefresh.setProgressBackgroundColorSchemeResource(R.color.black_theme);
    } else {
      mSrlRefresh.setProgressBackgroundColorSchemeResource(R.color.white);
    }
    initRecycle();
  }
  return mRootView;
}

代码示例来源:origin: tiandawu/IotXmpp

@Override
  protected View initView(LayoutInflater inflater, final ViewGroup container) {
    View view = inflater.inflate(R.layout.frag_contact, container, false);
    mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.contact_SwipeRefreshLayout);
    expandableListView = (ExpandableListView) view.findViewById(R.id.contact_ExpandableListView);
    mSwipeRefreshLayout.setColorSchemeResources(R.color.text_color);
    mSwipeRefreshLayout.setProgressBackgroundColorSchemeResource(R.color.colorPrimary);
//        mSwipeRefreshLayout.post(new Runnable() {
//            @Override
//            public void run() {
//                mSwipeRefreshLayout.setRefreshing(true);
//            }
//        });
    mSwipeRefreshLayout.setRefreshing(true);
    mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
      @Override
      public void onRefresh() {
        refreshData();
      }
    });

    initMyBroadcastReceiver();

    return view;
  }

代码示例来源:origin: tiandawu/IotXmpp

private void initData() {
  backBtn.setOnClickListener(this);
  mRefreshLayout.setColorSchemeResources(R.color.text_color);
  mRefreshLayout.setProgressBackgroundColorSchemeResource(R.color.colorPrimary);
  mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
  mRefreshLayout.setRefreshing(true);

代码示例来源:origin: xuhongv/SmartHome

mSwipeRefreshLayout.setProgressBackgroundColorSchemeResource(android.R.color.white);

相关文章