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


Java PullToRefreshLayout类代码示例

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


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

示例1: onCreateView

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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: onCreateView

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    mTimelineView = inflater.inflate(R.layout.fragment_timeline, container, false);
    mTimelineList = (ListView) mTimelineView.findViewById(R.id.timeline_list);
    mLoadingProgress = (ProgressBar) mTimelineView.findViewById(R.id.loading_progress);
    mPullToRefreshLayout = (PullToRefreshLayout) mTimelineView.findViewById(R.id.ptr_layout);

    initPullToRefreshLayout();
    initTimelineList();

    ((MainActivity)getActivity()).setActionbarTitleDoubleClickListener(new Runnable() {
        @Override
        public void run() {
            mTimelineList.smoothScrollToPosition(0);
        }
    });

    return mTimelineView;
}
 
开发者ID:ragnraok,项目名称:MonoReader,代码行数:22,代码来源:TimelineFragment.java

示例3: onActivityCreated

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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.PullToRefreshLayout; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_listview_empty);

    /**
     * Get ListView and give it an adapter to display the sample items
     */
    ListView listView = (ListView) findViewById(R.id.ptr_listview);
    mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,
            new ArrayList<String>());
    listView.setEmptyView(findViewById(android.R.id.empty));
    listView.setAdapter(mAdapter);

    /**
     * Here we create a PullToRefreshAttacher manually without an Options instance.
     * PullToRefreshAttacher will manually create one using default values.
     */
    mPullToRefreshAttacher = PullToRefreshAttacher.get(this);

    // Set the Refreshable View to be the ListView and the refresh listener to be this.
    PullToRefreshLayout ptrLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);
    ptrLayout.setPullToRefreshAttacher(mPullToRefreshAttacher, this);
}
 
开发者ID:HsingPeng,项目名称:ALLGO,代码行数:25,代码来源:ListViewWithEmptyActivity.java

示例5: onCreate

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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

示例6: onViewCreated

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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

示例7: onCreateView

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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

示例8: onCreate

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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

示例9: onCreateView

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

    mPullToRefreshLayout = (PullToRefreshLayout) inflater.inflate(R.layout.fragment_orders, container, false);
    mListView = (ListView) mPullToRefreshLayout.findViewById(R.id.list_view_fragment_order);
    mListView.setEmptyView(mPullToRefreshLayout.findViewById(R.id.progress_bar_fragment_order));
    mListView.setOnItemClickListener(this);
    mListView.setOnScrollListener(this);

    mOrderAdapter = new OrderAdapter();
    mListView.setAdapter(mOrderAdapter);

    return mPullToRefreshLayout;
}
 
开发者ID:hoyin258,项目名称:MisterWok,代码行数:17,代码来源:OrderListFragment.java

示例10: onCreate

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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: initializeRefreshOnDrag

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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

示例12: onCreateView

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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

示例13: onCreateView

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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

示例14: initView

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的package包/类
private void initView() {
    mPtrLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);
    mTimelineList = (ListView) findViewById(R.id.timeline_list);
    mProgressBar = (ProgressBar) findViewById(R.id.loading_progress);

    initPtrLayout();
    initTimelineList();
}
 
开发者ID:ragnraok,项目名称:MonoReader,代码行数:9,代码来源:CategoryTimelineActivity.java

示例15: onCreate

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

    // Create new PullToRefreshAttacher
    mPullToRefreshAttacher = PullToRefreshAttacher.get(this);

    // Retrieve the PullToRefreshLayout from the content view
    PullToRefreshLayout ptrLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);

    // Give the PullToRefreshAttacher to the PullToRefreshLayout, along with the refresh
    // listener (this).
    ptrLayout.setPullToRefreshAttacher(mPullToRefreshAttacher, this);
}
 
开发者ID:HsingPeng,项目名称:ALLGO,代码行数:16,代码来源:ScrollViewActivity.java


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