• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SwipyRefreshLayoutDirection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection的典型用法代码示例。如果您正苦于以下问题:Java SwipyRefreshLayoutDirection类的具体用法?Java SwipyRefreshLayoutDirection怎么用?Java SwipyRefreshLayoutDirection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SwipyRefreshLayoutDirection类属于com.orangegangsters.github.swipyrefreshlayout.library包,在下文中一共展示了SwipyRefreshLayoutDirection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initSwipyRefreshLayout

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initSwipyRefreshLayout(View v) {
    swipyRefreshLayout = (SwipyRefreshLayout) v.findViewById(R.id.swipyrefreshlayout);
    swipyRefreshLayout.setColorSchemeResources(
            android.R.color.holo_blue_light,
            android.R.color.holo_red_light,
            android.R.color.holo_orange_light,
            android.R.color.holo_green_light);
    swipyRefreshLayout.setDirection(SwipyRefreshLayoutDirection.BOTH);

    /*swipyRefreshLayout.measure(0, 0);
    swipyRefreshLayout.setRefreshing(true);*/

    swipyRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh(SwipyRefreshLayoutDirection direction) {
            isTop = (direction == SwipyRefreshLayoutDirection.TOP ? true : false);
            if (isTop) {
                NOW_PAGE_NUM = 1;
            }
            gankPresenterImpl.getGankDataFromInternet(isTop, mTitle, AppConstant.GAN_DATA_NUM, NOW_PAGE_NUM);

        }
    });

}
 
开发者ID:lueans,项目名称:LueansRead,代码行数:26,代码来源:GankFragment.java


示例2: initSwipyRefreshLayout

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initSwipyRefreshLayout(View v) {
        swipyRefreshLayout = (SwipyRefreshLayout) v.findViewById(R.id.swipyrefreshlayout);
        swipyRefreshLayout.setColorSchemeResources(
                android.R.color.holo_blue_light,
                android.R.color.holo_red_light,
                android.R.color.holo_orange_light,
                android.R.color.holo_green_light);
        swipyRefreshLayout.setDirection(SwipyRefreshLayoutDirection.BOTH);

       /* swipyRefreshLayout.measure(0, 0);
        swipyRefreshLayout.setRefreshing(true);*/

        swipyRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
            @Override
            public void onRefresh(SwipyRefreshLayoutDirection direction) {
                isTop = (direction == SwipyRefreshLayoutDirection.TOP ? true : false);
//                gankPresenterImpl.getGankDataFromInternet(isTop,mTitle, AppConstant.GAN_DATA_NUM,NOW_PAGE_NUM);
                int index = mSoListAdapter.getItemCount();
                if (isTop) {
                    index = 0;
                }
                mSoPresenter.getSoDataFromInternet(isTop, soType.get(mTitle), index, "new");
            }
        });
    }
 
开发者ID:lueans,项目名称:LueansRead,代码行数:26,代码来源:SoFragment.java


示例3: initSwipyRefreshLayout

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initSwipyRefreshLayout(View v) {
    swipyRefreshLayout = (SwipyRefreshLayout) v.findViewById(R.id.swipyrefreshlayout);
    swipyRefreshLayout.setColorSchemeResources(
            android.R.color.holo_blue_light,
            android.R.color.holo_red_light,
            android.R.color.holo_orange_light,
            android.R.color.holo_green_light);
    /*swipyRefreshLayout.measure(0,0);
    swipyRefreshLayout.setRefreshing(true);*/
    swipyRefreshLayout.setDirection(SwipyRefreshLayoutDirection.BOTH);
    swipyRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh(SwipyRefreshLayoutDirection direction) {
            isTop = (direction == SwipyRefreshLayoutDirection.TOP ? true : false);
            if (isTop) {
                NOW_PAGE = 0;
            }
            mNewsPresenter.getNewsDataFromInternet(isTop, mType, mId, (int) (NOW_PAGE * 20));
        }
    });

}
 
开发者ID:lueans,项目名称:LueansRead,代码行数:23,代码来源:NewsFragment.java


