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

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

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

SwipeRefreshLayout.setColorSchemeColors介绍

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

代码示例

代码示例来源:origin: rengwuxian/RxJavaSamples

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.fragment_token_advanced, container, false);
  ButterKnife.bind(this, view);
  swipeRefreshLayout.setColorSchemeColors(Color.BLUE, Color.GREEN, Color.RED, Color.YELLOW);
  swipeRefreshLayout.setEnabled(false);
  return view;
}

代码示例来源:origin: rengwuxian/RxJavaSamples

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.fragment_token, container, false);
  ButterKnife.bind(this, view);
  swipeRefreshLayout.setColorSchemeColors(Color.BLUE, Color.GREEN, Color.RED, Color.YELLOW);
  swipeRefreshLayout.setEnabled(false);
  return view;
}

代码示例来源:origin: rengwuxian/RxJavaSamples

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.fragment_cache, container, false);
  ButterKnife.bind(this, view);
  cacheRv.setLayoutManager(new GridLayoutManager(getActivity(), 2));
  cacheRv.setAdapter(adapter);
  swipeRefreshLayout.setColorSchemeColors(Color.BLUE, Color.GREEN, Color.RED, Color.YELLOW);
  swipeRefreshLayout.setEnabled(false);
  return view;
}

代码示例来源:origin: rengwuxian/RxJavaSamples

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.fragment_elementary, container, false);
  ButterKnife.bind(this, view);
  gridRv.setLayoutManager(new GridLayoutManager(getActivity(), 2));
  gridRv.setAdapter(adapter);
  swipeRefreshLayout.setColorSchemeColors(Color.BLUE, Color.GREEN, Color.RED, Color.YELLOW);
  swipeRefreshLayout.setEnabled(false);
  return view;
}

代码示例来源:origin: rengwuxian/RxJavaSamples

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.fragment_map, container, false);
  ButterKnife.bind(this, view);
  gridRv.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
  gridRv.setAdapter(adapter);
  swipeRefreshLayout.setColorSchemeColors(Color.BLUE, Color.GREEN, Color.RED, Color.YELLOW);
  swipeRefreshLayout.setEnabled(false);
  return view;
}

代码示例来源:origin: rengwuxian/RxJavaSamples

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.fragment_zip, container, false);
  ButterKnife.bind(this, view);
  gridRv.setLayoutManager(new GridLayoutManager(getActivity(), 2));
  gridRv.setAdapter(adapter);
  swipeRefreshLayout.setColorSchemeColors(Color.BLUE, Color.GREEN, Color.RED, Color.YELLOW);
  swipeRefreshLayout.setEnabled(false);
  return view;
}

代码示例来源:origin: iMeiji/Toutiao

@Override
protected void initView(View view) {
  recyclerView = view.findViewById(R.id.recycler_view);
  recyclerView.setHasFixedSize(true);
  swipeRefreshLayout = view.findViewById(R.id.refresh_layout);
  swipeRefreshLayout.setColorSchemeColors(SettingUtil.getInstance().getColor());
  swipeRefreshLayout.setOnRefreshListener(this);
}

代码示例来源:origin: aa112901/remusic

@Override
  public void changeTheme() {
    super.changeTheme();
    swipeRefresh.setColorSchemeColors(ThemeUtils.getColorById(mContext, R.color.theme_color_primary));
  }
}

代码示例来源:origin: nanchen2251/RxJava2Examples

@Override
protected void init() {
  fillData();
  OperatorsAdapter adapter = new OperatorsAdapter(data) {
    @Override
    public void onItemClick(int position) {
      itemClick(position);
    }
  };
  adapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
  mRefreshLayout.setColorSchemeColors(Color.RED, Color.BLUE, Color.GREEN);
  mRefreshLayout.setOnRefreshListener(this);
  mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
  mRecyclerView.setItemAnimator(new DefaultItemAnimator());
  mRecyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), LinearLayoutManager.VERTICAL));
  mRecyclerView.setAdapter(adapter);
}

代码示例来源:origin: iMeiji/Toutiao

@Override
public void onResume() {
  super.onResume();
  swipeRefreshLayout.setColorSchemeColors(SettingUtil.getInstance().getColor());
  setAdapter();
}

代码示例来源:origin: aa112901/remusic

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.fragment_main, container, false);
  swipeRefresh = (SwipeRefreshLayout) view.findViewById(R.id.swiperefresh);
  recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
  layoutManager = new LinearLayoutManager(mContext);
  recyclerView.setLayoutManager(layoutManager);
  //swipeRefresh.setColorSchemeResources(R.color.theme_color_PrimaryAccent);
  swipeRefresh.setColorSchemeColors(ThemeUtils.getColorById(mContext, R.color.theme_color_primary));
  swipeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
    @Override
    public void onRefresh() {
      reloadAdapter();
    }
  });
  //先给adapter设置空数据,异步加载好后更新数据,防止Recyclerview no attach
  mAdapter = new MainFragmentAdapter(mContext);
  recyclerView.setAdapter(mAdapter);
  recyclerView.setHasFixedSize(true);
  recyclerView.addItemDecoration(new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL_LIST));
  //设置没有item动画
  ((SimpleItemAnimator) recyclerView.getItemAnimator()).setSupportsChangeAnimations(false);
  reloadAdapter();
  mContext.getWindow().setBackgroundDrawableResource(R.color.background_material_light_1);
  return view;
}

