use of com.cjj.MaterialRefreshListener in project Android-MaterialRefreshLayout by android-cjj.
the class ScrollViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_scrollview);
materialRefreshLayout = (MaterialRefreshLayout) findViewById(R.id.refresh);
materialRefreshLayout.setMaterialRefreshListener(new MaterialRefreshListener() {
@Override
public void onRefresh(final MaterialRefreshLayout materialRefreshLayout) {
materialRefreshLayout.postDelayed(new Runnable() {
@Override
public void run() {
materialRefreshLayout.finishRefresh();
}
}, 3000);
materialRefreshLayout.finishRefreshLoadMore();
}
@Override
public void onfinish() {
Toast.makeText(ScrollViewActivity.this, "finish", Toast.LENGTH_LONG).show();
}
});
}
use of com.cjj.MaterialRefreshListener in project Android-MaterialRefreshLayout by android-cjj.
the class SimpleActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_simple);
initsToolbar();
materialRefreshLayout = (MaterialRefreshLayout) findViewById(R.id.refresh);
materialRefreshLayout.setMaterialRefreshListener(new MaterialRefreshListener() {
@Override
public void onRefresh(final MaterialRefreshLayout materialRefreshLayout) {
materialRefreshLayout.postDelayed(new Runnable() {
@Override
public void run() {
materialRefreshLayout.finishRefresh();
}
}, 3000);
materialRefreshLayout.finishRefreshLoadMore();
}
@Override
public void onfinish() {
Toast.makeText(SimpleActivity.this, "finish", Toast.LENGTH_LONG).show();
}
});
RecyclerView rv = (RecyclerView) findViewById(R.id.recyclerview);
setupRecyclerView(rv);
}
use of com.cjj.MaterialRefreshListener in project Android-MaterialRefreshLayout by android-cjj.
the class SunActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_listview);
String[] array = new String[50];
for (int i = 0; i < array.length; i++) {
array[i] = "啊哈哈哈哈哈 " + i;
}
final ListView listView = (ListView) findViewById(R.id.lv);
listView.setAdapter(new android.widget.ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, array));
materialRefreshLayout = (MaterialRefreshLayout) findViewById(R.id.refresh);
materialRefreshLayout.setSunStyle(true);
materialRefreshLayout.setMaterialRefreshListener(new MaterialRefreshListener() {
@Override
public void onRefresh(final MaterialRefreshLayout materialRefreshLayout) {
materialRefreshLayout.postDelayed(new Runnable() {
@Override
public void run() {
materialRefreshLayout.finishRefresh();
}
}, 3000);
}
@Override
public void onfinish() {
Toast.makeText(SunActivity.this, "finish", Toast.LENGTH_LONG).show();
}
});
}
use of com.cjj.MaterialRefreshListener in project Android-MaterialRefreshLayout by android-cjj.
the class WaveActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_simple);
initsToolbar();
materialRefreshLayout = (MaterialRefreshLayout) findViewById(R.id.refresh);
materialRefreshLayout.setWaveShow(true);
materialRefreshLayout.setWaveColor(Color.parseColor("#60ff2020"));
materialRefreshLayout.setMaterialRefreshListener(new MaterialRefreshListener() {
@Override
public void onRefresh(final MaterialRefreshLayout materialRefreshLayout) {
materialRefreshLayout.postDelayed(new Runnable() {
@Override
public void run() {
materialRefreshLayout.finishRefresh();
}
}, 3000);
materialRefreshLayout.finishRefreshLoadMore();
}
@Override
public void onfinish() {
Toast.makeText(WaveActivity.this, "finish", Toast.LENGTH_LONG).show();
}
});
RecyclerView rv = (RecyclerView) findViewById(R.id.recyclerview);
setupRecyclerView(rv);
}
use of com.cjj.MaterialRefreshListener in project Android-MaterialRefreshLayout by android-cjj.
the class OverLayActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_listview);
String[] array = new String[50];
for (int i = 0; i < array.length; i++) {
array[i] = "啊哈哈哈哈哈 " + i;
}
final ListView listView = (ListView) findViewById(R.id.lv);
listView.setAdapter(new android.widget.ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, array));
materialRefreshLayout = (MaterialRefreshLayout) findViewById(R.id.refresh);
materialRefreshLayout.setSunStyle(true);
materialRefreshLayout.setIsOverLay(true);
materialRefreshLayout.setMaterialRefreshListener(new MaterialRefreshListener() {
@Override
public void onRefresh(final MaterialRefreshLayout materialRefreshLayout) {
materialRefreshLayout.postDelayed(new Runnable() {
@Override
public void run() {
materialRefreshLayout.finishRefresh();
}
}, 3000);
}
@Override
public void onfinish() {
Toast.makeText(OverLayActivity.this, "finish", Toast.LENGTH_LONG).show();
}
});
}
Aggregations