示例4: initSwipyRefreshLayout

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initSwipyRefreshLayout() {
    swipyRefreshLayout = (SwipyRefreshLayout)findViewById(R.id.swipyrefreshlayout);
    swipyRefreshLayout.setColorSchemeResources(
            android.R.color.holo_blue_light,
            android.R.color.holo_red_light,
            android.R.color.holo_orange_light,
            android.R.color.holo_green_light);

    swipyRefreshLayout.measure(0,0);
    swipyRefreshLayout.setRefreshing(true);

    swipyRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh(SwipyRefreshLayoutDirection direction) {
            boolean isTop = (direction == SwipyRefreshLayoutDirection.TOP ? true : false);
            //                gankPresenterImpl.getGankDataFromInternet(isTop,mTitle, AppConstant.GAN_DATA_NUM,NOW_PAGE_NUM);
           soDetailPresenter.getSoDetailDataFromInternet(_id);
        }
    });


}
 
开发者ID:lueans,项目名称:LueansRead,代码行数:23,代码来源:SoDetailActivity.java


示例5: initSwipyRefreshLayout

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initSwipyRefreshLayout() {

        swipyRefreshLayout = (SwipyRefreshLayout) findViewById(R.id.swipyrefreshlayout);
        swipyRefreshLayout.setColorSchemeResources(
                android.R.color.holo_blue_light,
                android.R.color.holo_red_light,
                android.R.color.holo_orange_light,
                android.R.color.holo_green_light);
        swipyRefreshLayout.setDirection(SwipyRefreshLayoutDirection.TOP);

        swipyRefreshLayout.measure(0, 0);
        swipyRefreshLayout.setRefreshing(true);

        swipyRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
            @Override
            public void onRefresh(SwipyRefreshLayoutDirection direction) {
                boolean isTop = (direction == SwipyRefreshLayoutDirection.TOP ? true : false);
                mDetailPresenter.getNewsDetail(postId);
            }
        });

    }
 
开发者ID:lueans,项目名称:LueansRead,代码行数:23,代码来源:NewsDetailActivity.java


示例6: initEvent

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initEvent() {
    mDialog = new SpotsDialog(this);
    mTitleCredit.setOnLeftButtonClickListener(new TabTitleView.OnLeftButtonClickListener() {
        @Override
        public void onClick() {
            MyTripsActivity.this.finish();
        }
    });
    mTitleCredit.setOnRightTextViewClickListener(new TabTitleView.OnRightButtonClickListener() {
        @Override
        public void onClick() {
            startActivity(new Intent(MyTripsActivity.this, LastTenTripHistoryActivity.class));
        }
    });
    mRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh(SwipyRefreshLayoutDirection direction) {
            requestData();
            if (mRefreshLayout.isRefreshing())
                mRefreshLayout.setRefreshing(false);

        }
    });
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:25,代码来源:MyTripsActivity.java


示例7: initRefreshLayout

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initRefreshLayout() {
    mRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh(SwipyRefreshLayoutDirection direction) {
            if (!CommonUtils.isNetworkAvailable(RechargeHistoryActivity.this)) {
                unavailableView.setVisibility(View.VISIBLE);
                mRefreshLayout.setRefreshing(false);
                return;
            }
            requestData();
            if (mRefreshLayout.isRefreshing())
                mRefreshLayout.setRefreshing(false);

        }
    });
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:17,代码来源:RechargeHistoryActivity.java


示例8: initSwipyRefreshLayout

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initSwipyRefreshLayout(View v) {
    swipyRefreshLayout = (SwipyRefreshLayout) v.findViewById(R.id.swipyrefreshlayout);
    swipyRefreshLayout.setColorSchemeResources(
            android.R.color.holo_blue_light,
            android.R.color.holo_red_light,
            android.R.color.holo_orange_light,
            android.R.color.holo_green_light);
    swipyRefreshLayout.setDirection(SwipyRefreshLayoutDirection.BOTH);

    swipyRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh(SwipyRefreshLayoutDirection direction) {
            Observable.timer(2, TimeUnit.SECONDS)
                    .observeOn(AndroidSchedulers.mainThread())
                    .subscribe(new Action1<Long>() {
                        @Override
                        public void call(Long aLong) {
                            swipyRefreshLayout.setRefreshing(false);
                        }
                    });
            loadData(direction == SwipyRefreshLayoutDirection.TOP ? true : false);

        }
    });

}
 
开发者ID:hugeterry,项目名称:coderfun,代码行数:27,代码来源:DiscoveryFragment.java


