private void initRefreshLayout() { mRefreshLayout.setWaveColor(0x000); mRefreshLayout.setIsOverLay(true); mRefreshLayout.setWaveShow(true); mRefreshLayout.setLoadMore(true); mRefreshLayout.setMaterialRefreshListener( new MaterialRefreshListener() { @Override public void onRefresh(MaterialRefreshLayout materialRefreshLayout) { new Handler() .postDelayed( new Runnable() { @Override public void run() { mRefreshLayout.finishRefresh(); } }, 2000); } @Override public void onRefreshLoadMore(MaterialRefreshLayout materialRefreshLayout) { new Handler() .postDelayed( new Runnable() { @Override public void run() { mRefreshLayout.finishRefreshLoadMore(); } }, 2000); } }); }
@Override public boolean onMenuItemClick(MenuItem menuItem) { switch (menuItem.getItemId()) { case R.id.style0: materialRefreshLayout.setWaveColor(0xff8BC34A); materialRefreshLayout.setIsOverLay(false); materialRefreshLayout.setWaveShow(true); materialRefreshLayout.setShowProgressBg(true); materialRefreshLayout.setProgressColors( getResources().getIntArray(R.array.material_colors)); materialRefreshLayout.setShowArrow(true); break; case R.id.style1: break; // case R.id.style2: // materialRefreshLayout.setWaveColor(0x90ffffff); // materialRefreshLayout.setIsOverLay(true); // materialRefreshLayout.setWaveShow(true); // materialRefreshLayout.setShowProgressBg(true); // // materialRefreshLayout.setProgressColors(getResources().getIntArray(R.array.material_colors)); // materialRefreshLayout.setShowArrow(true); // break; // case R.id.style3: // materialRefreshLayout.setWaveColor(0xff8BC34A); // materialRefreshLayout.setIsOverLay(false); // materialRefreshLayout.setWaveShow(true); // materialRefreshLayout.setShowProgressBg(true); // // materialRefreshLayout.setProgressColors(getResources().getIntArray(R.array.material_colors)); // materialRefreshLayout.setShowArrow(true); // break; } return true; }