HomeSketchwareSwipe Refresh Listview in Chat app

Swipe Refresh Listview in Chat app

1) Create a new sketchware project.

2) Drag and Drop Linear Layout with id linear1 and height match_parent.

3) Drag Drop ListView with id wb inside that Linear Layout linear1.

4) Create a new custom xml layout.
Add a TextView with id textview1.

5) Enable AppCompat and Design Library and also Firebase Library.

6) In ListView add custom view as your Custom View.

7) Add a Firebase Component with name as your choice and a ListMap map.

8)In wb  BindCustomView add as your choice.

9)In on Create event do as below:-

First ASD code is:-
final android.support.v4.widget.SwipeRefreshLayout sr = new android.support.v4.widget.SwipeRefreshLayout(this);
sr.setLayoutParams(new LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.MATCH_PARENT, android.widget.LinearLayout.LayoutParams.MATCH_PARENT));
linear1.addView(sr);
linear1.removeView(wb);
linear1.post(new Runnable() {
@Override public void run() {
sr.addView(wb);
}
}); 

sr.setOnRefreshListener( new android.support.v4.widget.SwipeRefreshLayout.OnRefreshListener() {
@Override public void onRefresh() { 



Second ASD Code is:-

sr.setRefreshing(false);


Third ASD code is:-

 }
});


THAT’S ALL.
Save and Run project.


Leave a Reply