示例9: initSwipyRefreshLayout

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initSwipyRefreshLayout() {
    swipyRefreshLayout = (SwipyRefreshLayout) findViewById(R.id.swipyrefreshlayout);
    swipyRefreshLayout.setColorSchemeResources(
            android.R.color.holo_blue_light,
            android.R.color.holo_red_light,
            android.R.color.holo_orange_light,
            android.R.color.holo_green_light);
    swipyRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh(SwipyRefreshLayoutDirection direction) {
            Observable.timer(2, TimeUnit.SECONDS)
                    .observeOn(AndroidSchedulers.mainThread())
                    .subscribe(new Action1<Long>() {
                        @Override
                        public void call(Long aLong) {
                            swipyRefreshLayout.setRefreshing(false);
                        }
                    });
            webView.loadUrl(url);
            loadingView.setVisibility(View.GONE);
        }
    });

}
 
开发者ID:hugeterry,项目名称:coderfun,代码行数:25,代码来源:WebAcitivity.java


示例10: onRefresh

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
/**
 * Called when the {@link com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout}
 * is in refresh mode. Just for example purpose.
 */
@Override
public void onRefresh(SwipyRefreshLayoutDirection direction) {
    Log.d("MainActivity", "Refresh triggered at "
            + (direction == SwipyRefreshLayoutDirection.TOP ? "top" : "bottom"));
    new Handler().postDelayed(new Runnable() {
        @Override
        public void run() {
            //Hide the refresh after 2sec
            MainActivity.this.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    mSwipyRefreshLayout.setRefreshing(false);
                }
            });
        }
    }, 2000);
}
 
开发者ID:wqsflying,项目名称:SwipyRefreshLayou,代码行数:22,代码来源:MainActivity.java


示例11: onRefresh

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
/**
 * Called when the {@link com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout}
 * is in refresh mode. Just for example purpose.
 */
@Override
public void onRefresh(SwipyRefreshLayoutDirection direction) {
    Log.d("MainActivity", "Refresh triggered at "
            + (direction == SwipyRefreshLayoutDirection.TOP ? "top" : "bottom"));
    new Handler().postDelayed(new Runnable() {
        @Override
        public void run() {
            //Hide the refresh after 2sec
            MainActivity.this.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    mBinding.swipyrefreshlayout.setRefreshing(false);
                }
            });
        }
    }, DISMISS_TIMEOUT);
}
 
开发者ID:omadahealth,项目名称:SwipyRefreshLayout,代码行数:22,代码来源:MainActivity.java


示例12: getItems

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
@Override
public void getItems(String query) {
    mQuery = query;
    mOffset = 0;
    mTotal = 0;
    mAddedCount = 0;
    mRemovedCount = 0;
    mLimit = FIRST_LIMIT;
    mHandler.removeCallbacks(mRunGetItems);
    clearRequest();
    showWait(SwipyRefreshLayoutDirection.TOP);
    if (mItems != null) {
        mItems.clear();
        notifyDataSetChanged();
    }
    mHandler.postDelayed(mRunGetItems, 500);
}
 
开发者ID:BioStar2,项目名称:BioStar2Android,代码行数:18,代码来源:BaseDeviceAdapter.java


示例13: getItems

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
@Override
    public void getItems(String query) {
        mQuery = query;
        mLimit = FIRST_LIMIT;
        mHandler.removeCallbacks(mRunGetItems);
        clearRequest();
//        mLastModify = String.valueOf(System.currentTimeMillis());
        mOffset = 0;
        mTotal = 0;
        if (mItems != null) {
            mItems.clear();
            notifyDataSetChanged();
        }
        showWait(SwipyRefreshLayoutDirection.TOP);
        mHandler.removeCallbacks(mRunGetItems);
        mHandler.postDelayed(mRunGetItems, 500);
    }
 
开发者ID:BioStar2,项目名称:BioStar2Android,代码行数:18,代码来源:BaseUserAdapter.java


