Search in sources :

Example 1 with AbsListViewDelegate

use of uk.co.senab.actionbarpulltorefresh.library.viewdelegates.AbsListViewDelegate in project ActionBar-PullToRefresh by chrisbanes.

the class GridViewActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_gridview);
    GridView gridView = (GridView) findViewById(R.id.ptr_gridview);
    ListAdapter adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, ITEMS);
    gridView.setAdapter(adapter);
    // Now find the PullToRefreshLayout and set it up
    mPullToRefreshLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);
    ActionBarPullToRefresh.from(this).options(Options.create().scrollDistance(.75f).headerLayout(R.layout.customised_header).headerTransformer(new CustomisedHeaderTransformer()).build()).allChildrenArePullable().listener(this).useViewDelegate(GridView.class, new AbsListViewDelegate()).setup(mPullToRefreshLayout);
}
Also used : AbsListViewDelegate(uk.co.senab.actionbarpulltorefresh.library.viewdelegates.AbsListViewDelegate) GridView(android.widget.GridView) ListAdapter(android.widget.ListAdapter) ArrayAdapter(android.widget.ArrayAdapter)

Example 2 with AbsListViewDelegate

use of uk.co.senab.actionbarpulltorefresh.library.viewdelegates.AbsListViewDelegate in project ActionBar-PullToRefresh by chrisbanes.

the class GridViewActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_gridview);
    GridView gridView = (GridView) findViewById(R.id.ptr_gridview);
    ListAdapter adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, ITEMS);
    gridView.setAdapter(adapter);
    // Now find the PullToRefreshLayout and set it up
    mPullToRefreshLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);
    ActionBarPullToRefresh.from(this).options(Options.create().scrollDistance(.75f).headerLayout(R.layout.customised_header).headerTransformer(new CustomisedHeaderTransformer()).build()).allChildrenArePullable().listener(this).useViewDelegate(GridView.class, new AbsListViewDelegate()).setup(mPullToRefreshLayout);
}
Also used : AbsListViewDelegate(uk.co.senab.actionbarpulltorefresh.library.viewdelegates.AbsListViewDelegate) GridView(android.widget.GridView) ListAdapter(android.widget.ListAdapter) ArrayAdapter(android.widget.ArrayAdapter)

Example 3 with AbsListViewDelegate

use of uk.co.senab.actionbarpulltorefresh.library.viewdelegates.AbsListViewDelegate in project ActionBar-PullToRefresh by chrisbanes.

the class GridViewActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_gridview);
    GridView gridView = (GridView) findViewById(R.id.ptr_gridview);
    ListAdapter adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, ITEMS);
    gridView.setAdapter(adapter);
    // Now find the PullToRefreshLayout and set it up
    mPullToRefreshLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);
    ActionBarPullToRefresh.from(this).options(Options.create().scrollDistance(.75f).headerLayout(R.layout.customised_header).headerTransformer(new CustomisedHeaderTransformer()).build()).allChildrenArePullable().listener(this).useViewDelegate(GridView.class, new AbsListViewDelegate()).setup(mPullToRefreshLayout);
}
Also used : AbsListViewDelegate(uk.co.senab.actionbarpulltorefresh.library.viewdelegates.AbsListViewDelegate) GridView(android.widget.GridView) ListAdapter(android.widget.ListAdapter) ArrayAdapter(android.widget.ArrayAdapter)

Aggregations

ArrayAdapter (android.widget.ArrayAdapter)3 GridView (android.widget.GridView)3 ListAdapter (android.widget.ListAdapter)3 AbsListViewDelegate (uk.co.senab.actionbarpulltorefresh.library.viewdelegates.AbsListViewDelegate)3