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

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

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

SwipeRefreshLayout.setColorSchemeResources介绍

[英]Set the color resources used in the progress animation from color resources. The first color will also be the color of the bar that grows in response to a user swipe gesture.
[中]从颜色资源中设置进度动画中使用的颜色资源。第一种颜色也将是响应用户滑动手势而增长的条的颜色。

代码示例

代码示例来源:origin: Rukey7/MvpApp

/**
 * 初始化
 * @param refreshLayout
 * @param listener
 */
public static void init(SwipeRefreshLayout refreshLayout, SwipeRefreshLayout.OnRefreshListener listener) {
  refreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
      android.R.color.holo_green_light,
      android.R.color.holo_orange_light,
      android.R.color.holo_red_light);
  refreshLayout.setOnRefreshListener(listener);
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
protected void initRefreshLayout() {
  mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
  mSwipeRefreshLayout.post(() -> {
    mSwipeRefreshLayout.setRefreshing(true);
    loadData();
  });
  mSwipeRefreshLayout.setOnRefreshListener(() -> mSwipeRefreshLayout.setRefreshing(false));
}

代码示例来源:origin: cymcsg/UltimateAndroid

private void initView() {
  LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View view = inflater.inflate(R.layout.ultimate_listview_layout, this);
  mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.ultimate_listview_swipe_layout);
  mBasicUltimateListView = (BasicUltimateListView) view.findViewById(R.id.basicUltimateListView);
  mSwipeRefreshLayout.setEnabled(false);
  mSwipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
      android.R.color.holo_green_light,
      android.R.color.holo_orange_light,
      android.R.color.holo_red_light);
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
public void initRefreshLayout() {
  mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
  mSwipeRefreshLayout.setOnRefreshListener(this::loadData);
  mSwipeRefreshLayout.post(() -> {
    mSwipeRefreshLayout.setRefreshing(true);
    loadData();
  });
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
protected void initRefreshLayout() {
  mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
  mSwipeRefreshLayout.setOnRefreshListener(this::loadData);
  mSwipeRefreshLayout.post(() -> {
    mSwipeRefreshLayout.setRefreshing(true);
    loadData();
  });
}

代码示例来源:origin: pockethub/PocketHub

@Override
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
  super.onViewCreated(view, savedInstanceState);
  swipeLayout.setOnRefreshListener(this);
  swipeLayout.setColorSchemeResources(
      R.color.pager_title_background_top_start,
      R.color.pager_title_background_end,
      R.color.text_link,
      R.color.pager_title_background_end);
  configureList(getRecyclerView());
}

代码示例来源:origin: Rukey7/MvpApp

/**
 * 初始化,关联AppBarLayout,处理滑动冲突
 * @param refreshLayout
 * @param appBar
 * @param listener
 */
public static void init(final SwipeRefreshLayout refreshLayout, AppBarLayout appBar, SwipeRefreshLayout.OnRefreshListener listener) {
  refreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
      android.R.color.holo_green_light,
      android.R.color.holo_orange_light,
      android.R.color.holo_red_light);
  refreshLayout.setOnRefreshListener(listener);
  appBar.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
    @Override
    public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
      if (verticalOffset >= 0) {
        refreshLayout.setEnabled(true);
      } else {
        refreshLayout.setEnabled(false);
      }
    }
  });
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
public void initRefreshLayout() {
  mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
  mSwipeRefreshLayout.post(() -> {
    mIsRefreshing = true;
    mSwipeRefreshLayout.setRefreshing(true);
    loadData();
  });
  mSwipeRefreshLayout.setOnRefreshListener(() -> {
    mIsRefreshing = true;
    topicCenters.clear();
    loadData();
  });
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
protected void initRefreshLayout() {
  mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
  mSwipeRefreshLayout.post(() -> {
    mSwipeRefreshLayout.setRefreshing(true);
    mIsRefreshing = true;
    loadData();
  });
  mSwipeRefreshLayout.setOnRefreshListener(() -> {
    mIsRefreshing = true;
    originalRanks.clear();
    loadData();
  });
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
public void initRefreshLayout() {
  mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
  mSwipeRefreshLayout.post(() -> {
    mSwipeRefreshLayout.setRefreshing(true);
    loadData();
  });
  mSwipeRefreshLayout.setOnRefreshListener(() -> {
    pageNum = 1;
    mIsRefreshing = true;
    activityCenters.clear();
    mEndlessRecyclerOnScrollListener.refresh();
    loadData();
  });
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
public void initRefreshLayout() {
  mRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
  mRecyclerView.post(() -> {
    mRefreshLayout.setRefreshing(true);
    mIsRefreshing = true;
    loadData();
  });
  mRefreshLayout.setOnRefreshListener(() -> {
    clearData();
    loadData();
  });
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
protected void initRefreshLayout() {
  mRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
  mRecyclerView.post(() -> {
    mRefreshLayout.setRefreshing(true);
    mIsRefreshing = true;
    loadData();
  });
  mRefreshLayout.setOnRefreshListener(() -> {
    clearData();
    loadData();
  });
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
protected void initRefreshLayout() {
  mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
  mSwipeRefreshLayout.post(() -> {
    mSwipeRefreshLayout.setRefreshing(true);
    mIsRefreshing = true;
    loadData();
  });
  mSwipeRefreshLayout.setOnRefreshListener(() -> {
    clearData();
    loadData();
  });
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
protected void initRefreshLayout() {
  mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
  mSwipeRefreshLayout.post(() -> {
    mSwipeRefreshLayout.setRefreshing(true);
    mIsRefreshing = true;
    loadData();
  });
  mSwipeRefreshLayout.setOnRefreshListener(() -> {
    clearData();
    loadData();
  });
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

@Override
protected void initRefreshLayout() {
  mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
  mSwipeRefreshLayout.post(() -> {
    mSwipeRefreshLayout.setRefreshing(true);
    mIsRefreshing = true;
    loadData();
  });
  mSwipeRefreshLayout.setOnRefreshListener(() -> {
    clearData();
    loadData();
  });
}

代码示例来源: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: north2016/T-MVP

mCoreAdapterPresenter = new AdapterPresenter<>(this);
swipeRefresh.setColorSchemeResources(android.R.color.holo_blue_bright);
swipeRefresh.setOnRefreshListener(this::reFetch);
recyclerview.setHasFixedSize(true);

代码示例来源:origin: wangdan/AisenWeiBo

@Override
protected void layoutInit(LayoutInflater inflater, Bundle savedInstanceState) {
  super.layoutInit(inflater, savedInstanceState);
  appBarLayout.addOnOffsetChangedListener(this);
  swipeRefreshLayout.setOnRefreshListener(this);
  swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
      android.R.color.holo_green_light,
      android.R.color.holo_orange_light,
      android.R.color.holo_red_light);
  action_a.setOnClickListener(this);
  action_b.setOnClickListener(this);
  action_c.setOnClickListener(this);
  overlay.setOnClickListener(this);
  for (int i = 0; i < action_menu.getChildCount(); i++) {
    if (action_menu.getChildAt(i) instanceof AddFloatingActionButton) {
      action_menu.getChildAt(i).setOnClickListener(this);
      break;
    }
  }
  mHandler.postDelayed(initCurrentFragment, 100);
}

代码示例来源:origin: guolindev/booksource

recyclerView.setAdapter(adapter);
swipeRefresh = (SwipeRefreshLayout) findViewById(R.id.swipe_refresh);
swipeRefresh.setColorSchemeResources(R.color.colorPrimary);
swipeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
  @Override

相关文章