示例14: setSwipyRefreshLayout

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
public void setSwipyRefreshLayout(SwipyRefreshLayout swipyRefreshLayout, FloatingActionButton fab) {
    BaseListViewScroll onScroll = new BaseListViewScroll();
    onScroll.setFloatingActionButton(fab, mListView, this);
    setOnScrollListener(onScroll);
    mSwipyRefreshLayout = swipyRefreshLayout;
    mSwipyRefreshLayout.setEnableBottom(false);
    mSwipyRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh(SwipyRefreshLayoutDirection direction) {
            switch (direction) {
                case TOP:
                    notifyDataSetChanged();
                    break;
                case BOTTOM:
                    mSwipyRefreshLayout.setRefreshing(false);
                    mToastPopup.show(mContext.getString(R.string.no_more_data), null);
                    break;
                default:
                    break;
            }
        }
    });
}
 
开发者ID:BioStar2,项目名称:BioStar2Android,代码行数:24,代码来源:AlarmAdapter.java


示例15: initRefreshLayout

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initRefreshLayout() {
    mRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh(SwipyRefreshLayoutDirection direction) {
            requestPoketData();
            if (mRefreshLayout.isRefreshing())
                mRefreshLayout.setRefreshing(false);

        }
    });
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:12,代码来源:RedPocketDetailActivity.java


示例16: initRefreshLayout

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void initRefreshLayout() {
    //        mRefreshLayout.setLoadMore(true);
    //        mRefreshLayout.setMaterialRefreshListener(new MaterialRefreshListener() {
    //            @Override
    //            public void onRefresh(MaterialRefreshLayout materialRefreshLayout) {
    //                requestMassage();
    //                mRecyclerMassage.scrollToPosition(0);
    //                mRefreshLayout.finishRefresh();
    //            }
    //
    //            @Override
    //            public void onRefreshLoadMore(MaterialRefreshLayout materialRefreshLayout) {
    //                requestMassage();//实际活动较少,上下拉刷新不需要分页
    //                mRefreshLayout.finishRefreshLoadMore();
    //            }
    //
    //        });

    mRefreshLayout.setOnRefreshListener(new SwipyRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh(SwipyRefreshLayoutDirection direction) {
            requestMassage();
            if (mRefreshLayout.isRefreshing())
                mRefreshLayout.setRefreshing(false);

        }
    });
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:29,代码来源:MyMessagesActivity.java


示例17: onRefresh

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
@Override
public void onRefresh(SwipyRefreshLayoutDirection direction) {
    if (direction == SwipyRefreshLayoutDirection.TOP) {
        viewModel.refresh();
    } else {
        viewModel.loadMore();
    }
}
 
开发者ID:daquexian,项目名称:chaoli-forum-for-android-2,代码行数:9,代码来源:HistoryFragment.java


示例18: requestDataRefresh

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
@Override
public void requestDataRefresh(SwipyRefreshLayoutDirection direction) {
    if (direction.equals(SwipyRefreshLayoutDirection.TOP)) {
        //顶部刷新需要清空原来的队列
        mPresenter.getJokeData(3, ++page, true);
    } else {
        mPresenter.getJokeData(3, ++page, false);
    }

}
 
开发者ID:duanyikang,项目名称:GuoguoCircle,代码行数:11,代码来源:JokeFragment.java


示例19: setupSwipeRefreshLayout

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void setupSwipeRefreshLayout() {
    //设置卷内的颜色
    swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright, android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light);
    swipeRefreshLayout.setDirection(SwipyRefreshLayoutDirection.BOTH);
    //设置下拉刷新监听
    swipeRefreshLayout.setOnRefreshListener((direction) -> {


        clearAdapterCache(direction);
        clearDbCache();
        loadData(currentPage);
    });


}
 
开发者ID:overlooping,项目名称:GankMeizhi,代码行数:16,代码来源:GankFragment.java


示例20: clearAdapterCache

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection; //导入依赖的package包/类
private void clearAdapterCache(SwipyRefreshLayoutDirection direction) {
    if (direction == SwipyRefreshLayoutDirection.TOP) {
        currentPage = Constants.START;
        if (allAdapter != null) {
            allAdapter.getDatas().clear();
        }
        if (meizhiAdapter != null) {
            meizhiAdapter.getDatas().clear();
        }
    }
}
 
开发者ID:overlooping,项目名称:GankMeizhi,代码行数:12,代码来源:GankFragment.java



注:本文中的com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IAEItemStack类代码示例发布时间:2022-05-22
下一篇:
Java FTPConnectMode类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap