当前位置: 首页>>代码示例>>Java>>正文


Java SwipeRefreshLayout.isRefreshing方法代码示例

本文整理汇总了Java中android.support.v4.widget.SwipeRefreshLayout.isRefreshing方法的典型用法代码示例。如果您正苦于以下问题:Java SwipeRefreshLayout.isRefreshing方法的具体用法?Java SwipeRefreshLayout.isRefreshing怎么用?Java SwipeRefreshLayout.isRefreshing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v4.widget.SwipeRefreshLayout的用法示例。


在下文中一共展示了SwipeRefreshLayout.isRefreshing方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: controlRefresh

import android.support.v4.widget.SwipeRefreshLayout; //导入方法依赖的package包/类
/**
 * 控制刷新
 * @param refreshLayout
 * @param isRefresh
 */
public static void controlRefresh(SwipeRefreshLayout refreshLayout, boolean isRefresh) {
    if (refreshLayout != null) {
        if (isRefresh != refreshLayout.isRefreshing()) {
            refreshLayout.setRefreshing(isRefresh);
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:SwipeRefreshHelper.java

示例2: onScrollStateChanged

import android.support.v4.widget.SwipeRefreshLayout; //导入方法依赖的package包/类
@Override
public void onScrollStateChanged(int state) {
    super.onScrollStateChanged(state);
    switch (state) {
        case SCROLL_STATE_IDLE:
            LayoutManager layoutManager = getLayoutManager();
            int itemCount = getAdapter().getItemCount();
            int lastVisibleItemPosition = 0;

            if (layoutManager instanceof GridLayoutManager) {
                GridLayoutManager gridLayoutManager = (GridLayoutManager) layoutManager;
                lastVisibleItemPosition = gridLayoutManager.findLastVisibleItemPosition();
            } else if (layoutManager instanceof LinearLayoutManager) {
                LinearLayoutManager linearLayoutManager = (LinearLayoutManager) layoutManager;
                lastVisibleItemPosition = linearLayoutManager.findLastVisibleItemPosition();
            }

            if (lastVisibleItemPosition >= itemCount - 1) {
                if (getParent() instanceof SwipeRefreshLayout) {
                    SwipeRefreshLayout swipeRefreshLayout = (SwipeRefreshLayout) getParent();
                    if (swipeRefreshLayout.isRefreshing()) {
                        break;
                    }
                }

                if (mOnLoadMoreListener != null && mScrollDy > 0) {
                    if (!mIsLoadingMore) {
                        synchronized (EnhanceRecyclerView.class) {
                            if (!mIsLoadingMore) {
                                mIsLoadingMore = true;
                                mInternalAdapter.setFootViewVisible(true);
                                mOnLoadMoreListener.onLoadMore();
                            }
                        }
                    }
                }
            }
            break;
    }
}
 
开发者ID:Sugarya,项目名称:Closet,代码行数:41,代码来源:EnhanceRecyclerView.java

示例3: setRefreshing

import android.support.v4.widget.SwipeRefreshLayout; //导入方法依赖的package包/类
/**
 * Enable/Disable refreshing state of SwipeRefreshLayout
 *
 * @param swipeRefreshLayout
 * @param setRefresh
 */
public static void setRefreshing(SwipeRefreshLayout swipeRefreshLayout, boolean setRefresh) {
    if (swipeRefreshLayout != null) {
        boolean isRefreshing = swipeRefreshLayout.isRefreshing();

        if (setRefresh) {
            if (!isRefreshing) swipeRefreshLayout.setRefreshing(true);
        } else {
            if (isRefreshing) swipeRefreshLayout.setRefreshing(false);
        }
    }
}
 
开发者ID:teeeeeegz,项目名称:DuckDuckDefine-Android,代码行数:18,代码来源:ViewUtil.java

示例4: stopRefresh

import android.support.v4.widget.SwipeRefreshLayout; //导入方法依赖的package包/类
/**
 * 停止刷新
 *
 * @param refreshLayout SwipeRefreshLayout
 */
public static void stopRefresh(SwipeRefreshLayout refreshLayout) {
  if (refreshLayout != null && refreshLayout.isRefreshing()) {
    refreshLayout.setRefreshing(false);
  }
}
 
开发者ID:liuguoquan727,项目名称:android-study,代码行数:11,代码来源:CommonUtils.java


注:本文中的android.support.v4.widget.SwipeRefreshLayout.isRefreshing方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。