代码示例来源:origin: iMeiji/Toutiao

@Override
public void onResume() {
  super.onResume();
  // 设置下拉刷新的按钮的颜色
  swipeRefreshLayout.setColorSchemeColors(SettingUtil.getInstance().getColor());
}

代码示例来源:origin: iMeiji/Toutiao

private void initView(View view) {
  recyclerView = view.findViewById(recycler_view);
  recyclerView.setHasFixedSize(true);
  recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
  swipeRefreshLayout = view.findViewById(R.id.refresh_layout);
  swipeRefreshLayout.setColorSchemeColors(SettingUtil.getInstance().getColor());
  swipeRefreshLayout.setOnRefreshListener(this);
  tv_desc = view.findViewById(R.id.tv_desc);
  IOnItemLongClickListener listener = (view1, position) -> {
    final MediaChannelBean item = list.get(position);
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    builder.setMessage("取消订阅\" " + item.getName() + " \"?");
    builder.setPositiveButton(R.string.button_enter, (dialog, which) -> {
      new Thread(() -> {
        dao.delete(item.getId());
        setAdapter();
      }).start();
      dialog.dismiss();
    });
    builder.setNegativeButton(R.string.button_cancel, (dialog, which) -> dialog.dismiss());
    builder.show();
  };
  adapter = new MultiTypeAdapter();
  Register.registerMediaChannelItem(adapter, listener);
  recyclerView.setAdapter(adapter);
}

代码示例来源:origin: iMeiji/Toutiao

@Override
protected void initView(View view) {
  Toolbar toolbar = view.findViewById(R.id.toolbar);
  initToolBar(toolbar, true, "");
  toolbar.setOnClickListener(v -> scrollView.smoothScrollTo(0, 0));
  tv_hint = view.findViewById(R.id.tv_hint);
  tv_save = view.findViewById(R.id.tv_save);
  tv_save.setOnClickListener(this);
  viewPager = view.findViewById(R.id.viewPager);
  photoView = view.findViewById(R.id.photoView);
  webView = view.findViewById(R.id.webview);
  scrollView = view.findViewById(R.id.scrollView);
  progressBar = view.findViewById(R.id.pb_progress);
  int color = SettingUtil.getInstance().getColor();
  progressBar.getIndeterminateDrawable().setColorFilter(color, PorterDuff.Mode.MULTIPLY);
  progressBar.show();
  swipeRefreshLayout = view.findViewById(R.id.refresh_layout);
  swipeRefreshLayout.setColorSchemeColors(SettingUtil.getInstance().getColor());
  swipeRefreshLayout.setOnRefreshListener(() -> {
    swipeRefreshLayout.post(() -> swipeRefreshLayout.setRefreshing(true));
    presenter.doLoadData(shareUrl);
  });
  setHasOptionsMenu(true);
}

代码示例来源:origin: iMeiji/Toutiao

swipeRefreshLayout.setColorSchemeColors(SettingUtil.getInstance().getColor());
swipeRefreshLayout.setOnRefreshListener(() -> {
  swipeRefreshLayout.post(() -> swipeRefreshLayout.setRefreshing(true));

代码示例来源:origin: iMeiji/Toutiao

swipeRefreshLayout.setColorSchemeColors(SettingUtil.getInstance().getColor());
swipeRefreshLayout.setOnRefreshListener(() -> {
  swipeRefreshLayout.post(() -> swipeRefreshLayout.setRefreshing(true));

代码示例来源:origin: iMeiji/Toutiao

swipeRefreshLayout.setColorSchemeColors(SettingUtil.getInstance().getColor());
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
  @Override

代码示例来源:origin: TheFinestArtist/FinestWebView-Android

swipeRefreshLayout.setColorSchemeColors(swipeRefreshColor);
} else {
 swipeRefreshLayout.setColorSchemeColors(swipeRefreshColors);

代码示例来源:origin: ISchwarz23/SortableTableView

/**
 * Sets the given color as background of the table header.
 *
 * @param color The color that shall be set as background of the table header.
 */
public void setHeaderBackgroundColor(@ColorInt final int color) {
  tableHeaderView.setBackgroundColor(color);
  swipeRefreshLayout.setColorSchemeColors(color);
}

代码示例来源:origin: kaku2015/ColorfulNews

private void initSwipeRefreshLayout() {
  mSwipeRefreshLayout.setOnRefreshListener(this);
  mSwipeRefreshLayout.setColorSchemeColors(getActivity().getResources().getIntArray(R.array.gplus_colors)
  );
}

相关文章