this is my xml code .As you can see ,there is a listview inside SwipeRefreshLayout .
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="#EEEEEE"
android:dividerHeight="10dp"
android:visibility="gone" >
</ListView>
</LinearLayout>
the problem is , when I scroll down and for example 20 new items add to my list ,I don't want to SwipeRefreshLayout calls in the middle of list ,I want user goes to the top of the list and if he was in the top of the list , then swiperefreshlayout calls .
this is the java code:
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
new GetContacts(0).execute();//
mSwipeRefreshLayout.setColorScheme(R.color.orange, R.color.green, R.color.blue, R.color.purple);
}
});
it calls for an asyncTask and when async finished ,it'll disappear
How can I only call for swiperefreshlayout when user reach at the top of the list?
thanks