下面列出了android.widget.ListView#getVisibility ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* As mentioned above, we need to override this method to properly signal when a
* 'swipe-to-refresh' is possible.
*
* @return true if the {@link android.widget.ListView} is visible and can scroll up.
*/
@Override
public boolean canChildScrollUp() {
final ListView listView = getListView();
if (listView.getVisibility() == View.VISIBLE) {
return canListViewScrollUp(listView);
} else {
return false;
}
}
/**
* As mentioned above, we need to override this method to properly signal when a
* 'swipe-to-refresh' is possible.
*
* @return true if the {@link android.widget.ListView} is visible and can scroll up.
*/
@Override
public boolean canChildScrollUp() {
final ListView listView = getListView();
if (listView.getVisibility() == View.VISIBLE) {
return canListViewScrollUp(listView);
} else {
return false;
}
}
/**
* As mentioned above, we need to override this method to properly signal when a
* 'swipe-to-refresh' is possible.
*
* @return true if the {@link android.widget.ListView} is visible and can scroll up.
*/
@Override
public boolean canChildScrollUp() {
final ListView listView = getListView();
if (listView.getVisibility() == View.VISIBLE) {
return canListViewScrollUp(listView);
} else {
return false;
}
}
/**
* As mentioned above, we need to override this method to properly signal when a
* 'swipe-to-refresh' is possible.
*
* @return true if the {@link android.widget.ListView} is visible and can scroll up.
*/
@Override
public boolean canChildScrollUp() {
final ListView listView = getListView();
if (listView.getVisibility() == View.VISIBLE) {
return canListViewScrollUp(listView);
} else {
return false;
}
}
/**
* As mentioned above, we need to override this method to properly signal when a
* 'swipe-to-refresh' is possible.
*
* @return true if the {@link android.widget.ListView} is visible and can scroll up.
*/
@Override
public boolean canChildScrollUp() {
final ListView listView = getListView();
if (listView.getVisibility() == View.VISIBLE) {
return listView.canScrollVertically(-1);
} else {
return false;
}
}
@Override
public boolean canChildScrollUp() {
final ListView listView = getListView();
return listView.getVisibility() != View.VISIBLE || canListViewScrollUp(listView);
}