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


Java ActionBarPullToRefresh.SetupWizard方法代码示例

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


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

示例1: onCreateView

import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入方法依赖的package包/类
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState, boolean refresh) {
    View layout = inflater.inflate(getLayoutRes(), container, false);

    pullToRefreshLayout = (PullToRefreshLayout) layout.findViewById(R.id.ptr_layout);
    ActionBarPullToRefresh.SetupWizard setupWizard = ActionBarPullToRefresh.from(getActivity());
    setupWizard.allChildrenArePullable();
    setupWizard.listener(new OnRefreshListener() {
        @Override
        public void onRefreshStarted(View view) {
            refresh();
        }
    });

    setupWizard.setup(pullToRefreshLayout);
    setupWizard.options(Options.create().scrollDistance(0.75f).build());
    if (refresh) {
        refresh();
    }
    return layout;
}
 
开发者ID:tommynyquist,项目名称:codereview.chromium,代码行数:21,代码来源:BaseListFragment.java

示例2: onCreateView

import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View layout = inflater.inflate(getLayoutRes(), container, false);
    pullToRefreshLayout = (PullToRefreshLayout) layout.findViewById(R.id.ptr_layout);
    ActionBarPullToRefresh.SetupWizard setupWizard = ActionBarPullToRefresh.from(getActivity());
    setupWizard.allChildrenArePullable();
    setupWizard.listener(new OnRefreshListener() {
        @Override
        public void onRefreshStarted(View view) {
            refresh();
        }
    });

    setupWizard.setup(pullToRefreshLayout);
    setupWizard.options(Options.create().scrollDistance(0.75f).build());
    refresh();
    return layout;
}
 
开发者ID:tommynyquist,项目名称:codereview.chromium,代码行数:19,代码来源:BaseFragment.java

示例3: onCreateView

import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入方法依赖的package包/类
@Override
public
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
    super.onCreateView(inflater, container, savedInstanceState);

    FeedsActivity activity = (FeedsActivity) getActivity();
    PullToRefreshLayout layout = (PullToRefreshLayout) inflater.inflate(R.layout.viewpager, container, false);

    // Find and configure the ViewPager.
    s_viewPager = (ViewPager) layout.findViewById(R.id.viewpager);
    s_viewPager.setOffscreenPageLimit(128);
    s_viewPager.setOnPageChangeListener(new OnPageChangeListener());

    // Create the Options object for the ActionBarPullToRefresh SetupWizard.
    Options.Builder optionsBuilder = Options.create();
    optionsBuilder.scrollDistance(PULL_DISTANCE);
    Options options = optionsBuilder.build();

    // Create the ActionBarPullToRefresh object using its SetupWizard.
    ActionBarPullToRefresh.SetupWizard setup = ActionBarPullToRefresh.from(activity);
    setup.allChildrenArePullable();
    setup.options(options);
    setup.useViewDelegate(ViewPager.class, new ViewPagerDelegate());
    setup.listener(new RefreshListener(activity));
    setup.setup(layout);

    return layout;
}
 
开发者ID:DarkangelKid,项目名称:rss,代码行数:30,代码来源:FragmentFeeds.java

示例4: onCreateView

import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_photo_stream, container, false);

    mPullToRefreshLayout = (PullToRefreshLayout) rootView.findViewById(R.id.ptr_layout);
    ActionBarPullToRefresh.SetupWizard setupWizard = ActionBarPullToRefresh.from(getActivity())
            .allChildrenArePullable()
            .listener(this);

    if (mSeries.getType() >= 0) {
        setupWizard.allChildrenArePullable();
    } else if (mSeries.getType() == -1) {
        setupWizard.theseChildrenArePullable(0);
        List<Belle> list = loadCollectedBelles();
        if (list != null) {
            mBelles.addAll(list);
        }
    }

    setupWizard.setup(mPullToRefreshLayout);

    mGridView = (GridView) rootView.findViewById(R.id.grid_view);
    mPhotoStreamAdapter = new PhotoStreamAdapter(getActivity(), mBelles);
    mGridView.setAdapter(mPhotoStreamAdapter);

    mGridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
            ArrayList<String> uriList = new ArrayList<String>();
            for (Belle belle : mBelles) {
                uriList.add(belle.url);
            }
            GalleryActivity.startViewLarge(getActivity(), mSeries.getTitle(), uriList, i);
        }
    });

    if (mSeries.getType() >= 0) {
        mBelleHelper.getBelleListFromLocal(mSeries.getType());
    }

    return rootView;
}
 
开发者ID:zhangdi0917,项目名称:SexyBelle,代码行数:43,代码来源:PhotoStreamFragment.java


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