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


Java ActionBarPullToRefresh类代码示例

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


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

示例1: onCreateView

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

    View rootView = inflater.inflate(R.layout.fragment_top_albums, container, false);

    gridView = (GridView) rootView.findViewById(R.id.gridview);

    networkRequest = new AlbumListNetworkAdapter(getActivity());
    networkRequest.execute(this.getString(R.string.albums_collection));

    pullToRefreshLayout = (PullToRefreshLayout) rootView.findViewById(R.id.ptr_layout);

    ActionBarPullToRefresh.from(getActivity())
            .listener(this)
            .allChildrenArePullable()
            .setup(pullToRefreshLayout);

    innerFrame.addView(rootView);

    return innerFrame;
}
 
开发者ID:whitneyimura,项目名称:MusicFlow,代码行数:24,代码来源:TopAlbumsFragment.java

示例2: initPullToRefreshLayout

import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
private void initPullToRefreshLayout() {
    Options.Builder ptrOptions = Options.create();
    ptrOptions.refreshOnUp(true);
    ptrOptions.scrollDistance(0.4f);

    ActionBarPullToRefresh.from(getActivity()).theseChildrenArePullable(R.id.timeline_list, R.id.loading_layout).options(ptrOptions.build()).
            listener(new OnRefreshListener() {
        @Override
        public void onRefreshStarted(View view) {
            initPageFromCache();
            mIsLastPage = false;
            if (mIsInFavArticle) {
                pullFavArticles(false);
            } else {
                pullTimeline();
            }

        }
    }).setup(mPullToRefreshLayout);
}
 
开发者ID:ragnraok,项目名称:MonoReader,代码行数:21,代码来源:TimelineFragment.java

示例3: onActivityCreated

import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    listView = (CardListView) getActivity().findViewById(R.id.carddemo_extra_list_actionbarpulltorefresh);

    initCard();

    // Retrieve the PullToRefreshLayout from the content view
    mPullToRefreshLayout = (PullToRefreshLayout) getActivity().findViewById(R.id.carddemo_extra_ptr_layout);

    // Now setup the PullToRefreshLayout
    ActionBarPullToRefresh.from(this.getActivity())
            // Mark All Children as pullable
            .allChildrenArePullable()
            // Set the OnRefreshListener
            .listener(this)
            // Finally commit the setup to our PullToRefreshLayout
            .setup(mPullToRefreshLayout);

}
 
开发者ID:tajchert,项目名称:CEEHack,代码行数:22,代码来源:ActionbarpullFragment.java

示例4: onCreate

import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mPullToRefreshLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);
    ActionBarPullToRefresh.from(this)
            .options(Options.create()
                    .scrollDistance(0.5f)
                    .headerLayout(R.layout.pong_header)
                    .headerTransformer(new PongHeaderTransformer())
                    .build())
            .allChildrenArePullable()
            .listener(this)
            .setup(mPullToRefreshLayout);
}
 
开发者ID:boztalay,项目名称:AndroidPullToPong,代码行数:17,代码来源:MainActivity.java

示例5: onViewCreated

import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view,savedInstanceState);
    ViewGroup viewGroup = (ViewGroup) view;

    // As we're using a ListFragment we create a PullToRefreshLayout manually
    mPullToRefreshLayout = new PullToRefreshLayout(viewGroup.getContext());

    // We can now setup the PullToRefreshLayout
    ActionBarPullToRefresh.from(getActivity())
            // We need to insert the PullToRefreshLayout into the Fragment's ViewGroup
            .insertLayoutInto(viewGroup)
            // Here we mark just the ListView and it's Empty View as pullable
            .theseChildrenArePullable(android.R.id.list, android.R.id.empty)
            .listener(this)
            .setup(mPullToRefreshLayout);
}
 
开发者ID:Mobideck,项目名称:appdeck-android,代码行数:18,代码来源:ListViewActivity.java

示例6: onCreateView

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

    // Now give the find the PullToRefreshLayout and set it up
    mPullToRefreshLayout = (PullToRefreshLayout) view.findViewById(R.id.ptr_layout);
    ActionBarPullToRefresh.from(getActivity())
            .allChildrenArePullable()
            .listener(this)
            .setup(mPullToRefreshLayout);

    // Set title in Fragment for display purposes.
    TextView title = (TextView) view.findViewById(R.id.tv_title);
    Bundle b = getArguments();
    if (b != null) {
        title.setText(b.getString(EXTRA_TITLE));
    }

    return view;
}
 
开发者ID:Mobideck,项目名称:appdeck-android,代码行数:23,代码来源:FragmentTabsActivity.java

示例7: onCreate

import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_webview);

    // Find WebView and get it ready to display pages
    mWebView = (WebView) findViewById(R.id.webview);
    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.setWebViewClient(new SampleWebViewClient());

    // Now find the PullToRefreshLayout and set it up
    mPullToRefreshLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);
    ActionBarPullToRefresh.from(this)
            .allChildrenArePullable()
            .listener(this)
            .setup(mPullToRefreshLayout);

    // Finally make the WebView load something...
    mWebView.loadUrl("http://www.google.com");
}
 
