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


Java SwipyRefreshLayoutDirection类代码示例

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


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


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