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

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

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

SwipeRefreshLayout.setColorScheme介绍

暂无

代码示例

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

public void setRefreshingColor(int col1, int col2, int col3, int col4) {
  mSwipeRefreshLayout.setColorScheme(col1, col2, col3, col4);
}

代码示例来源:origin: googlesamples/android-SwipeRefreshListFragment

/**
 * Set the color scheme for the {@link android.support.v4.widget.SwipeRefreshLayout}.
 *
 * @see android.support.v4.widget.SwipeRefreshLayout#setColorScheme(int, int, int, int)
 */
public void setColorScheme(int colorRes1, int colorRes2, int colorRes3, int colorRes4) {
  mSwipeRefreshLayout.setColorScheme(colorRes1, colorRes2, colorRes3, colorRes4);
}

代码示例来源:origin: stackoverflow.com

public class MainActivity extends AppCompatActivity implements SwipeRefreshLayout.OnRefreshListener{

private SwipeRefreshLayout swipeRefreshLayout

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipeLayout);
    swipeRefreshLayout.setOnRefreshListener(this);

    //to change the color of the refresh indictor
    swipeRefreshLayout.setColorScheme(getResources().getColor(R.color.yourcolor), 
        getResources().getColor(R.color.yourcolor), 
        getResources().getColor(R.color.yourcolor), 
        getResources().getColor(R.color.yourcolor));
  }

  @Override
  public void onRefresh() {
  //do something here
  //setRefreshing(false) will hide the indicator
  swipeRefreshLayout.setRefreshing(false);
  }
}

代码示例来源:origin: googlesamples/android-SwipeRefreshLayoutBasic

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
    Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.fragment_sample, container, false);
  // Retrieve the SwipeRefreshLayout and ListView instances
  mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.swiperefresh);
  // BEGIN_INCLUDE (change_colors)
  // Set the color scheme of the SwipeRefreshLayout by providing 4 color resource ids
  mSwipeRefreshLayout.setColorScheme(
      R.color.swipe_color_1, R.color.swipe_color_2,
      R.color.swipe_color_3, R.color.swipe_color_4);
  // END_INCLUDE (change_colors)
  // Retrieve the ListView
  mListView = (ListView) view.findViewById(android.R.id.list);
  return view;
}
// END_INCLUDE (inflate_view)

代码示例来源:origin: stackoverflow.com

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.your_layout);

  SwipeRefreshLayout swipeLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_container);
  swipeLayout.setOnRefreshListener(this);
  swipeLayout.setColorScheme(android.R.color.holo_blue_bright, 
      android.R.color.holo_green_light, 
      android.R.color.holo_orange_light, 
      android.R.color.holo_red_light);
}

@Override public void onRefresh() {
  new Handler().postDelayed(new Runnable() {
    @Override public void run() {
      swipeLayout.setRefreshing(false);
    }
  }, 5000);
}

代码示例来源:origin: stackoverflow.com

public class SwipeActivity extends Activity implements OnRefreshListener{

  SwipeRefreshLayout swipeLayout;
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_swipe);
    swipeLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_container);
    swipeLayout.setOnRefreshListener(this);
    swipeLayout.setColorScheme(android.R.color.holo_blue_bright, 
        android.R.color.holo_green_light, 
        android.R.color.holo_orange_light, 
        android.R.color.holo_red_light);
  }

   public void onRefresh() {
    new Handler().postDelayed(new Runnable() {
      @Override public void run() {
        swipeLayout.setRefreshing(false);
      }
    }, 5000);
  }
}

代码示例来源:origin: stackoverflow.com

public class LatestNewsFragment extends Fragment implements OnRefreshListener ,OnScrollListener{
 SwipeRefreshLayout swipeLayout;
 public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) 
 {
   =
   View rootView = inflater.inflate(R.layout.Swipe_Refresh_layout, container, false);
   swipeLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipe_container);
   swipeLayout.setOnRefreshListener(this);
   swipeLayout.setColorScheme(android.R.color.holo_blue_bright, 
       android.R.color.holo_green_light, 
       android.R.color.holo_orange_light, 
       android.R.color.holo_red_light);
   return rootView;
 }
 public void onRefresh() {
   new Handler().postDelayed(new Runnable() {
     @Override public void run() {
       swipeLayout.setRefreshing(false);
       additemstatus();
     }
   }, 5000);
 }

代码示例来源:origin: stackoverflow.com

swipeLayout.setColorScheme(android.R.color.holo_blue_bright,
    android.R.color.holo_green_light,
    android.R.color.holo_orange_light,

代码示例来源:origin: stackoverflow.com

mSwipeRefreshLayout.setColorScheme(R.color.blue,
 R.color.green, R.color.orange, R.color.purple);
mSwipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() {

代码示例来源:origin: stackoverflow.com

mSwipeRefreshLayout.setColorScheme(
    R.color.swipe_color_1, R.color.swipe_color_2,
    R.color.swipe_color_3, R.color.swipe_color_4);

代码示例来源:origin: stackoverflow.com

swipeLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipe_container);
swipeLayout.setOnRefreshListener(this);
swipeLayout.setColorScheme(android.R.color.holo_blue_bright, 
    android.R.color.holo_green_light, 
    android.R.color.holo_orange_light,

代码示例来源:origin: stackoverflow.com

mSwipeRefreshLayout.setColorScheme(
    R.color.swipe_color_1, R.color.swipe_color_2,
    R.color.swipe_color_3, R.color.swipe_color_4);

代码示例来源:origin: AppLozic/Applozic-Android-SDK

swipeLayout.setColorScheme(android.R.color.holo_blue_bright,
    android.R.color.holo_green_light,
    android.R.color.holo_orange_light,

代码示例来源:origin: AppLozic/Applozic-Android-SDK

swipeLayout.setColorScheme(android.R.color.holo_blue_bright,
    android.R.color.holo_green_light,
    android.R.color.holo_orange_light,

代码示例来源:origin: blockchain/Android-Merchant-App

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View rootView = inflater.inflate(getResources().getLayout(R.layout.fragment_transaction), container, false);
  initListView(rootView);
  merchantXpub = PrefsUtil.getInstance(getActivity()).getValue(PrefsUtil.MERCHANT_KEY_MERCHANT_RECEIVER, "");
  push_notifications = PrefsUtil.getInstance(getActivity()).getValue(PrefsUtil.MERCHANT_KEY_PUSH_NOTIFS, false);
  doBTC = PrefsUtil.getInstance(getActivity()).getValue(PrefsUtil.MERCHANT_KEY_CURRENCY_DISPLAY, false);
  btc_font = TypefaceUtil.getInstance(getActivity()).getTypeface();
  swipeLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipe_container);
  swipeLayout.setProgressViewEndTarget(false, (int) (getResources().getDisplayMetrics().density * (72 + 20)));
  swipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
    @Override
    public void onRefresh() {
      new GetDataTask().execute();
    }
  });
  swipeLayout.setColorScheme(R.color.blockchain_blue,
      R.color.blockchain_green,
      R.color.blockchain_dark_blue);
  thisActivity = getActivity();
  return rootView;
}

相关文章