开发者ID:Mobideck,项目名称:appdeck-android,代码行数:21,代码来源:WebViewActivity.java

示例8: onActivityCreated

import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    ActionBarPullToRefresh.from(getActivity())
            .allChildrenArePullable()
            .listener(this)
            .setup(mPullToRefreshLayout);

    if(getArguments().containsKey("model")){
        mTopicModel = getArguments().getParcelable("model");
        mTopicId = mTopicModel.id;
        mHeaderView = new TopicView(getActivity());
        mHeaderView.setViewDetail();
        mHeaderView.parse(mTopicModel);
        mListView.addHeaderView(mHeaderView, mTopicModel, false);
        mListView.setAdapter(new LoadingAdapter(getActivity()));
        getReplyData();
    }else if(getArguments().containsKey("topic_id")){
        mTopicId = getArguments().getInt("topic_id");
        getTopicData();
    }
}
 
开发者ID:kyze8439690,项目名称:v2ex-daily-android,代码行数:24,代码来源:TopicFragment.java

示例9: onActivityCreated

import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    ActionBarPullToRefresh.from(getActivity())
            .allChildrenArePullable()
            .listener(this)
            .setup(mPullToRefreshLayout);

    if((mNodeId = getArguments().getInt("node_id", 0)) != 0){
        getData(false);
    }else{
        getActivity().finish();
    }

    NodeModel nodeModel = mAllNodesDataHelper.select(mNodeId);

    if(getActivity() instanceof NodeActivity && !nodeModel.isCollected){
        setHasOptionsMenu(true);
    }
}
 
开发者ID:kyze8439690,项目名称:v2ex-daily-android,代码行数:22,代码来源:NodeFragment.java

示例10: onCreate

import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_main);
	
	movieList = (ListView)findViewById(R.id.movieList);
	
	getMovieRatings();
	
	movieList.addFooterView(new View(this), null, false);
	movieList.addHeaderView(new View(this), null, false);
	
	// Now find the PullToRefreshLayout to setup
    mPullToRefreshLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);

    // Now setup the PullToRefreshLayout
    ActionBarPullToRefresh.from(this)
            // Mark All Children as pullable
            .allChildrenArePullable()
            // Set the OnRefreshListener
            .listener(this)
            // Finally commit the setup to our PullToRefreshLayout
            .setup(mPullToRefreshLayout);
}
 
开发者ID:pranayairan,项目名称:CodeLessDoMore,代码行数:25,代码来源:MainActivity.java

示例11: 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_subreddit, container, false);
    mPullToRefreshLayout = (PullToRefreshLayout) rootView.findViewById(R.id.ptr_layout);
    ListView postList = (ListView) rootView.findViewById(R.id.Subreddit_post_list);
    postList.setOnScrollListener(new PostsScrollListener());
    postList.setAdapter(mAdapter);
    postList.setOnItemClickListener(this);
    postList.setOnTouchListener(new ListSwipeInteraction(postList, null));

    // Now setup the PullToRefreshLayout
    ActionBarPullToRefresh.from(getActivity())
            // Mark All Children as pullable
            .allChildrenArePullable()
                    // Set the OnRefreshListener
            .listener(this)
                    // Finally commit the setup to our PullToRefreshLayout
            .setup(mPullToRefreshLayout);
    return rootView;
}
 
开发者ID:jetpeter,项目名称:OpenReddit,代码行数:21,代码来源:SubredditFragment.java

示例12: initializeRefreshOnDrag

import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
private void initializeRefreshOnDrag(View rootView) {
  // Now find the PullToRefreshLayout to setup
  mPullToRefreshLayout = (PullToRefreshLayout) rootView.findViewById(R.id.ptr_layout);

  // Now setup the PullToRefreshLayout
  ActionBarPullToRefresh.from(getActivity()).options(Options.create().refreshOnUp(true).build())
      // Mark All Children as pullable
      .allChildrenArePullable()
          // Set a OnRefreshListener
      .listener(new OnRefreshListener() {
        @Override
        public void onRefreshStarted(View view) {
          fetchAll();
        }
      })
          // Finally commit the setup to our PullToRefreshLayout
      .setup(mPullToRefreshLayout);
}
 
开发者ID:Habitats,项目名称:bitcoupon,代码行数:19,代码来源:CouponListFragment.java

示例13: 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

示例14: 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

示例15: onCreateView

import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.pull_to_refresh_list, container, false);
    if (v == null) {
        return null;
    }
    ButterKnife.bind(this, v);

    /**
     * PullToRefreshの初期化処理
     */
    ActionBarPullToRefresh.from(getActivity())
            .theseChildrenArePullable(mListView)
            .listener(this)
            .setup(mPullToRefreshLayout);

    mListView.setOnItemClickListener(new StatusClickListener(getActivity()));
    mListView.setOnItemLongClickListener(new StatusLongClickListener(getActivity()));
    mListView.setOnScrollListener(mOnScrollListener);
    mFooter.setVisibility(View.GONE);
    mListView.setFastScrollEnabled(BasicSettings.getFastScrollOn());

    return v;
}
 
开发者ID:s-aska,项目名称:Justaway-for-Android-Original,代码行数:25,代码来源:BaseFragment.java


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