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


Java SwipyRefreshLayout类代码示例

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


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

示例1: initSwipyRefreshLayout

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; //导入依赖的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.SwipyRefreshLayout; //导入依赖的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.SwipyRefreshLayout; //导入依赖的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.SwipyRefreshLayout; //导入依赖的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.SwipyRefreshLayout; //导入依赖的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.SwipyRefreshLayout; //导入依赖的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.SwipyRefreshLayout; //导入依赖的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: onCreate

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    mType = getIntent().getStringExtra("type");
    mUrl = MainActivity.THE_PAGE + "%2F" + mType;

    super.onCreate(savedInstanceState);
    setTitle(mType+" apk");
    setContentView(R.layout.activity_detail);

    //Refresh
    mRefreshLayout = (SwipyRefreshLayout) findViewById(R.id.detail_refresh);
    mRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_dark);
    mRefreshLayout.setOnRefreshListener(onRefreshListener);

    //List
    mLvContent = (ListView) findViewById(R.id.detail_apk_list_lv);
    mData = new ArrayList<>();
    mAdapter = new ApkListAdapter(this, mData);
    mLvContent.setAdapter(mAdapter);
    mHandler = new Handler();
    mLvContent.setOnItemClickListener(this);

    //Do initial request
    update(mUrl);
}
 
开发者ID:leibing8912,项目名称:CzhInstaller,代码行数:26,代码来源:DetailActivity.java

示例9: initSwipyRefreshLayout

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; //导入依赖的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

示例10: initSwipyRefreshLayout

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; //导入依赖的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

示例11: setSwipyRefreshLayout

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; //导入依赖的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

示例12: waitSwipyRefresh

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; //导入依赖的package包/类
public static void waitSwipyRefresh() {
    w(3000);
    onView(withId(R.id.swipe_refresh_layout)).perform(new ViewAction() {
        @Override
        public Matcher<View> getConstraints() {
            return ViewMatchers.isAssignableFrom(SwipyRefreshLayout.class);
        }

        @Override
        public String getDescription() {
            return "get text from edit text view:";
        }

        @Override
        public void perform(UiController uiController, View view) {
            uiController.loopMainThreadUntilIdle();
            SwipyRefreshLayout swipy = (SwipyRefreshLayout) view;
            while (swipy.isRefreshing()) {
                uiController.loopMainThreadUntilIdle();
                uiController.loopMainThreadForAtLeast(1000);
            }
        }
    });
}
 
开发者ID:BioStar2,项目名称:BioStar2Android,代码行数:25,代码来源:ExtTest.java

示例13: initRefreshLayout

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; //导入依赖的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

示例14: initRefreshLayout

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; //导入依赖的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

示例15: setRefreshing

import com.orangegangsters.github.swipyrefreshlayout.library.SwipyRefreshLayout; //导入依赖的package包/类
@BindingAdapter("app:isRefreshing")
public static void setRefreshing(final SwipyRefreshLayout swipyRefreshLayout, final Boolean isRefreshing) {
    swipyRefreshLayout.post(new Runnable() {
        @Override
        public void run() {
            swipyRefreshLayout.setRefreshing(isRefreshing);
        }
    });
}
 
开发者ID:daquexian,项目名称:chaoli-forum-for-android-2,代码行数:10,代码来源:SwipyRefreshBA.java


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